配置管理小报10916:cvs history的用法介绍

l         作者:赵**(zhaoli@***.cn)

cvs history的用法介绍

1、格式:

cvs history [-report] [-flags] [-options args] [files...]

report

    -c  显示仓库被修改时的提交时间(相当于-xAMR)

    -o  显示检出操作的记录,只显示最近重新检出的模块

    -e  显示每种记录类型,相当于以-x选项指定每种类型

flags

    -a  显示所有用户检出的历史数据,O类型

    -l   显示最后进行修改的模块

options args

    -D <date>                        显示指定日期之后更新的数据

    -n <modulename>         显示指定模块的检出信息

    -p <repos>                       显示指定仓库记录

    -r <rev/tag>                    显示比指定修订版本或标记更新或相同的数据

    -t <tag>                            显示比指定标签更新或相同的数据

    -u <user>                         显示指定用户修改的模块,组合-c可以显示修改的文件

    -x[TOEFWUCGMAR]     显示指定类型的文件,类型用单独的字母表示,你也可以组合起来指定

A    新增文件

C    合并后有冲突发生(需要手动合并)

E    已被导出的文件

F    已被释放的文件

G   合并成功的文件

M   修改的文件

O    检出的文件

R    删除的文件

T    以rtag标记的文件

U    从仓库中复制的文件

W   更新过程中仓库里某个文件被删除

 

2、输出结果格式:

type date timezone user {revision|path|branch} {module|directory|tag|filename}{module|project-root-directory} access_type

 

3、使用方法:

winCVSAdmin菜单->Command Line,输入cvs history [-report] [-flags] [-options args] [files...]

cmdcvs -d  <CVSROOT> history  [-report] [-flags] [-options args] [files...]

sshcvs -d  <CVSROOT> history  [-report] [-flags] [-options args] [files...]

    

4、举例:

cvs history  -a

type date & timezone                        user                    module                                 project-root-directory               access_type

O      2011-04-06 08:23 +0000          chengwei          Develop                               =test4=                                         <remote>/*

O      2011-08-24 06:53 +0000          zhaoli                 AccessControl                    =AC=                                              <remote>/*

O      2011-08-24 06:53 +0000          zhaoli                 Task/03Requirement       =Task/03Requirement=              <remote>/Task/03Requirement

O      2011-08-24 06:53 +0000          zhaoli                                                                =.=                                                  <remote>/*

        

cvs history -c

type date & timezone                        user          revision    filename            module                                          project-root-directory         access_type

M     2011-08-18 06:11 +0000          zhaoli        1.2             test.txt              Task/04ProjectPlan                   ==                                           <remote>

A       2011-08-30 01:58 +0000          zhaoli        1.1             test.txt             AccessControl                             ==                                          <remote>

R       2011-08-18 06:13 +0000          zhaoli        1.3             abcdefg.txt      Task/17ProjectEvaluate           ==                                           <remote>

   

cvs history -D 2011-08-29

type date & timezone                        user                    module                       project-root-directory      access_type

O      2011-08-29 08:59 +0000          zhaoli                 AccessControl          =AC=                                     <remote>/*

O      2011-08-30 02:10 +0000          zhaoli                                                      =.=                                         <remote>/*

O      2011-08-30 02:14 +0000          zhaoli                 office3                         =office3=                             <remote>/*

   

cvs history -e

type date & timezone                         user          revision    filename            module                                          project-root-directory               access_type

O      2011-08-30 02:22 +0000          zhaoli                                                      Task/03Requirement                =Task/03Requirement=           <remote>/Task/03Requirement

U      2011-08-30 02:21 +0000          zhaoli        1.1           temp.txt             Task/03Requirement/1.0         ==                                                   <remote>/Task/03Requirement/1.0

R       2011-08-30 02:16 +0000          zhaoli        1.6           test.xlsx             Task/03Requirement/teisle    ==                                                   <remote>                      

A       2011-08-30 01:58 +0000          zhaoli        1.1           iamtest.txt        AccessControl                             ==                                                   <remote>                      

M     2011-08-18 06:11 +0000          zhaoli        1.2           test.txt               Task/04ProjectPlan                    ==                                                   <remote>                      

     

cvs history -T

type date & timezone                        user                    module              tag  

T       2011-08-30 03:08 +0000          zhaoli                 Develop             [build:A]  

T       2011-08-30 03:24 +0000          test-test           Develop             [build:D]  

   

cvs history -o

type date & timezone                        user          module                                 project-root-directory               access_type

O      2011-05-17 08:24 +0000          zhaoli                                                      =.=                                                  <remote>/*

O      2011-08-18 03:14 +0000          zhaoli        Task/03Requirement       =Task/03Requirement=            <remote>/Task/03Requirement

   

cvs history -l

type date & timezone                        user                    module                       project-root-directory      access_type

O      2011-08-30 03:23 +0000          test-test                                                 =.=                                         <remote>/*

O      2011-08-30 03:48 +0000          test-test           Develop/test-test    =Develop/test-test=        <remote>/Develop/test-test

O      2011-08-30 03:49 +0000          test-test           Develop/test2          =Develop/test2=               <remote>/Develop/test2

O      2011-09-01 02:37 +0000          test-test           office3                         =office3=                             <remote>/*

          

cvs history -u zhaoli.***.cn

type date & timezone                        user          module                                 project-root-directory               access_type

O      2011-08-30 02:10 +0000          zhaoli                                                      =.=                                                  <remote>/*

O      2011-08-29 08:59 +0000          zhaoli        AccessControl                    =AC=                                              <remote>/*

O      2011-08-30 02:24 +0000          zhaoli        Task/03Requirement       =Task/03Requirement=            <remote>/Task/03Requirement

 

cvs history -n office3

type date & timezone                        user                    module     project-root-directory      access_type

O      2011-09-01 02:37 +0000          test-test           office3      =office3=                             <remote>/*

 

cvs history -xM

type date & timezone                        user          revision    filename  module                       project-root-directory      access_type

M     2011-08-30 03:44 +0000          test-test  1.3             1.txt          Develop/test3          ==                                          <remote>

 

5、使用场景:

查看指定时间或指定人员新增或修改的文件

cvs history -u shenxiaowen.***.cn -D 2011-08-30 -xW

W 2011-08-30 15:31 +0000     shenxiaowen.***.cn  asdfasdf.txt  Develop   ==     <remote>

                                                                

查看指定时间或指定人员提交或修改的文件

cvs history -D 2011-08-30 -xAM -a

A 2011-08-30 02:51 +0000       shenxiaowen.***.cn        1.1  ner.cxx                Task/01Creativity    == <remote>            

M 2011-08-30 03:44 +0000     test-test                              1.3  1.txt                    Develop/test3          == <remote>            

A 2011-08-30 03:45 +0000       test-test                              1.1  test-test.txt      Develop/test-test    == <remote>            

M 2011-08-30 03:47 +0000     test-test                              1.2  temp.txt             Develop/                    == <remote>            

A 2011-09-01 02:54 +0000       test-test                              1.1  rf.txt                    Task/Reference        == <remote>            

M 2011-09-01 02:56 +0000     test-test                              1.2  rf.txt                    Task/Reference        == <remote>            

A 2011-08-30 01:57 +0000       zhaoli.***.cn                      1.1  .txt                       AccessControl          == <remote>            

A 2011-08-30 01:58 +0000       zhaoli.***.cn                      1.1  iamtest.txt        AccessControl          == <remote>            

M 2011-08-30 03:02 +0000     zhaoli.***.cn                      1.2  iamtest.txt        AccessControl          == <remote>            

 

按指定文件查看修改记录(但不支持中文文件名)

cvs history -f temp.txt -xM

M 2011-08-30 03:47 +0000     test-test  1.2   temp.txt  Develop/                    ==     <remote>

M 2011-09-14 06:49 +0000     test-test  1.9   temp.txt  AccessControl          ==     <remote>

 

6、说明:

输出结果不支持中文显示

CVSROOT/config文件中设置了history命令输出结果的记录类型,修改后会影响输出结果

参数-T显示结果为rtag标记的文件

参数-t显示“No records selected”是由于history文件的T类型只记录rtag标记的文件,因此参数-t无法显示tag标记的文件

参数-r显示结果如下,预期结果显示1.3版本以上的文件,但输出结果与预期不一致

cvs history -r 1.3

O 2011-09-03 09:00 +0000 wangjian1.***.cn  =.= <remote>/*

你可能感兴趣的:(配置管理小报10916:cvs history的用法介绍)