如何撤消“svn 副本”

发布于 2024-07-17 02:16:18 字数 237 浏览 10 评论 0原文

我不小心通过使用“svn copy”复制主干来覆盖旧分支。 更具体地说,对于每个版本,主干都会被分支并保留为标签,使用:

svn copy svn://machine/REPOS/trunk svn://machine/REPOS/tags/$RELEASENR

但这次“RELEASENR”的值是旧的现有分支而不是新分支的值。 有人对如何消除这个错误有任何想法吗? 已经谢谢了!

I've accidentally overwritten an old branch by copying trunk over it using 'svn copy'. More specifically, for every release, trunk is branched and kept as a tag, using:

svn copy svn://machine/REPOS/trunk svn://machine/REPOS/tags/$RELEASENR

But this time the value of 'RELEASENR' was that of an old existing branch instead of a new one. Anybody have any ideas on how to undo this mistake? Thanks already!

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

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

发布评论

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

评论(3

澉约 2024-07-24 02:16:18

Subversion 不是这样工作的。 你实际上还没有覆盖它。 如果复制或移动的目标存在并且是一个目录,则复制或移动的项目将放置在该目录中:

svn copy svn://machine/REPOS/trunk svn://machine/REPOS/tags/EXISTS_ALREADY

如果您查看,您应该发现:

svn://machine/REPOS/tags/EXISTS_ALREADY/trunk 

这是您的主干的副本只是尝试标记。 这种情况下的修复很简单:(

svn mv svn://machine/REPOS/tags/EXISTS_ALREADY/trunk \
       svn://machine/REPOS/tags/CORRECT_TAG_NAME

如果您不熟悉 *nix: \ 意味着我已将一个逻辑行分成两个物理行,以免水平滚动条过度工作。)

Subversion doesn't work that way. You haven't actually overwritten it. If the target of the copy or a move exists and is a directory, then the copied or moved item is placed in that directory:

svn copy svn://machine/REPOS/trunk svn://machine/REPOS/tags/EXISTS_ALREADY

If you look, you should find:

svn://machine/REPOS/tags/EXISTS_ALREADY/trunk 

Which is a copy of the trunk you just tried to tag. The fix in this case is easy:

svn mv svn://machine/REPOS/tags/EXISTS_ALREADY/trunk \
       svn://machine/REPOS/tags/CORRECT_TAG_NAME

(In case you're not *nix conversant: The \ means I've broken one logical line into two physical lines to spare your horizontal scrollbar from overwork.)

垂暮老矣 2024-07-24 02:16:18

为了撤消,只需使用

svn cp OLDFOLDER NEWFOLDER

如果更改尚未提交,

svn revert NEWFOLDER --depth=infinity

In order to undo

svn cp OLDFOLDER NEWFOLDER

if the change has not yet been committed, just use

svn revert NEWFOLDER --depth=infinity
隱形的亼 2024-07-24 02:16:18

您可以通过合并回先前的修订来撤消上次的修订。
请参阅http://anilsaldhana.blogspot.com/2007/11/svn- undo-change.html

svn merge --revision 92:91 .

然后提交

You can undo your last revision by merging back to the previous revision.
See http://anilsaldhana.blogspot.com/2007/11/svn-undo-change.html

svn merge --revision 92:91 .

and then commit

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