StarTeam 用户的 Subversion 概念

发布于 2024-10-10 20:50:54 字数 540 浏览 2 评论 0原文

我想知道如何在 SVN

1 中执行以下常见 StarTeam 任务。如何更新标签以包含 1 个文件的较新版本?

在 StarTeam 中创建查看标签后(类似于 SVN 中的标签) - 我能够包含较新版本将文件添加到该视图标签中 - 例如,更新视图以仅包含该文件(而不包含自创建该视图标签以来也发生更改的其他文件视图标签

2. 如何基于以下内容创建标签另一个标签?

当开发在发布版本时继续进行时,某些功能虽然已签入,但不会包含在内。在 StarTeam 中,我曾经根据先前的视图创建视图标签(再次,像标签) (然后执行我在问题 1 中描述的操作)我知道在 SVN 中我可以基于另一个标签创建一个标签,但它是只读的,而且我需要一个分支,但我真的不需要一个分支。

3. 如何签入/添加到现有标签?

在 StarTeam 中,视图标签位于主干/分支上,因此我可以在创建视图后签入文件并修改标签。要包含它,在 SVN 中我必须签入分支

I would like to know how to do the following common StarTeam tasks in SVN

1. How to update a tag to include a newer revision of just 1 file?

After creating a View Label in StarTeam (similiar to a tag in SVN) - I was able to include a newer revision of a file into that view label - e.g. update the view to include only that file (and not others that also changed since the creation of that View Label

2. How to create a tag based on another tag?

When development continues while releasing a version, some features are not to be included although they are checked in. In StarTeam, I used to create a view label (again, like a tag) based on a previous view (and then do what I describe in question 1). I understand that in SVN I can create a tag based on another, but that it is read only, and I need a branch. but I don't really need a branch, really.

3. How to check-in / add to an existing tag?

In StarTeam the view label is on the trunk / branch, so I could check in a file after a view is created and modify the lable to include it, in SVN I have to check into the branch

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

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

发布评论

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

评论(1

情深已缘浅 2024-10-17 20:50:54

首先我要说的是,我不熟悉 StarTeam,因此我可能无法完全理解您尝试重现的工作流程。

Subversion 本身并不区分标签和分支。按照惯例,标签只是一个您永远不会修改的分支。即使分支只是一个“svn复制”操作,没有单独的“分支”功能。分支只是一个廉价的副本,而标签是按照惯例只读的分支。 svn 中的副本非常便宜,因此您不必担心创建分支太多 - 标签并不比分支便宜。您可能需要阅读 创建分支。它进一步解释了事情......并且有一个关于“廉价副本”的盒装部分。

根据您在 StarTeam 中使用的“查看标签”,可能会出现 svn externals 可能对您的目的有用。我一般不喜欢它们,但这取决于场景。

更直接地回答您的问题...

1)这将取决于文件中是否有其他更改。您想要将一项修订的更改写入一个文件中吗?或 1 个文件的所有更改(多次修订,仅 1 个文件)。希望你指的是前者。在这种情况下,通常的行为是合并

假设您有以下场景:

------------------------------------> /trunk
 |     | fix merged to 1.0 branch
 |     v
  \------------> /branches/1.0
    |  ^ |
    |    \ /tags/1.1  1.1 tag, fix released to customer(s)
    \ /tags/1.0 - 1.0 GA tag, release sent to customer(s)

您在主干上开发。在版本 10 中,您的产品已经准备好发布 1.0!您创建一个分支:

svn copy /path/to/trunk /path/to/branches/1.0

然后继续在主干上进行开发,同时还在 1.0 分支上进行一些额外的验证。当准备好发货时,您可以创建一个标签:

svn copy /path/to/branches/1.0 /path/to/tags/1.0

该标签是一个冻结的时间点,与您要发货给客户的商品完全匹配。

您发现 1.0 版本客户所需的错误/功能/更新已在主干上完成。就您而言,您已经声明了对特定文件的更改。

假设更改发生在修订版 15 中的主干上。然后您可以执行以下操作(从干净的 /branches/1.0 工作副本):

svn merge -c 15 /url/to/repo/path/to/trunk

在理想情况下,修订版的更改是独立的,并且需要修订版中的所有文件。有时还有一些您不想合并的额外内容。在这种情况下,合并后,恢复对不想合并的文件的更改,测试所有内容,然后提交。合并有一个缺点 ->恢复一些文件 ->提交工作流程,即 subversion 会记录发生的合并,但您已经排除了其中的部分内容。如果有问题的分支不太可能进一步更改(或重新集成到另一个分支),这可能并不重要,但我更喜欢为您想要的 1 个文件中的更改创建一个补丁文件,并在某些情况下手动将它们应用到分支像那样。我对 cmd 行语法不是 100% 确定,但我认为它非常相似:

svn diff -c 15 /path/to/file (in repo or otherworking copy) > my-patch.diff

并使用另一个工具应用。我通常在 GUI 中创建/应用补丁,因此具体细节将留给您作为练习。

完成后,您再次在分支上创建一个新标签,其中将包含新的合并更改。

svn copy /path/to/branches/1.0 /path/to/tags/1.1

然后,您将拥有一个与旧标签相同的新标签,除了对 1 文件进行更改之外。在#3 中,我还将提到您可以重新创建标签(尽管这取决于您使用该标签的目的,这是否是一个好主意)。
r,但只有当标签不代表已发布的代码时我才会这样做。

2) 事实上,由于按照惯例,标签是​​只读的,因此标签与另一个标签之间不会有真正的不同。但是,如果您改为使用第一个分支,然后创建一个标签(按照建议),您可以稍后基于同一分支创建第二个标签(在提交其他更改后),它将与您的第一个标签不同仅标记自那时以来已应用于该分支的更改。

3)同样,您通常会使用分支。如果分支/标签仅在内部使用(我建议删除已发布代码的发布标签,尽管它并没有真正“丢失”,但通常不需要 - ) ,您只需删除 &重新创建标签。您的标签(工作副本)的使用者可以在标签被删除和更新后执行正常的“svn update”。重新创建并将继续正常工作,就好像什么也没发生一样。这不能用于#1,但可以用于#2(当您确实只想更新标签时)。诀窍是结合标记和分支来实现你想要的。如果您还使用它来部署到网站或其他东西,您可以组合分支、标记和外部。

例如,可以检查 /path/to/products,其中有一个指向 /tags/1.0 的外部条目,当您想要应用修复时,请执行 #2 中的步骤并创建 /tags/1.1 并调整外部条目。或者,只需将其指向分支,无需重新创建标签。

我希望这是一个半有用的开始。

Let me preface by saying I'm not familiar with StarTeam, so I may not fully understand the workflow you're trying to reproduce.

Subversion itself doesn't differentiate between tags and branches. By convention, a tag is just a branch that you never modify. Even a branch is just an "svn copy" operation, there isn't a separate "branch" feature. A branch is just a cheap copy, and a tag is a branch that is read-only by convention only. Copies in svn are very cheap, so you don't need to worry about creating branches a lot - a tag is not any cheaper than a branch. You may want to read the docs on Creating a Branch. It further explains things... and has a boxed section about "Cheap Copies".

Depending on your use of "View Labels" in StarTeam, it is possible that svn externals may be useful for your purposes. I don't generally like them, but it depends on the scenario.

On to your questions more directly...

1) This will depend on if there are other changes in the file. Do you want the changes from one revision in one file? Or all changes for 1 file (multiple revisions, only the 1 file). Hopefully you mean the former. In which case, the usual behavior would be to merge

Let's say you have the following scenario:

------------------------------------> /trunk
 |     | fix merged to 1.0 branch
 |     v
  \------------> /branches/1.0
    |  ^ |
    |    \ /tags/1.1  1.1 tag, fix released to customer(s)
    \ /tags/1.0 - 1.0 GA tag, release sent to customer(s)

You develop on trunk. At revision 10, your product is already ready to ship 1.0! You create a branch with:

svn copy /path/to/trunk /path/to/branches/1.0

You then continue developing on trunk, while also doing a bit of extra verification on the 1.0 branch. When it is ready to ship, you create a tag:

svn copy /path/to/branches/1.0 /path/to/tags/1.0

This tag is a frozen point in time that exactly matches what you are shipping to customers.

You discover a bug/feature/update that is needed for your 1.0 release customers that has already been done on trunk. In your case, you've stated changes to a particular file.

Let's say the changes occurred on trunk in revision 15. You'd then do (from a clean /branches/1.0 working copy):

svn merge -c 15 /url/to/repo/path/to/trunk

In the ideal case, the changes of a revision are self-contained and all files in the revision are needed. Sometimes there is also extra things you do not want to merge. In this case, after the merge, revert the changes to files you do not want merged, test everything, and then commit. There is a downside to the merge -> revert some files -> commit workflow, which is that subversion will record the merge as happening, yet you've excluded portions of it. If the branch in question isn't likely to change much further (or reintegrate to another branch) it may not matter, but I prefer creating a patch file for the changes in the 1 file you want and applying them to the branch manually for cases like that. I'm not 100% certain on the cmd line syntax, but I think it would be quite similar:

svn diff -c 15 /path/to/file (in repo or other working copy) > my-patch.diff

and apply with another tool. I usually create/apply patches in a GUI, so the specifics will be left as an exercise to you.

Once done with that, you create a new tag off your branch again, that will contain your new merged change.

svn copy /path/to/branches/1.0 /path/to/tags/1.1

You then have a new tag that is the same as the old tag, except for having the changes to the 1 file. In #3 I will also mention that you can recreate the tag (though it depends what you are using the tag for on whether it is a good idea).
r, but I would only do this if the tag does not represent shipped code.

2) Indeed, since by convention a tag is read only, a tag from another tag would not really be different. However, if you instead use a branch for the first one, then create a tag off that (as suggested), you can later create a second tag based off of the same branch (after committing additional changes) and it will differ from your first tag by only the changes that have been applied to that branch since then.

3) Again, you would normally use a branch. If the branch/tag is used solely internally (I do not recommend ever deleting a release tag of shipped code, although it isn't really "lost", it just shouldn't normally be necessary - ), you can just delete & recreate the tag. Consumers of your tag (working copies) can just do a normal "svn update" after the tag is deleted & recreated and will continue to work fine as if nothing happened. This couldn't be used for #1 but could be for #2 when really you just want to update a tag. The trick is combine tagging and branching to achieve what you want. If you're also using this to deploy toa website or something, you can combine branching, tagging, and externals.

e.g. /path/to/production can be checked out which has an externals entry to /tags/1.0, and when you want to apply a fix you perform the steps in #2 and create a /tags/1.1 and adjust the externals entry. Or, just have it point at the branch and no need to recreate tags.

I hope that is a semi-useful start.

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