Advanced CVS commands used by BaBar

1 Mar 2001

  • How to tag a CVS package at level other than HEAD.
  • How to make extension tag of an existing tag.
  • Restored a removed file back.
  • Remove changes between two versions
  • Using CVS Branch in BaBar

  • How to tag a CVS package at level other than HEAD.

    Tagging a package in CVS can be tricky if the versions to be tagged are not all at HEAD. The following is an example:
          
    
    If you make changes to local checkout folder (edit, add, etc), besure to commit the changes back to CVS before making the tag.

    How to make an extension tag of an existing tag

    If you need to make an extension to an old tag, do not jump to the CVS branch. Most of the situation can be solved by simply adjusting the version level. The easiest case is when the patch is based on HEAD, see the previous section "How to tag a CVS package at level other than HEAD" for this. If you need to make change to an older version and make a tag that includes this version, but do not want to leave this patch at the HEAD, it is a bit trickier:

    cvs co -r <tag> <pkg> [get a specific tag level]
    cd <pkg> [go to folder]
    cvs update -A <file> [bring file to the HEAD level]
    cvs update -jHEAD -j<tag> <file> [put old <tag> back temporarily]
    edit <file> [edit this old version]
    cvs commit <file> [commit this extension to HEAD]
    keep the version number from the "previous revision: <ver>" in the commit message somewhere.
    cvs tag <tag>-NN [tag with extension. e.g. V11-22-33-01]
    cvs update -jHEAD -j<ver> <file> [put previous HEAD <ver> back]
    cvs commit <file> [and commit it to HEAD]

    Restored a removed file back

    If a file has been removed with 'cvs rm' command and thus was moved to Attic, the best way to get it back is using the 'add' command:

    more $CVSROOT/pkg/<file>,v [find latest numeric version <ver>]
    cvs co -d /tmp/<pkg> -r <ver> <pkg>/<file> [get latest version of removed file from Attic]
    cvs co <pkg> [check out package]
    cd <pkg> [cd to the check-out folder]
    ls <file> [make sure it does not exist]
    cp /tmp/<pkg>/<file> . [copy the latest copy from /tmp]
    cvs add <file> [add file back to HEAD]
    cvs ci [commit this request]

    Remove changes between two versions

    This will remove changes between version V1 and version V2. Note that version V1 is a earlier version while version V2 is a later version. This command can revert a file back to earlier version.

    Maintained by Terry Hung. Send suggestions and additions to
    terryh@slac.stanford.edu, 650-926-3618