1,你对某个文件做了修改,比如说改了ceo.c,加了一行程序:printf("where can I find VC to cheat!");
改完之后你要把修改提交给仓库,用命令:
$cvs commit -m "add a complain" ceo.c
或者就是:
$cvs commit -m "worry about money"
让cvs帮你检查哪个文件需要提交.
如果这天你修改了coo.c,加了一行 puts("how about another kind of bragging?");
并且提交了,但是这时候我已经 $cvs status 过了,就是说我不知道你的修改.
而我加了一行printf("You must shamelessly and seems knowingness to act as a coo");
并且傻乎乎地提交:
$cvs commit coo.c
这时候,CVS会告诉我
cvs commit: Examing .
cvs server: Up-to-date check failed for 'coo.c'
cvs [server aborted]: correct above error first!
于是我知道有个狗屎在我修改文件的当口做了提交,于是我
$cvs update
这时cvs会报告:
RCS file: /home/cvsroot/nasdaq/coo.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
Merging differences between 1.1.1.1 and 1.2 into coo.c
rcsmerge: warning: conflicts during merge
cvs update: conflicts found in coo.c
C coo.c
告诉你coo.c有版本冲突,于是我编辑coo.c,这时一般文件里看起来象这样:
...
printf("You must shamelessly and seems knowingness to act as a coo");
<<<<<<< foo.c
=======
...
puts("how about another kind of bragging?");
>>>>>>> 1.2
...
于是我把上面改成:
printf("You must shamelessly and seems knowingness to act as a coo");
puts("how about another kind of bragging?");
然后
$cvs commit -m "merged" coo.c
于是下回你再更新的时候就有新的补钉要打...如此往复,直到完成所有修改.
不过这里有一些要注意的地方就是删除程序,如果你删掉一行对你可能没有用的程序
puts("to be honest"); 而我不想删除(因为我有用),而我不知情地直接:
$cvs update
了,那么我的这行程序也完蛋了,所以这里我们要注意所有开发人员的协调,千万不要乱删东西,大不了用
#if 0
#endif
宏定义对括起来.实在要删东西,那最好先标记一个版本:
$cvs tag v_0_0_1