From: Eric S. Raymond Date: Sat, 8 Nov 2014 16:18:10 +0000 (-0500) Subject: Backward compatibility with RCS. X-Git-Tag: 0.2~18 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=76c632cb33ae3cdcc17749857fc10d467a266d85;p=src.git Backward compatibility with RCS. --- diff --git a/src b/src index c56df66..6f26d19 100755 --- a/src +++ b/src @@ -439,7 +439,6 @@ def commit_method(*args): croak("%s is not registered." % arg) else: metadata = RCSLog(arg) - sys.stderr.write("Foo! %s\n" % arg) if not comment: editor = os.getenv("EDITOR") or "emacsclient" commentfile = "/tmp/src%dtmp" % os.getpid() @@ -742,9 +741,9 @@ dispatch = { "copyto": copyto_method, } -if __name__ == "__main__": - +if __name__ == "__main__": command = list(sys.argv[1:]) + explicit = False while command and command[0].startswith("-"): if command[0] == '-d': debug += 1 @@ -753,9 +752,15 @@ if __name__ == "__main__": elif command[0] == '-T': pseudotime = True elif command[0] == '-S': - repodir = command[1] + repodir = command[1] + explicit = True command.pop(0) command.pop(0) + + # RCS backwards-compatibility hack + if not explicit and not os.path.exists(repodir) and os.path.exists("RCS"): + repodir = "RCS" + if not command: help_method() else: diff --git a/src.asc b/src.asc index 539fed3..969be72 100644 --- a/src.asc +++ b/src.asc @@ -8,6 +8,7 @@ src - simple revision control *src* [command] == DESCRIPTION == + SRC (or src) is simple revision control, a version-control system for single-file projects by solo developers and authors. It modernizes the venerable RCS, hence the anagrammatic acronym. The desigh is @@ -102,14 +103,27 @@ fast-export, the listing modes of tag and branch) you will see a reply only if the operation failed. Other commands (add, commit, checkout, tag creation and deletion, -moveto) give you a success message per file when operating on multiple -files, so you will not be in doubt about which operation succeeded. -This behavior can be suppressed with the -q option, placed 'before' -the subcommand word. +moveto, copyto) give you a success message per file when operating on +multiple files, so you will not be in doubt about which operation +succeeded. This behavior can be suppressed with the -q option, placed +'before' the subcommand word. + +== BACKWARD COMPATIBILITY == + +SRC history files are RCS master files. There is no hidden state. + +In order to maintain complete backwards compatibility, one compromise +was made: any commit comment containing a string exactly matching an +RCS log delimiter (a long string of "-" characters) will be rejected +as malformed. + +By default, history files are kept in a hidden subdirectory named +".src". But if you have an RCS subdirectory and no .src, SRC +will quietly operate on the files in the RCS directory. == DEBUGGING OPTIONS == -These will be of interet mainly to developers" +These will be of interet mainly to developers. A '-d' option before the main command word turns on debugging messages; it can be repeated for higher debugging levels. @@ -126,9 +140,6 @@ constant screen witch of 79. It's for regression testing. This is a proof-of-concept alpha release. The 'branch' command is not yet implemented; it is described here to document the design. -== IMPLEMENTATION NOTE == -SRC presently uses RCS for back-end storage. This may change in the future. - == REPORTING BUGS == Report bugs to Eric S. Raymond . The project page is at http://catb.org/~esr/src