CVS实践

来源:互联网 发布:excel中怎么筛选数据 编辑:程序博客网 时间:2024/06/11 09:39

module name:ln/fs

checkout 分支:

cvs co -r tag1 ln/fs   

update 一个文件从主干到分支:

cvs update -r tag1 ***.py      然后使用cvs status ***.py就看到已经更新到分支

导入一个工程源码:

cvs import -m "add project fs" ln/fs3/test/foxyauto foxyauto test

说明:ln/fs/test/foxyauto:cvs上的仓库目录($CVSROOT下),foxyauto’ 字符串是销售商标签(vendor tag),而 `test' 是发行标签(release tag)


合并不同版本代码(注意冲突的处理)

cvs diff -r tag1 makefile 

cvs update -j tag1 makefile


回滚代码到某天

cvs update -D 20130227 

如果经过上面update -r或者update -D后代码想回到主干上,可以使用cvs update -A进行回滚版本到主干上。


版本相关,打tag:

针对目录打tag

cvs tag tagName1

如果你发现patch打错了,比如是在patch1上打的patch,你不小心打到主干上了,这个时候需要重新回到patch1上面执行

cvs tag -F tagName1

来强制移动该标签。

版本:

以紧急patch patch5-1为例

为了以后能完整chechout使用当前patch的代码,在目录都必须执行

cvs tag patch5-1

如果你发现patch打错了,比如是在patch5-rc7上打的patch,你不小心打到主干上了,这个时候需要重新回到patch5-rc7上面执行

cvs tag -F patch5-1 

来强制移动该标签。


下面是对cvs log命令的总结:

Usage: cvs tag [-lRF] [-b] [-d] [-c] [-r rev|-D date] tag [files...]-l Local directory only, not recursive.-R Process directories recursively.-dDeletethe given tag.-r rev Existing revision/tag.-D Existing date.-f Force a head revision if specified tag not found.-b Make the tag a "branch" tag, allowing concurrent development.-F Move tag if it already exists.-c Check that working files are unmodified.


vcscommand.vim:

" Command documentation {{{2"" VCSAdd           Adds the current file to source control."" VCSAnnotate[!]   Displays the current file with each line annotated with the"                  version in which it was most recently changed.  If an"                  argument is given, the argument is used as a revision"                  number to display.  If not given an argument, it uses the"                  most recent version of the file on the current branch."                  Additionally, if the current buffer is a VCSAnnotate buffer"                  already, the version number on the current line is used.""                  If '!' is used, the view of the annotated buffer is split"                  so that the annotation is in a separate window from the"                  content, and each is highlighted separately."" VCSBlame         Alias for 'VCSAnnotate'."" VCSCommit[!]     Commits changes to the current file to source control.""                  If called with arguments, the arguments are the log message.""                  If '!' is used, an empty log message is committed.""                  If called with no arguments, this is a two-step command."                  The first step opens a buffer to accept a log message."                  When that buffer is written, it is automatically closed and"                  the file is committed using the information from that log"                  message.  The commit can be abandoned if the log message"                  buffer is deleted or wiped before being written."" VCSDelete        Deletes the current file and removes it from source control."" VCSDiff          With no arguments, this displays the differences between"                  the current file and its parent version under source"                  control in a new scratch buffer.""                  With one argument, the diff is performed on the"                  current file against the specified revision.""                  With two arguments, the diff is performed between the"                  specified revisions of the current file.""                  This command uses the 'VCSCommand{VCSType}DiffOpt' variable"                  to specify diff options.  If that variable does not exist,"                  a plugin-specific default is used.  If you wish to have no"                  options, then set it to the empty string."" VCSGotoOriginal  Jumps to the source buffer if the current buffer is a VCS"                  scratch buffer.  If VCSGotoOriginal[!] is used, remove all"                  VCS scratch buffers associated with the original file."" VCSInfo          Displays extended information about the current file in a"                  new scratch buffer."" VCSLock          Locks the current file in order to prevent other users from"                  concurrently modifying it.  The exact semantics of this"                  command depend on the underlying VCS."" VCSLog           Displays the version history of the current file in a new"                  scratch buffer."" VCSRemove        Alias for 'VCSDelete'."" VCSRevert        Replaces the modified version of the current file with the"                  most recent version from the repository."" VCSReview        Displays a particular version of the current file in a new"                  scratch buffer.  If no argument is given, the most recent"                  version of the file on the current branch is retrieved."" VCSStatus        Displays versioning information about the current file in a"                  new scratch buffer."" VCSUnlock        Unlocks the current file in order to allow other users from"                  concurrently modifying it.  The exact semantics of this"                  command depend on the underlying VCS."" VCSUpdate        Updates the current file with any relevant changes from the"                  repository."" VCSVimDiff       Uses vimdiff to display differences between versions of the"                  current file.""                  If no revision is specified, the most recent version of the"                  file on the current branch is used.  With one argument,"                  that argument is used as the revision as above.  With two"                  arguments, the differences between the two revisions is"                  displayed using vimdiff.""                  With either zero or one argument, the original buffer is
"                  used to perform the vimdiff.  When the scratch buffer is"                  closed, the original buffer will be returned to normal"                  mode.""                  Once vimdiff mode is started using the above methods,"                  additional vimdiff buffers may be added by passing a single"                  version argument to the command.  There may be up to 4"                  vimdiff buffers total.""                  Using the 2-argument form of the command resets the vimdiff"                  to only those 2 versions.  Additionally, invoking the"                  command on a different file will close the previous vimdiff"                  buffers.