Comment dois-je convertir de SCCS ou RCS vers CVS
Christopher Brooks, 30 Apr 2001 -
Traduit par Alain Adelmar
Resources:
contrib
qui sont
fournis avec le code source cvs. L'idée
de base est que la sauvegarde de l'arbre SCCS, se transforme en
RCS puis
convertit
ensuite en CVS.Les notes ci-dessous parle de la conversion de l'arbre de Ptolémée II SCCS en CVS.
The CVS info documentation says:
From RCSA CVS training manual says:
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.
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.
sccs2rcs
co RCS/*
make distclean
cd ptolemy
find . -name "*.class" -exec rm {} \;
find . -name "*codeDoc" -exec rmdir {} \;
cd ~ptII
make sccsinfo
/users/ptII/adm/cvs/unsccsedit
might help for testing
sccs get SCCS
in all the directories
and then run make checkjunk
and move
the SCCS files to a junk directory.
/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
make checkjunk
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
}
}
make checkjunk
the script above
and the output script until make checkjunk
finds no
garbage:
make checkjunk >> sccsfilesand repeat
moveoldsccs > moveoldsccs.sh
sh moveoldsccs.sh
/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.
find . -name SCCS -lsIf there are any, fix the problems and rerun
sccs2rcsall
/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
setenv CVSROOT ~/tmp/ptII/Repository
cvs init
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"