| |
How do I convert from SCCS or RCS to CVS Christopher Brooks, 30 Apr 2001
Resources:
Converting from SCCS to CVS is not that difficult, there
are scripts in the contrib directory that
is shipped with the cvs source code. The basic idea
is that one backs up the SCCS tree, converts to RCS and then
converts to CVS.
The notes below discuss the conversion of the Ptolemy II SCCS tree
to CVS.
Converting from RCS to CVS
Once you've converted from SCCS to RCS, you need to convert
from RCS to CVS.
The CVS info documentation says:
From RCS
If you have been using RCS, find the RCS files--usually a file
named `foo.c' will have its RCS file in `RCS/foo.c,v' (but it
could be other places; consult the RCS documentation for details).
Then create the appropriate directories in CVS if they do not
already exist. Then copy the files into the appropriate
directories in the CVS repository (the name in the repository must
be the name of the source file with `,v' added; the files go
directly in the appopriate directory of the repository, not in an
`RCS' subdirectory). This is one of the few times when it is a
good idea to access the CVS repository directly, rather than using
CVS commands. Then you are ready to check out a new working
directory.
The RCS file should not be locked when you move it into CVS; if it
is, CVS will have trouble letting you operate on it.
A CVS training manual says:
9.1 Moving from RCS to CVS
Migration from RCS to CVS is a relatively painless process. CVS uses RCS for all of its file level version control, and so RCS files can be directly
copied into a CVS repository.
In converting from RCS to CVS, make sure that you follow these steps:
Create a CVS repository. Within this repository you should
create an empty directory structure to hold the RCS files.
Keep a backup copy of your RCS files in their original location
just in case there are any mishaps.
Copy the files into the repository using the standard unix file
copy utilities (cp -rp is useful, as is tar).
Update the modules file in CVSROOT. This can be updated using cvs
co modules or cvs co CVSROOT, editing the modules file, and
checking it back in again. You should make sure that there is an entry in the modules file for every directory (top level and subdirectory) in the repository.
Test the change by attempting to cvs co a few of the new modules
you have created, and running cvs log or cvs status on some of the
files you have checked out.
Steps to convert one directory from SCCS to CVS
-
sccs2rcs
-
co RCS/*
Steps to convert a tree from SCCS to CVS
- Cleanup, removing .class files and codeDoc
make distclean
cd ptolemy
find . -name "*.class" -exec rm {} \;
find . -name "*codeDoc" -exec rmdir {} \;
- Be sure that there are no files checked out
cd ~ptII
make sccsinfo
/users/ptII/adm/cvs/unsccsedit might help for testing
- You may want to remove all the extra sccs files
that are not being used. One way to do this is to
do a
sccs get SCCS in all the directories
and then run make checkjunk and move
the SCCS files to a junk directory.
- The following script located at
/users/ptII/adm/cvs/getallsccs
will get all the SCCS files
#!/bin/sh
homedir=`pwd`
dirs=`find . -name SCCS -print`
for dir in $dirs
do
echo $dir
cd $homedir
cd $dir/..
sccs get SCCS
done
- The run
make checkjunk
- If you place the output of
make checkjunk
into a file, then run the script below to generate
another script that will move the junk files into
a junk directory.
#!/bin/sh
grep 'Extra files' sccsfiles | sed 's@Extra files in /export/carson/carson2/cxh/tmp/ptII/@@' | sed 's/://' |
awk ' { print "mkdir -p /users/cxh/tmp/junk/"$1"/SCCS"
for(i=2;i<=NF;i++) {
print "mv "$1"/SCCS/s."$i" /users/cxh/tmp/junk/"$1"/SCCS"
print "mv "$1"/"$i" /users/cxh/tmp/junk/"$1
}
}
- Repeat running
make checkjunk
the script above and the output script until
make checkjunkfinds no garbage:
make checkjunk >> sccsfiles
moveoldsccs > moveoldsccs.sh
sh moveoldsccs.sh
and repeat
- Convert from SCCS to RCS:
/users/ptII/adm/sccs2cvs/sccs2rcsall -q
sccs2rcsall is a locally modified
version of contrib/sccs2rcs that
is shipped with the cvs sources. The version
that is shipped with cvs has y2k hacks not
present in the local copy, so use the most
current version from the cvs sources.
- Check that there are no SCCS directories:
find . -name SCCS -ls
If there are any, fix the problems and rerun
sccs2rcsall
- Check out all the files from RCS
/users/ptII/adm/sccs/2cvs/coall
coall looks like:
#! /bin/sh
# Check out all the files from RCS in a tree
dirs=`find . -xdev -type d | egrep -v "SCCS|adm|RCS|CVS|codeDoc"`
homedir=`pwd`
for dir in $dirs
do
echo $dir
cd $dir
co RCS/*
cd $homedir
done
- Initialize the repository
setenv CVSROOT ~/tmp/ptII/Repository
cvs init
- Convert from RCS to CVS
cd ptII
/users/ptII/adm/cvs/ptrcs-to-cvs ptII
ptrcs-to-cvs is a version of
cvs-1.11/contrib/rcs-to-cvs with the following changes:
cxh@maury 67% diff -c ~/src/cvs-1.11/contrib/rcs-to-cvs ptrcs-to-cvs
*** /home/eecs/cxh/src/cvs-1.11/contrib/rcs-to-cvs Mon Sep 25 18:59:01 200\
0
--- ptrcs-to-cvs Thu Nov 12 14:01:25 1998
***************
*** 90,96 ****
if [ -d SCCS ]; then
echo SCCS files detected! >&2
! exit 1
fi
if [ -d RCS ]; then
co RCS/*
--- 90,97 ----
if [ -d SCCS ]; then
echo SCCS files detected! >&2
! #exit 1
! exit 0
fi
if [ -d RCS ]; then
co RCS/*
***************
*** 99,105 ****
for name in * .[a-zA-Z0-9]*
do
case "$name" in
! RCS | *~ | \* | .\[a-zA-Z0-9\]\* ) continue ;;
esac
echo $name
if [ $vbose -ne 0 ]; then
--- 100,106 ----
for name in * .[a-zA-Z0-9]*
do
case "$name" in
! Repository | RCS | SCCS | old-SCCS | adm | codeDoc | *~ | \* | .\[a-zA-Z0\
-9\]\* ) continue ;;
esac
echo $name
if [ $vbose -ne 0 ]; then
***************
*** 158,171 ****
echo "MSG: Copying old rcs file."
cp RCS/"${name}",v "$file"
else
! if [ -n "${comment}" ]; then
! rcs -q -i -c"${comment}" -t${message_file} -m'.' "$file\
"
! fi
! ci -q -u1.1 -t${message_file} -m'.' "$file"
! if [ $? -ne 0 ]; then
! echo "ERROR: Initial check-in of $file failed - abortin\
g" >&2
! exit 1
! fi
fi
else
file="${update_dir}/Attic/${name},v"
--- 159,174 ----
echo "MSG: Copying old rcs file."
cp RCS/"${name}",v "$file"
else
! echo "MSG: not checking in $name, since it is not in RCS"
!
! #if [ -n "${comment}" ]; then
! # rcs -q -i -c"${comment}" -t${message_file} -m'.' "$fil\
e"
! #fi
! #ci -q -u1.1 -t${message_file} -m'.' "$file"
! #if [ $? -ne 0 ]; then
! # echo "ERROR: Initial check-in of $file failed - aborti\
ng" >&2
! # exit 1
! #fi
fi
else
file="${update_dir}/Attic/${name},v"
| |