如何“还原到此修订版”具有来自命令行的特定修订版本号? [英] How can you "Revert to this Revision" with a specific revision number from the Command Line?

查看:237
本文介绍了如何“还原到此修订版”具有来自命令行的特定修订版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在制作一个脚本,其中我已经熟悉了Tortoise SVN和它相应的命令行函数。



我有脚本正确更新找到修订正确地建立与一系列的测试。在脚本记录该变量(版本号是特定的)后,我更新到HEAD修订(所以,我可以在这个过程后,我遇到麻烦)提交。



我的问题:
如何从命令行恢复到特定修订版本号?



我知道你可以svn update -r,但是你怎么做还原,所以它把我的工作副本改为修改状态;以后可以承诺?我只问,因为revert不接受-r参数;除非我犯了一个错误。



我发现如何修订/更新它的工作原理从这个问题:
恢复与tortoise SVN
但是我找不到任何坚实的答案。

解决方案

重要的是使术语正确,因为revert是指Subversion中非常具体的内容,




  • Subversionrevert撤消任何本地的,未提交的更改并重置项目回到其最后知道的存储库状态。这不是你要找的。
  • 通过还原svn update -r 实际上只是将文件更新为具体(过去)修订。你正在恢复到一个旧的修订,但你不是真的改变任何东西(如果你尝试编辑,然后提交,你会被拒绝,因为你没有编辑最新的修订)。

  • 一个恢复,因为你似乎描述它会更好地描述为一个回滚 - 你想撤消所做的任何更改当前修订和过去的一些修订,然后将项目的状态提交为新 HEAD 。在Subversion中,这被称为反向合并。这在Subversion手册中的中有所描述 - 您可以以相反的顺序(从最新到最旧)提供 svn merge 和一系列版本号,然后提交生成的工作副本。


    • I am currently making a script in which I have been coming familiar with Tortoise SVN and it's corresponding command line functions.

      I have the script properly updating to find which "Revision" properly builds with a series of test. After the script records that variable (of the version number to be specific), I update to the HEAD revision (So that I am able to a commit after this process I am having trouble with).

      My question: How do I revert to a specific revision number from the command line?

      I know that you can svn update -r , but how can you do it with a revert so that way it changes my working copy to the modified state; later that can be committed? I only ask because revert doesn't accept the -r argument; unless I am making a mistake.

      I found out how Revisions/Updates it works from this question: reverting with tortoise SVN But I couldn't find any solid answers on this. Any help would be appreciated.

      解决方案

      It's important to get the terminology correct, because "revert" means something very specific in Subversion, whereas in English it can have multiple meanings based on context.

      • A Subversion "revert" is undoing any local, uncommitted changes and resetting the item back to its last known repository state. This is not what you're looking for.
      • "Reverting" via svn update -r is actually just updating the file to a specific (past) revision. You're "reverting" to an old revision, but you aren't really changing anything (and if you attempt to edit, then commit, you'll get rejected because you aren't editing the latest revision). Again, this is not what you're looking for.
      • A revert as you seem to be describing it would be better described as a "rollback" - you want to undo any changes made between the current revision and some revision in the past, and then commit the state of the item(s) as the new HEAD. In Subversion, this is referred to as a reverse merge. This is described in the Subversion manual - you supply svn merge with a range of revision numbers, in reverse order (newest to oldest), then commit the resulting working copy.

      这篇关于如何“还原到此修订版”具有来自命令行的特定修订版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆