SVN 和修订号
可能的重复:
SVN 和修订号
假设我有 3 个文件 foo.txt、bar.txt 和 moo.txt全部在修订版 1 中。
假设我提交了 foo.txt 和 bar.txt 十次。 所以他们的版本是 1.10。 由于在 SVN 中只有一个修订版,所以 moo.txt 也必须是修订版 1.10。 现在,如果我查看 moo.txt 的历史记录,我会看到从 1 到 10 的提交历史记录吗?
我问这个问题的原因是我告诉我的朋友 CVS 与 SVN 相比有多糟糕。 他是 CVS 的忠实粉丝。 所以他告诉我,由于 CVS 修订号是特定于文件的,因此他很容易将单个文件恢复到某种状态(因为单个文件的历史记录不包含对项目其他部分所做的提交)。 由于我总是将整个项目更新到以前的版本(而不是单个文件),因此我从未遇到过这种情况。 所以我想知道SVN中是如何处理的?
Possible Duplicate:
SVN and revision numbers
Say I have 3 files foo.txt, bar.txt and moo.txt all at revision 1.
Say I commit foo.txt and bar.txt ten times. So they are at revison 1.10. Since in SVN there is a single revision no moo.txt also has to be at revision 1.10. Now if I see the history of moo.txt then, will I see the history of commits from 1 to 10?
The reason I am asking this question is I was telling my friend how sucky CVS is when compared to SVN. He is a big fan of CVS. So he told me since CVS revision numbers are file specific it is very easy for him to bring a single file back to some status (since the history of single file does not contain the commits done to other sections of the project). Since I always update my whole project to a previous version (not single file) I have never come across this situation. So, I want to know how is this handled in SVN?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Subversion 中,所有版本号都是整数(例如,没有 1.10),您只需使用 1、2、3 等等,在示例中最多为 10。 如果您要查看特定文件的历史记录,您只会看到该特定文件的修订历史记录:
(历史记录的非常简单的示例)
如果您要恢复如果将 moo.txt 恢复到修订版 7 期间的状态(未进行任何更改),它将处于与修订版 6 和 5 相同的状态(因为文件在这些时间之间没有更改。
我希望这是一些使用,我不是 100% 确定你在问什么,如果我误解了,我深表歉意。
In subversion, all version numbers are integers (so there is no 1.10 for example), you'd just go 1, 2, 3 and so forth, up to ten in your example. If you were to view the history of a specific file, you would only see the revision history for that particular file:
(very simplified example of the history)
If you were to revert moo.txt back to the point it was at during revision 7 (where no changes were made), it would be at the same state as revisions 6 and 5 (since the file was not changed between these times.
I hope this is of some use, I'm not 100% sure what you were asking. Apologies if I misunderstood.
不是像 CVS 中的虚线怪物 (1.1, 1.2, ... 以及分支 1.2.1.1, 1.2.1.2, ...)
在 SVN 中,修订号为整数 (1, 2, 3, ...),而 SVN 的优点是版本号对于存储库来说是全局的,因此您可以将整个项目恢复到特定版本,而这在 CVS 中不可能。
恢复单个文件仍然是可能的,只需将 svn update 与单个文件参数一起使用即可。
In SVN, revision number as integers (1, 2, 3, ...), not dotted monsters as in CVS (1.1, 1.2, ... and on branch 1.2.1.1, 1.2.1.2, ...)
The big advantage of SVN is that the revision number is global to the repository, so that you CAN revert the whole project to a specific revision, which is NOT possible in CVS.
reverting a single file is still possible, just use
svn update
with a single file argument.