[net.bugs.4bsd] Bug in sccstorcs

johanw@ttds.UUCP (Johan Wide'n) (01/29/85)

I have recently converted a large number of SCCS files to RCS.
This turned out to be not so easy. Here is one bugfix to sccstorcs.

Unfortunately this fix was not enough. Thre were two more problems:
It is possible to enter the same revision several times into an SCCS-file.
This is used to change the logmessage for a revision. Sccstorcs does not
understand this. It tries to 'ci' the same file several times, with
the result that 'ci' complains: revision number to low.

I solved this with a set of shell and awk procedures. I will not post
these procedures until I'm assured that no one has fixed this problem
with sccstorcs. A fixed sccstorcs is more desirable than my procedures.

There was an additional problem: The SCCS program 'get' bombed on several
of the SCCS files. It turned out that someone had tried to enter
the same file two times, but with different revision numbers.
That 'get' crashed may just be a problem with my porting it to 4.2BSD.
I solved this problem too with the help of some not so beatiful shell
procedures.

Anyway here is a fix to the first problem.

Index: src/new/sccstorcs/src/sccstorcs.c

Bug: When converting from SCCS to RCS the first log message gets lost.

Repeat by: run sccstorcs on an SCCS file, say s.foo.c.
	sccstorcs -t s.foo.c > junk.sccs
	sccstorcs s.foo.c
	rlog foo.c > junk.rcs

	Look at junk.sccs and junk.rcs.
	If junk.rcs lacks the first log message, you got the bug.

Fix:
*** ,,sccstorcs.c	Thu Jun 30 20:26:06 1983
--- sccstorcs.c	Fri Jan 25 22:46:52 1985
***************
*** 25,31
  #define TRUE	1
  #define FALSE	0
  #define SOH	001		/* SCCS lines start with SOH (Control-A) */
! #define RCS	"rcs -q"
  #define GET	"get -s"
  #define CI	"ci -q"
  

--- 25,31 -----
  #define TRUE	1
  #define FALSE	0
  #define SOH	001		/* SCCS lines start with SOH (Control-A) */
! #define RCS     "rcs"
  #define GET	"get -s"
  #define CI	"ci -q"
  
***************
*** 330,335
  char *sccsfile;
  {
      char *rcsfile = &(sname (sccsfile))[2];
  
      if (initialize_rcsfile (header -> description, rcsfile))
  	quit ("Error initializing new rcs file %s\n", rcsfile);

--- 330,338 -----
  char *sccsfile;
  {
      char *rcsfile = &(sname (sccsfile))[2];
+ 
+     if (!(header -> description) && (header -> deltas))
+ 	header -> description = header -> deltas -> commentary;
  
      if (initialize_rcsfile (header -> description, rcsfile))
  	quit ("Error initializing new rcs file %s\n", rcsfile);
----End-of-fix-----------------
	johanw@ttds             Johan Widen
	mcvax!enea!ttds!johanw  TTDS
				KTH
				S-100 44 Stockholm