# history into an RCS history without losing any of
# the information contained therein.
# It has been tested under the following OS's:
-# SunOS 3.5, 4.0.3, 4.1
-# Ultrix-32 2.0, 3.1
+# Dell UUNIX 2.2 (System V Release 4)
#
# Things to note:
+# + The -b (batch) option can be used to tell this script to run
+# non-interactively. In this mode, it assumes that you do not
+# want to enter descriptions on initial checkins, nor change
+# the default keyword substitution
+#
# + It will NOT delete or alter your ./SCCS history under any circumstances.
#
# + Run in a directory where ./SCCS exists and where you can
# kenstir@viewlogic.com
# ...!harvard!cg-atla!viewlog!kenstir
#
+# Eric S. Raymond
+# esr@snark.thyrsus.com
+#
# $Id$
# /usr/local/bin/sccs should override /usr/ucb/sccs there
set path = (/usr/local/bin $path)
+# Note: newer version of RCS require century digits on the -d option
+# of ci. Losing SCCS doesn't supply them. Kluge around this.
+#
+set century = 19
+
+############################################################
+# Option handling
+#
+while ($#argv)
+
+ if ($argv[1] == "-b") then
+ set nodesc = "0"
+ set nohack = "0"
+ endif
+
+ shift
+end
############################################################
# Error checking
mkdir RCS
endif
+set months = (Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
+
sccs clean
set logfile = /tmp/sccs2rcs_$$_log
rm -f $logfile
set tmpfile = /tmp/sccs2rcs_$$_tmp
rm -f $tmpfile
-set emptyfile = /tmp/sccs2rcs_$$_empty
-echo -n "" > $emptyfile
set initialfile = /tmp/sccs2rcs_$$_init
echo "Initial revision" > $initialfile
set sedfile = /tmp/sccs2rcs_$$_sed
############################################################
# Get some answers from user
#
-echo ""
-echo "Do you want to be prompted for a description of each"
-echo "file as it is checked in to RCS initially?"
-echo -n "(y=prompt for description, n=null description) [y] ?"
-set ans = $<
-if ((_$ans == _) || (_$ans == _y) || (_$ans == _Y)) then
- set nodesc = 0
-else
- set nodesc = 1
+if ((_$nodesc == _)) then
+ echo ""
+ echo "Do you want to be prompted for a description of each"
+ echo "file as it is checked in to RCS initially?"
+ echo -n "(y=prompt for description, n=null description) [y]? "
+ set ans = $<
+ if ((_$ans == _) || (_$ans == _y) || (_$ans == _Y)) then
+ set nodesc = 0
+ else
+ set nodesc = 1
+ endif
endif
-echo ""
-echo "The default keyword substitutions are as follows and are"
-echo "applied in the order specified:"
-set i = 1
-while ($i <= $#sccs_keywords)
-# echo ' '\"$sccs_keywords[$i]\"' ==> '\"$rcs_keywords[$i]\"
- echo " $sccs_keywords[$i] ==> $rcs_keywords[$i]"
- @ i = $i + 1
-end
-echo ""
-echo -n "Do you want to change them [n] ?"
-set ans = $<
-if ((_$ans != _) && (_$ans != _n) && (_$ans != _N)) then
- echo "You can't always get what you want."
- echo "Edit this script file and change the variables:"
- echo ' $sccs_keywords'
- echo ' $rcs_keywords'
-else
- echo "good idea."
+
+if ((_$nohack == _)) then
+ echo ""
+ echo "The default keyword substitutions are as follows and are"
+ echo "applied in the order specified:"
+ set i = 1
+ while ($i <= $#sccs_keywords)
+# echo ' '\"$sccs_keywords[$i]\"' ==> '\"$rcs_keywords[$i]\"
+ echo " $sccs_keywords[$i] ==> $rcs_keywords[$i]"
+ @ i = $i + 1
+ end
+ echo ""
+ echo -n "Do you want to change them [n]? "
+ set ans = $<
+ if ((_$ans != _) && (_$ans != _n) && (_$ans != _N)) then
+ echo "You can't always get what you want."
+ echo "Edit this script file and change the variables:"
+ echo ' $sccs_keywords'
+ echo ' $rcs_keywords'
+ else
+ echo "good idea."
+ endif
endif
# create the sed script
@ i = $i + 1
end
-
############################################################
# Loop over every s-file in SCCS dir
#
if ($status != 0) goto ERROR
# get file into current dir and get stats
- set date = `sccs prs -r$rev $file | grep "^D " | awk '{print $3, $4}'`
- set author = `sccs prs -r$rev $file | grep "^D " | awk '{print $5}'`
+ set date = (`sccs prs -d":Dd: :Dm: :Dy: :T: :P:" -r$rev $file`)
+ set day = $date[1]
+ set month = $date[2]
+ set year = ${century}${date[3]}
+ set time = $date[4]
+ set author = $date[5]
+ set date = "$day $months[$month] $year $time"
+
echo ""
echo "==> file $file, rev=$rev, date=$date, author=$author"
sccs edit -r$rev $file >>& $logfile
# check file into RCS
if ($firsttime) then
set firsttime = 0
- if ($nodesc) then
- ci -f -r$rev -d"$date" -w$author -t$emptyfile $file <$initialfile >>& $logfile
+ if ($nodesc == 0) then
+ ci -f -r$rev -d"$date" -w$author -t/dev/null $file <$initialfile >>& $logfile
if ($status != 0) goto ERROR
echo initial rev checked into RCS without description
else
#
echo cleaning up...
mv SCCS old-SCCS
-rm -f $tmpfile $emptyfile $initialfile $sedfile
+rm -f $tmpfile $initialfile $sedfile
echo ===================================================
echo " Conversion Completed Successfully"
echo ""