From d087e75f26a95e03898f1e98aed6fdc3cc3cb3a5 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 13 Jul 2007 12:10:29 +0000 Subject: [PATCH] Another debugging checkpoint. --- sccs2rcs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sccs2rcs b/sccs2rcs index adb60a0..ac7d9f9 100755 --- a/sccs2rcs +++ b/sccs2rcs @@ -109,13 +109,14 @@ def progress(msg): def get_output(command): global logtext - logtext += "$ " + command + logtext += "$ " + command + "\n" (st, out) = commands.getstatusoutput(command) logtext += out + "\n" return out + "\n" def die(msg): print >>sys.stderr, "sccs2rcs: fatal error, ", msg + progress("error recovery begins") for filename in os.listdir("."): if os.path.exists(sccsfile(filename)) and writeable(filename): get_output("unget " + sccsfile(filename)) @@ -135,11 +136,11 @@ def warn(msg): def get_output_or_die(command): global logtext - logtext += "$ " + command + logtext += "$ " + command + "\n" (st, out) = commands.getstatusoutput(command) + logtext += out + "\n" if st != 0: die("'%s' failed" % command) - logtext += out + "\n" return out + "\n" if __name__ == '__main__': @@ -206,10 +207,10 @@ if __name__ == '__main__': revisions.reverse() # Now use prs to run through the revision list extracting data - progress("%s revisions: %s\n" % (file, ", ".join(revisions))) + progress("%s revisions: %s" % (file, ", ".join(revisions))) for rev in revisions: cmd = 'prs -d":Dd: :Dm: :Dy: :T: :P:" -r%s SCCS/s.%s' % (rev, file) - date = get_output_or_die(cmd) + date = get_output_or_die(cmd).strip() try: (day, month, year, tod, author) = date.split() except ValueError: @@ -247,14 +248,15 @@ if __name__ == '__main__': firsttime = False if file in initstrings: cmd = 'ci -f -r%s -d"%s" -w%s -t-%s %s' \ - % (rev, date, author, initstrings[file], file) + % (rev, rcsdate, author, initstrings[file], file) else: if initstrings: warn("no description for %s in comments file" % file) cmd = 'ci -f -r%s -d"%s" -w%s -t/dev/null %s' \ - % (rev, date, author, file) + % (rev, rcsdate, author, file) cmd = "echo 'Initial revision.' | " + cmd get_output_or_die(cmd) + progress("initial checkin successful") else: # get RCS lock revparts = rev.split(".") @@ -290,7 +292,7 @@ if __name__ == '__main__': # Replace all files for which there exist SCCS masters, progress("replacing workfiles") for filename in os.listdir("."): - if os.exists(sccsfile(filename)): + if os.path.exists(sccsfile(filename)): os.remove(filename) os.system("co " + file) print progress("done.") -- 2.43.0