From: Eric S. Raymond Date: Thu, 6 Nov 2014 13:10:32 +0000 (-0500) Subject: Implement and document -l. X-Git-Tag: 1.9~6 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=1cad0fbaf1b6c2fd9636eb31adda421a3e9c5815;p=sccs2rcs.git Implement and document -l. --- diff --git a/sccs2rcs b/sccs2rcs index 89680f7..53bb2d6 100755 --- a/sccs2rcs +++ b/sccs2rcs @@ -177,9 +177,14 @@ Incomplete history in ./RCS -- remove it. Original unchanged history in ./SCCS. """ if logtext: - print "Log follows:" - print logtext - print "Log ends here." + if logfile: + wfp = open(logfile, "w") + wfp.write(logtext) + wfp.close() + else: + print "Log follows:" + print logtext + print "Log ends here." sys.exit(1) def warn(msg): @@ -199,10 +204,13 @@ def do_it_or_die(command): if __name__ == '__main__': comments = None - (options, arguments) = getopt.getopt(sys.argv[1:], "c:") + logfile = None + (options, arguments) = getopt.getopt(sys.argv[1:], "c:l:") for (switch, val) in options: if switch == '-c': comments = val + elif switch == '-l': + logfile = val # User may have supplied a comments file initstrings = {} @@ -377,6 +385,12 @@ if __name__ == '__main__': for filename in os.listdir("SCCS"): if is_sccsmaster(master): do_it("co " + rcsfile(workfile(master))) + + if logfile: + wfp = open(logfile, "w") + wfp.write(logtext) + wfp.close() + progress("done.") # sccs2rcs ends here diff --git a/sccs2rcs.xml b/sccs2rcs.xml index a643fff..3626f57 100644 --- a/sccs2rcs.xml +++ b/sccs2rcs.xml @@ -20,6 +20,7 @@ sccs2rcs -c commentfile + -l logfile @@ -45,9 +46,13 @@ complain about the exceptions so you can see them. If this tool fails it will tell you why. `rm -rf RCS; unget SCCS/s.*' will recover your initial state. -There is one option. With -c you can specify an initial-comments file. +With -c you can specify an initial-comments file. Each line should consist of a filename followed by a colon, followed by the RCS initial coment to set for that file. + +With -l you can make the command log be written to a specified +file, whether the program fails or succeeds. This is mainly useful +for debugging unusual situations. ERROR RETURNS