集市里的标签有什么用?

发布于 2024-07-17 21:14:02 字数 1139 浏览 3 评论 0 原文

在 svn 领域露营了很长时间之后,我开始使用 bazaar。 我以前也有过 cvs 的经验,偶尔也会使用标签。

使用 svn,一旦发布版本,您就可以将 trunk 的 svn 副本复制到标签中,例如 svn copy trunk Tags/1.2.0 。 在 bazaar 中,我创建了相同的存储库结构,但缺少 bzr 复制选项和 bzr 标签的存在让我深思。

事实上,我发现标签要么很难使用,要么毫无用处。 如果我使用标签,我基本上将我的主干作为唯一的目录,当我达到一个里程碑时,我会对其进行标记。 然后,当达到新的里程碑时,我会继续开发并再次标记。 这使以下任务变得复杂:

  • 递归地将新版本与旧版本进行比较(使用类似 svn 的方法:diff --brief -r)
  • 修复旧版本的错误,并创建补丁版本增加的新版本(使用类似 svn 的方法) :svn复制2.0.0 2.0.1,然后将修复添加到2.0.1并提交)
  • 获得你想要的版本,而不必检查它(如果你像svn一样检查整个树,你就拥有了所有版本和分支,并且只执行一次)

因此,我在 bzr 中使用相同的 svn repo 结构,并且每次都执行主干的物理副本。 这意味着我在这种安排中没有看到 bzr tag 命令的任何实际用途。 如果每个版本都包含所有版本号,为什么我应该用版本号标记整个存储库版本?

谁能指出我在使用和理解 bzr 存储库标签时做错了什么?


编辑

据我所知,这个概念是每个版本都有不同的 bzr 分支(独立分支,通过 bzr 分支来自主干)。 它就像svn,只是你不把根目录放在存储库中。 我仍然没有真正看到标签的任何特殊原因,除了事实之外,如果你说 foo-1.0.0 foo-1.0.1 foo-2.0.0 foo-2.1.0 trunk

并假设我总是在分支之前标记发布,trunk 将具有所有这些版本的标签,而 foo-2.0.0 将在其标签中包含 foo-1.0.0,但不会包含 foo-1.0.1,因为它是从 foo- 分支的1.0.0。

我仍然没有真正看到拥有和使用标签的必要性。 我的标签隐含在我为该分支选择的目录名称中。 我对特定的版本号并不真正感兴趣,我只是对它位于特定的目录中感兴趣。

I started using bazaar after a long camping in the svn field. I had previous experience with cvs as well, and I used tags occasionally.

With svn, once you release a version, you perform a svn copy of your trunk into tags, for example svn copy trunk tags/1.2.0 . In bazaar I created the same repository structure, but the absence of a bzr copy option and the presence of bzr tag made me ponder.

The fact is that I find tags either hard to use, or useless.
If I use tags, I basically have my trunk as the only directory, and when I reach a milestone, I tag it. I then continue to develop and tag again when a new milestone is reached. This complicates the following tasks:

  • comparing a new version against an old version recursively (with the svn-like approach : diff --brief -r)
  • bugfixing an old version, and create new version with its patchversion increased (with the svn-like approach: svn copy 2.0.0 2.0.1, then add the fix to 2.0.1 and commit it)
  • getting the version you want without having to check it out (if you check out the whole tree in svn-like, you have all the versions and branches, and you do it only once)

As a result, I use the same svn repo structure in bzr, and I perform a physical copy of the trunk every time. This means that I don't see any real use of the bzr tag command in this arrangement. why should I tag the whole repo revision with a version number, if it contains all of them for every revision?

Could anyone please point me out what I am doing wrong in using and understanding tags for a bzr repo?


Edit

So as far as I see the concept is to have different bzr branches (independent branches, coming from the trunk via bzr branch) for each release. It's like svn, just that you don't put the root directory in the repository. I still don't really see any particular reason for tags, apart of the fact that, if you have say
foo-1.0.0
foo-1.0.1
foo-2.0.0
foo-2.1.0
trunk

and assuming I always tagged releases before branching, trunk will have tags for all of them, while foo-2.0.0 will have foo-1.0.0 among its tags, but not foo-1.0.1 because that was branched from foo-1.0.0.

I still don't really see the need for having and using tags. My tag is implicit in the directory name I choose for that branch. I am not really interested in a particular release number, I'm just interested that it's into a specific directory.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笔芯 2024-07-24 21:14:02

bzr 中的标签是什么?

标签只是特定版本的易于记忆的句柄。 而不是尝试记住 [电子邮件受保护] ,或 revno 19721,您可以参考您的标签:

bzr export -r tag:foo-1.0.0.0 release-foo-1.0.0.0.tar.gz trunk/

How might I managementreleases in bzr?

听起来好像您将您的版本视为单独的开发线(又名:分支),所以我建议标记你的主干,这样你就知道你从哪里分支并创建单独的发布分支:

bzr tag -r 1234 -d trunk/ foo-1.0.0.0 
bzr branch -r 1234 trunk/ release-1.x

当你为 1.x 版本进行错误修复时,你在 release-1.x 分支中进行,标记每个分支点发布:

bzr tag -r 1255 -d release-1.x/ foo-1.0.0.1
bzr export -r tag:foo-1.0.0.1 release-foo-1.0.0.1.tar.gz release-1.x/

您的目录结构可能如下所示:

fooproj/
  release-1.x/
  release-2.x/
  trunk/

What are tags in bzr?

Tags are just an easy to remember handle for a particular revision. Rather than attempting to remember [email protected], or revno 19721, you can refer to your tag:

bzr export -r tag:foo-1.0.0.0 release-foo-1.0.0.0.tar.gz trunk/

How might I manage releases in bzr?

It sounds as if you are treating your releases as separate lines of development (aka: branches), so I would recommend tagging your trunk, so you know where you branched from and creating separate release branches:

bzr tag -r 1234 -d trunk/ foo-1.0.0.0 
bzr branch -r 1234 trunk/ release-1.x

When you do your bugfixes for 1.x releases, you do them in the release-1.x branch, tagging each point release:

bzr tag -r 1255 -d release-1.x/ foo-1.0.0.1
bzr export -r tag:foo-1.0.0.1 release-foo-1.0.0.1.tar.gz release-1.x/

Your directory structure might look something like this:

fooproj/
  release-1.x/
  release-2.x/
  trunk/
甜点 2024-07-24 21:14:02

嗯,基本上,您不应该尝试复制 SVN 目录结构。 我不知道为什么 SVN 会这样,但基本上标签只是 bzr 存储库中某个时间点的标记。 当您想要与标签进行比较时,可以像这样完成,

bzr diff -r tag:TAG_NAME

所以每当您发布版本时,只需对其进行标记即可。 没有什么特别的,比如将某些内容移动到特定文件夹或任何其他内容。

我建议您开始使用单独的分支而不是标签来处理您想要返回的内容,例如代码的 2.0.x 行,这样您就会有一个 2.0.x 的分支,然后是 2.0 之类的标签.0 和 2.0.1 都在其中。

另外,请查看 http://bazaar-vcs.org/Specs/Tagging

Well, basically, you shouldn't try and copy the SVN directory structure. I have no idea why SVN has it that way, but basically tags are just a marker at a point in time in your bzr repository. When you want to diff against a tag, it can be done like

bzr diff -r tag:TAG_NAME

So whenever you're making a release, just tag it and be on your way. Nothing special like moving something to a specific folder or anything.

I'd recommend you to start using separate branches instead of tags for things you'd like to get back to, say the 2.0.x line of your code, so you'd have a branch for 2.0.x and then tags like 2.0.0 and 2.0.1 in it.

Also, check out http://bazaar-vcs.org/Specs/Tagging

梦旅人picnic 2024-07-24 21:14:02

svn 中的标签更像是 svn 分支。 您已经描述了很好地映射到 bzr 分支的工作流程。 标签允许您拥有一个带有指向您的版本的指针的分支,因此任何人都可以从主干获取确切的发布版本:

bzr Branch trunk foo-1.0 -r tag:1.0

Tags in svn is more like svn branches. You have described the workflow that mapped well to bzr branches. Tags allows you have one branch with pointers to your releases, so anyone can get exactly released version from trunk:

bzr branch trunk foo-1.0 -r tag:1.0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文