SVN和修订号 [英] SVN and revision numbers

查看:80
本文介绍了SVN和修订号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我在修订版1上有3个文件foo.txt,bar.txt和moo.txt。

Say I have 3 files foo.txt, bar.txt and moo.txt all at revision 1.

说我提交foo.txt和bar.txt十个次。因此,它们的版本为1.10。由于在SVN中只有一个修订版本,因此moo.txt也不必在修订版本1.10上。现在,如果我看到了moo.txt的历史记录,那么我会看到1到10次提交的历史记录吗?

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?

我问这个问题的原因是我正在告诉我的朋友与SVN相比,CVS有多糟糕。他是CVS的忠实粉丝。因此,他告诉我,由于CVS修订号是特定于文件的,因此他很容易将单个文件恢复到某种状态(因为单个文件的历史记录不包含对项目其他部分所做的提交)。由于我总是将整个项目更新到以前的版本(而不是单个文件),所以我从未遇到过这种情况。因此,我想知道在SVN中如何处理?

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?

推荐答案

当您查看文件的历史记录时,您只会查看包含该文件的提交的注释和更改,但修订号不一定是连续的。

When you look at the history of a file you will only see the comments and changes for commits made that included that file, but the revision numbers will not necessarily be consecutive.

但是您仍然可以将单个文件还原为任何特定文件修订版本号而不会影响其他文件。

But you can still revert a single file back to any specific revision number without affecting other files.

例如

两个文件:

foo。 txt和bar.txt

two files:
foo.txt and bar.txt

1:签入foo.txt

2:签入foo.txt& bar.txt

3:签入foo.txt

4:签入bar.txt

5:签入foo.txt

6 :checkin bar.txt

1: checkin foo.txt
2: checkin foo.txt & bar.txt
3: checkin foo.txt
4: checkin bar.txt
5: checkin foo.txt
6: checkin bar.txt

如果您查看酒吧的历史记录,将会看到:

If you look at the history of bar, you will see:

6:

4:

2:

6:
4:
2:

您仍然可以将bar.txt恢复为修订版2,而不会影响foo.txt

And you would still be able to revert bar.txt back to revision 2 without effecting foo.txt

如果您查看foo的历史,将会看到:

if you look at the history of foo you will see:

5:

3:

2:

1:

5:
3:
2:
1:

如果您查看整个目录的历史记录,您将看到所有提交。

If you look at the history of the whole directory, you will see all of the commits.

拥有一个存储库范围的版本号仅意味着您可以从其修订版号中知道更改内容的顺序。它不会影响您查看历史记录或回滚文件的能力。

Having a repository wide version number just means that you can tell the order in which things were changed from their revision numbers. It doesn't effect your ability to view histories or roll back files.

这篇关于SVN和修订号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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