練習題
[root@dywHome2 ~]# rcsdiff [-kkkkvlr]
-kk 比較版本內容的差異(不包括 IDKeyword)
-kkvl 指定 IDKeyword 的比較方式,預設比較方式。
-r 指定欲比較版本
[dywang@dywOffice testrcs]$ rcsdiff important.c
===================================================================
RCS file: RCS/important.c,v
retrieving revision 1.6
diff -r1.6 important.c
[dywang@dywOffice testrcs]$ rcsdiff -r1.3 important.c
===================================================================
RCS file: RCS/important.c,v
retrieving revision 1.3
diff -r1.3 important.c
1a2
> * $Id: important.c,v 1.6 2008/03/12 01:51:38 dywang Exp dywang $
# 1.3 版的第 1 行後,插入了新的第 2 行。
7a9
> static char const rcsid[] = "$Id: important.c,v 1.6 2008/03/12 01:51:38
dywang Exp dywang $";
# 1.3 版的第 7 行後,插入了新的第 9 行。
13a16,17
> printf("test for comment\n");
> printf("%s\n", rcsid);
# 1.3 版的第 7 行後,插入了新的第 16,17 行。
[dywang@dywOffice testrcs]$ rcsdiff -r1.3 -r1.4 important.c
===================================================================
RCS file: RCS/important.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -r1.3 -r1.4
13a14
> printf("test for comment\n");
# 1.3 版的第 13 行後,插入了新的第 14 行。
[dywang@dywOffice testrcs]$ rcsdiff -r1.5 -r1.6 -kk important.c
===================================================================
RCS file: RCS/important.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -r1.5 -r1.6
8a9
> static char const rcsid[] = "$Id$";
15a17
> printf("%s\n", rcsid);
[dywang@dywOffice testrcs]$ rcsdiff -r1.5 -r1.6 -kkvl important.c
===================================================================
RCS file: RCS/important.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -r1.5 -r1.6
2c2
< * $Id: important.c,v 1.5 2008/03/07 03:30:31 dywang Exp $
---
> * $Id: important.c,v 1.6 2008/03/12 01:51:38 dywang Exp $
8a9
> static char const rcsid[] = "$Id: important.c,v 1.6 2008/03/12 01:51:38
dywang Exp $";
15a17
> printf("%s\n", rcsid);
[root@dywHome2 ~]# rcsmerge [-kkkkvlr]
-kk 整合檔案版本(不包括 IDKeyword)
-kkvl 指定 IDKeyword 的整合方式
-r 整合檔案版本(包括 IDKeyword)
[dywang@dywOffice testrcs]$ co -l -r1.6 important.c
RCS/important.c,v --> important.c
revision 1.6 (locked)
done
[dywang@dywOffice testrcs]$ rcsmerge -r1.2 -r1.2.1.1 important.c
RCS file: RCS/important.c,v
retrieving revision 1.2
retrieving revision 1.2.1.1
Merging differences between 1.2 and 1.2.1.1 into important.c
rcsmerge: warning: conflicts during merge
[dywang@dywOffice testrcs]$ co -l -r1.6 -j1.2:1.2.1.1 important.c
RCS/important.c,v --> important.c
revision 1.6 (locked)
revision 1.2
revision 1.2.1.1
merging...
merge: warning: conflicts during merge
done
[dywang@dywOffice testrcs]$ co -l -r1.6 -j1.2:1.2.1.1,1.3:1.4 important.c
RCS/important.c,v --> important.c
revision 1.6 (locked)
revision 1.2
revision 1.2.1.1
merging...
merge: warning: conflicts during merge
revision 1.3
revision 1.4
merging...
merge: warning: conflicts during merge
done
Sol.
1.若在版本 1.3 發現 bug;2.發現錯誤來自版本 1.2;3.除錯完成產生校正版本 1.2.1.1。4.比較版本 1.2.1.1 和版本 1.2 的不同,並與版本 1.3 整合。
Sol.
rcsdiff important.c 或 rcsdiff -kkvl important.c
Sol.
rcsdiff -kk important.c
Sol.
rcsdiff -r1.3 important.c
Sol.
rcsdiff -r1.3 -kk important.c
Sol.
兩版本比較差異為:第 1 行後,插入了新的第 2 行。
Sol.
兩版本比較差異為:第 13 行後,插入了新的第 16 及 17 行。
Sol.
rcsdiff -r1.3 -r1.4 important.c
Sol.
rcsmerge -r1.2 -r1.2.1.1 important.c
Sol.
rcsmerge -r1.2 -r1.2.1.1 -kk important.c
Sol.
co -l -j1.2:1.2.1.1 important.c
Sol.
co -l -j1.2:1.2.1.1,1.3:1.4 important.c
Next: 存取名單
Up: *RCS 版本控制系統
Previous: 標記符號
Contents
2017-06-14