Tricks and tips Using CVS

How to list all files which are not the same in the leading edge as in a specific branch

Assumed that you are in the main directory of the leading edge, and you want to see all files which are not the same as in branch V11_6_PROD-BRANCH:

cvs -q diff -kk --brief -rV11_6_PROD-BRANCH app lib

How to merge files from a branch into the leading edge to avoid the conflict in "$Id: $" line

Assumed you want to merge changes between 1.2.1.1 and 1.2.1.2 into the leading edge (CAUTION: this does not function in branches and with binary files, because all sticky flags are deleted):

cvs up -kk -j 1.2.1.1 -j 1.2.1.2 file
cvs up -A file

How to see all the files which are not the same as in the repository

Assumed that you are in the main directory of the project, and you want to see all files which are locally modified or needs update:

cvs st app lib 2>/dev/null | app/etc/filterCVS.sh

How to checkout a file created newly in the leading edge into a branch

Assumed that the file 'filterCVS.sh' was added in the leading edge, and you want to use it also in branch V11_3_PROD-BRANCH:

cd ... # be in branch V11_3_PROD-BRANCH
cvs tag -b -r 1.1 V11_3_PROD-BRANCH filterCVS.sh
cvs up filterCVS.sh

How to checkout a file created newly in a branch into the leading edge

Assumed that the file 'DashBoardBT.php' was added in the branch V11_3_PROD-BRANCH, and you want to use it also in the leading edge:

cd ... # be in leading edge
cvs up -jV11_3_PROD-BRANCH DashBoardBT.php
cvs ci -m'.....' DashBoardBT.php

How to make cvs merge between branches of different character sets

Assume that we have the file Message.txt already in character set UTF-8 and we want to merge changes from another branch between versions 1.84 and 1.84.2.36 but the Messages.txt is still in character set ISO8859-1 on that branch. The key issue is that the file should be converted first to the character set of the version to be merged from.

iconv -f UTF-8 -t ISO8859-1 Messages.txt > Messages.txt.iso8859-1   # convert from UTF-8 to ISO8859-1
mv Messages.txt.iso8859-1 Messages.txt
cvs up -j1.84 -j1.84.2.36 Messages.txt                              # cvs merge
iconv -t UTF-8 -f ISO8859-1 Messages.txt > Messages.txt.utf-8       # convert from ISO8859-1 to UTF-8
mv Messages.txt.utf-8 Messages.txt
vi Messages.txt                                                     # resolve conflicts
cvs ci -m'Merged from 1.84-1.84.2.36' Messages.txt                  # commit changes into CVS

CvsTips (last edited 2012-03-09 18:52:14 by 195)

Copyright 2008-2014, SoftXS GmbH, Switzerland