TortoiseSVN:将一个分支的内容复制到另一个分支上

发布于 2024-10-08 03:24:12 字数 692 浏览 7 评论 0原文

我使用 TortoiseSVN 来管理 LabView 源代码(即大量不断变化的二进制文件),而无需外部 Subversion 服务器。

我希望有一个存储库的“测试版”分支,任何人都可以订阅并获取每日更新。我想这与具有单独分支的通常测试版本系列不同,但它适合这个项目。

将 trunk 分支的特定修订版的内容复制到 beta 分支的最佳/最简单方法是什么?本质上我想做的是删除 beta 的旧内容并插入新内容。我想删除+添加会起作用,但这显然不是最理想的。合并不是一个选项,除非我能让 Tortoise 自动解决有利于主干的所有冲突,包括删除文件。

更新:有几个人问我为什么不想删除+添加。我想要一个更清洁的替代方案。

  1. 这种方法会导致 beta 树的一半更新被“擦除最后的版本”。
  2. 更新不是原子的,因此有人可以获取空版本。
  3. 我还没有尝试过,但 beta 不是一个合适的分支。由于每次都是“新”文件,修订日志是否会跟踪多个修订?

更新 2: svn 允许在提交之前执行任意命令,但我无法让 Tortoise 以这种方式工作。选择“删除”后,存根目录仍然保留,直到我提交为止,此时我可以重新填充分支。当旧标签修订版和新标签修订版中都存在目录时,需要有一种方法来取消标记要删除的目录。

I'm using TortoiseSVN without an external Subversion server to manage LabView source (i.e. a large collection of ever-changing binary files).

I'd like to have a "beta" branch of the repository that anyone can subscribe to and get daily updates. I guess this is different from a usual beta release series with separate branches, but it's right for this project.

What is the best/easiest way to copy the contents of a particular revision of the trunk branch over to the beta branch? Essentially what I want to do is delete the old contents of beta and insert new contents. Delete+add would work, I suppose, but it's clearly suboptimal. Merge is not an option unless I can get Tortoise to automatically resolve all conflicts in the trunk's favor, including deleting files.

Update: a couple people have asked why I don't want delete+add. I'd like a cleaner alternative.

  1. This method leads to half the updates to the beta tree being "wipe out last rev."
  2. The updates are not atomic so someone could pick up an empty release.
  3. I haven't tried and seen, but beta wouldn't be a proper branch. Would the revision log even track multiple revisions at all, since it's a "new" file each time?

Update 2: svn allows any arbitrary commands before a commit, but I couldn't get Tortoise to work this way. After selecting "Delete," stub directories were still left over until I committed, at which point I could repopulate the branch. There needs to be a way to unmark a directory for deletion when it exists in both the old and new tag revisions.

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

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

发布评论

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

评论(3

失眠症患者 2024-10-15 03:24:12

合并不是一个选择,除非我可以
让Tortoise自动解析
所有冲突都对树干有利,
包括删除文件。

我不知道 TortoiseSVN,但是如果您安装命令行客户端,您可以执行以下操作将最新的 trunk 更改合并到 beta 分支:

cd c:/path/to/my/working/copy/of/beta/branch
svn merge file:///c:/path/to/my/repository/trunk --accept theirs-full
svn commit -m "merged latest trunk changes to beta branch"

--accept Theirs-full 选项通过使用您想要的主干版本来解决所有冲突。

这有一些优点:subversion 会表示共享,因此存储在两个分支上的文件不会占用存储库中的额外空间。此外,当用户更新其 beta 工作副本时,只需通过网络传输已更改的文件。

Merge is not an option unless I can
get Tortoise to automatically resolve
all conflicts in the trunk's favor,
including deleting files.

I don't know about TortoiseSVN, but if you install the command line client you could do the following to merge the latest trunk changes to a beta branch:

cd c:/path/to/my/working/copy/of/beta/branch
svn merge file:///c:/path/to/my/repository/trunk --accept theirs-full
svn commit -m "merged latest trunk changes to beta branch"

The --accept theirs-full option resolves all conflicts by using the trunk's version like you want.

This has some advantages: subversion will do representation sharing, so files stored on both branches will not take extra space in the repository. Also, when users update their beta working copy, only the files that were changed need to be pulled over the wire.

大姐,你呐 2024-10-15 03:24:12

SVN 是事务性的 - 删除和复制(而不是添加!)不会有问题。 beta 将是一个合适的分支(或者更好的标签)

SVN is transactional - a delete and copy (not add!) would not be problematic. And beta would be a proper branch (or better a tag)

她比我温柔 2024-10-15 03:24:12

为什么不删除 beta/* 然后将 trunk/* 复制到 beta/ ?

Why not delete beta/* and then copy trunk/* to beta/ ?

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