将项目更新为修订版与还原为修订版 [英] Update Item to Revision vs Revert to Revision

查看:45
本文介绍了将项目更新为修订版与还原为修订版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始在 TortoiseSVN 中使用 Subversion.如果我打开日志并右键单击旧版本,我会看到两个听起来像是回滚到旧版本的选项:将项目更新为版本"和恢复到此版本".

I've started to use Subversion with TortoiseSVN. If I open up the log and right click on an old revision I see two options that sound like they roll back to an older version: "Update item to revision" and "Revert to this revision".

我知道当您只想回顾旧版本但不想真正更改存储库时,会使用更新到旧版本.还原是当您真正搞砸并希望存储库中的最新版本与旧版本相同时.

I understand that updating to an older revision is used when you only want to look back at an old version but not really change the repository. Revert is when you actually screwed up and want the latest revision in the repository to be the same as an older version.

所以说 HEAD 修订版是 100,我恢复到 95.它会将我的工作副本反向合并回 95.然后我可以将该更改提交到存储库,这将正确创建修订版 101?如果我要更新回修订版 95,那会有什么不同?它不是仍然只是颠倒上次修订的更改吗?我对恢复或更新到旧版本后工作副本的状态有何不同感到困惑.

So say the HEAD revision is 100 and I revert back to 95. It will reverse merge my working copy back to 95. Then I can commit that change to the repository which would create revision 101 correct? How is that different if I were to update back to revision 95? Doesn't it still just reverse the changes from the last revisions? I'm confused as to how the state of my working copy differs after a Reverting or Updating to an older revision.

推荐答案

更新到修订版 只会将您工作副本的文件更新到您选择的修订版.但是您无法继续进行此修订,因为 SVN 会抱怨您的工作副本过时.

Update to revision will only update files of your workingcopy to your choosen revision. But you cannot continue to work on this revision, as SVN will complain that your workingcopy is out of date.

恢复到此修订版 将撤消在选定修订版之后所做的工作副本中的所有更改(在您的示例中为 96,97,98,99,100)您的工作副本现在处于修改状态.

revert to this revision will undo all changes in your working copy which were made after the selected revision (in your example rev. 96,97,98,99,100) Your working copy is now in modified state.

两个场景的文件内容相同,但是在第一种情况下,您有一个未修改的工作副本,并且在第二种情况下您无法提交更改(因为您的工作副本未指向 HEAD rev 100)你有一个修改指向头部的工作副本,你可以继续工作和提交

The file content of both scenarions is same, however in first case you have an unmodified working copy and you cannot commit your changes(as your workingcopy is not pointing to HEAD rev 100) in second case you have a modified working copy pointing to head and you can continue to work and commit

这篇关于将项目更新为修订版与还原为修订版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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