在一次签入中提交一组 svn 文件/目录操作
我最近决定重新构建我的 svn 存储库。这项工作包括我的存储库中的大量文件/目录操作(重命名、复制、移动和删除)。默认情况下,每个操作都需要在签入上下文中提交。有没有什么方法可以在一次签入中执行大量此类操作?我使用 TortoiseSVN 和 Collabnet Subversion 1.6.x。
I’ve recently decided to re-structure my svn repositories. This job includes lots of file/directory actions (renaming, copying, moving and deleting) in my repository. By default, each action is required to be committed in the context of a check-in. Is there any method to commit lots of these actions in a single check-in? I use TortoiseSVN and Collabnet Subversion 1.6.x.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TortoiseSVN 有 2 个不同的工具可供使用:
存储库浏览器是一个直接在存储库上工作的 UI 工具,它不知道您何时“开始和结束事务”。因此,如果需要提交,则每个命令本身就是一次提交。我不知道有什么可能性可以举例说。
当您使用集成到 Windows 资源管理器中的 TortoiseSVN Windows 菜单时,您首先必须签出整个存储库。然后,您可能会在本地工作一段时间,使用 SVN 变体进行重命名、移动和复制,并在一段时间后立即提交所有更改。
命令行版本允许您执行这两种操作,但其行为相同。来自
的文档移动
:因此,即使您编写一个批处理文件来执行所有操作并调用它,每个
svn move(和
svn copy
...)本身必须有一个提交消息。因此,无法通过一次提交来重构存储库(仅使用存储库浏览器)。您必须检查整个存储库(至少是您想要重组的部分),在本地执行 svn Something 命令,然后在最后提交。这样做的缺点是你有大量的网络流量,你需要本地的某个地方,并且会花费更多的时间。但这是进行一次提交的唯一方法。
也许可以使用
svnadmin
进行选择,但这本身有很多缺点。TortoiseSVN has 2 different tools to work with:
The repository browser is a UI tool that works directly on the repository, and it does not know when you "begin and end a transaction". So each command is a commit in itself, if a commit is necessary. I do not know any possibility to say for example.
When you work with the TortoiseSVN windows menu integrated into your windows explorer, you first have to checkout the whole repository. Then you may work locally for some time, use the SVN variations for rename, move and copy, and after some time, commit all your changes at once.
The command line version allows you both things, but it behaves the same. From the documentation for
move
:So even when you write a batch file for doing all the stuff, and call that, each
svn move
(andsvn copy
...) has to have a commit message in itself, if you use the variant that works directly on the repository.So there is no option to restructure your repository (with the repository browser only) with a single commit. You have to check out the whole repository (at least the part you want to restructure), do your
svn something
commands locally, and commit then at the end. This has the disadvantage that you have a lot of network traffic, you need some place locally, and it costs much more time. But this is the only way to have a single commit.Perhaps there could be an option with
svnadmin
, but that has a lot of disadvantages in itself.