lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Handy cvs commands


From: Greg Chicares
Subject: [lmi] Handy cvs commands
Date: Thu, 16 Oct 2008 14:37:56 +0000
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

I'm cleaning up some old notes, and thought I'd share a list of
cvs commands that may help people who haven't used cvs much.

# Set up cvs with Cygwin.

Copy
  'config', 'id_dsa', is_dsa.pub'
from wherever to /cygwin/home/your_name/.ssh

Check permissions:

/usr[0]$stat --format=%a%n ~/.ssh/*
777/home/your_name/.ssh/config
777/home/your_name/.ssh/id_dsa
777/home/your_name/.ssh/id_dsa.pub
777/home/your_name/.ssh/known_hosts
/usr[0]$chmod 600 ~/.ssh/id_dsa

If this happens:

cvs update: warning: failed to open /home/your_name/.cvspass for reading:
 No such file or directory

then fix it this way:
 touch ~/.cvspass

# Create a local shadow copy of the online repository.
# Substitute s/[module]/lmi/ e.g.

cd /lmi/checkouts/current/
export CVS_RSH="ssh"
export CVSROOT=":pserver:address@hidden:/sources/lmi"
cvs -z3 checkout [module]

# Check out a branch.

mkdir --parents /c/lmi/checkouts/gnome-xml-branch
cd /c/lmi/checkouts/gnome-xml-branch
cvs -z3 checkout -r gnome-xml-branch lmi

# Check out sources as of a given date.

cvs -z3 checkout -D 20041231 skeleton

# '-D "20051213T0007"' doesn't work, but this does:
cvs -z3 checkout -D "2005-12-13 00:07" lmi

# Check out a current copy to preserve as a local historical snapshot.

cd /lmi/checkouts
z=`date -u +'%Y%m%dT%H%MZ'`
mkdir $z
cd $z
cvs -z3 checkout skeleton

# Set up for read access. I use the last line repeatedly to
# keep my local shadow copy current.

cd /lmi/checkouts/current
export CVS_RSH="ssh"
export CVSROOT=":pserver:address@hidden:/sources/lmi"
cvs -z3 update -l lmi

# '-l lmi' is faster; this is more complete:

cvs -z3 update

# I also keep a local shadow copy of the webpages cvs.

cd /lmi/checkouts/current/web
export CVS_RSH="ssh"
export CVSROOT=":pserver:address@hidden:/web/lmi"
cvs -z3 update -l lmi

# Set up for write access. Use your own name, not mine.

cd /lmi/src/lmi
export CVS_RSH="ssh"
export CVSROOT="address@hidden:/sources/lmi"
eval `ssh-agent`
ssh-agent $SHELL
ssh-add ~/.ssh/id_dsa
  [passphrase]

# Same for 'skeleton', except:

cd /c/lmi/src/skeleton/

# Same, for webpages.

cd /lmi/web/lmi
export CVS_RSH="ssh"
export CVSROOT="address@hidden:/web/lmi"
eval `ssh-agent`
ssh-agent $SHELL
ssh-add ~/.ssh/id_dsa

# Terminate the ssh connection, e.g. when logging off.

ssh-add -D
ssh-agent -k > /dev/null 2>&1

# Update the local source tree (where I make my own changes)
# when someone else has committed a change.

pushd ..; cvs update -l lmi; popd

# Add a new file (if it's not binary).

cvs add foo.cpp
cvs commit -m "Add a foo facility" foo.cpp

# Add a new binary file.

cvs add -kb help.png
cvs commit -m "Add a 'help' bitmap" help.png

# Remove a file.

cvs remove -f foo.cpp
cvs commit -m "Expunge a foo facility" foo.cpp

# Make a patch against cvs from local tree

cvs diff -U3 file0.cpp file1.cpp >/dev/clipboard

# Instead of writing an 'rtag' command....
# cvs rtag -do_not_do_this lmi-20051115T1419Z-rc0 lmi

make release_candidate

# Make a list of files modified in local tree,
# suitable for pasting into 'ChangeLog':

for z in *; do [ ! -d $z ] && [ $z -nt ../../checkouts/current/lmi/$z ] && echo 
"  $z"; done >> /dev/clipboard

# Set local datestamps to match repository.
#
# This is slow, so consider spelling out the names of
# changed files instead of using '*'.

for z in * ; do grep --quiet --files-with-matches '$Id:' $z && touch 
"--date=$(<$z sed -e'/$Id:/!d' |sed -e's/^.*\([0-9]\{4\}[0-9\/: ]*\) .*$/\1/')" 
$z && date -u +'%Y%m%dT%H%MZ' -r $z; done;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]