Initialize new project histories for specified files. Creates
the repository directory if required.
-src commit [- | -m 'commentstring' | -f 'commentfile' | -e] ['file'...]
+src commit [- | -m 'string' | -f 'file' | -e] ['file'...]
Enters a commit for specified files. Separately to each one.
With '-', take comment text from stdin; with '-m' use the
following string as the comment; with '-f' take from a file.
With '-e', edit even after '-f' or '-m'. ci is a synonym for commit.
+src amend [- | -m string | -f file | -e] ['revision'] ['file'...]::
+ Amends the stored comment for a specified revision, defaulting to the
+ latest revision on the current branch. Flags are as for commit.
+
src checkout ['revision'] ['file'...]
Refresh the working copy of the file(s) from their history files.
co is a synonym for checkout.
"add": add_method,
"commit": commit_method,
"ci": commit_method,
+ "amend": amend_method,
"list": list_method,
"log": log_method,
"checkout": checkout_method,
def checkout(self, arg, revision):
"Check out a revision. Leaves it writeable."
do_or_die("rm -f {0} && rcs -q -u {0},v && co -q -l{1} {0}".format(arg, revision))
+ def amend(self, arg, rev, comment):
+ "Amend a commit comment."
+ # Relies on caller to escape comment string
+ do_or_die("rcs -m{0}:{1} {2}".format(rev, comment, arg))
def cat(self, arg, revision, fn=""):
"Ship the contents of a revision to stdout or a named file."
if fn:
print "\tsymbols:", metadata.symbols
-if __name__ == "__main__":
- command = list(sys.argv[1:])
- explicit = False
- while command and command[0].startswith("-"):
- if command[0] == '-d':
- debug += 1
- elif command[0] == '-q':
- quiet = True
- elif command[0] == '-T':
- pseudotime = True
- elif command[0] == '-S':
- repodir = command[1]
- explicit = True
+if __name__ == "__main__":
+ try:
+ command = list(sys.argv[1:])
+ explicit = False
+ while command and command[0].startswith("-"):
+ if command[0] == '-d':
+ debug += 1
+ elif command[0] == '-q':
+ quiet = True
+ elif command[0] == '-T':
+ pseudotime = True
+ elif command[0] == '-S':
+ repodir = command[1]
+ explicit = True
+ command.pop(0)
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"
+ # RCS backwards-compatibility hack
+ if not explicit and not os.path.exists(repodir) and os.path.exists("RCS"):
+ repodir = "RCS"
- # Presently there is only one backend
- backend = RCS()
+ # Presently there is only one backend
+ backend = RCS()
- if not command:
- help_method()
- else:
- try:
- apply(dispatch[command[0]], command[1:])
- except KeyError:
- sys.stderr.write("src: no such command as '%s'. Try 'src help'\n" \
- % command[0])
+ if not command:
+ help_method()
+ else:
+ try:
+ apply(dispatch[command[0]], command[1:])
+ except KeyError:
+ sys.stderr.write("src: no such command as '%s'. Try 'src help'\n" \
+ % command[0])
+ except KeyboardInterrupt:
+ pass
# The following sets edit modes for GNU EMACS
# Local Variables:
Initialize new project histories for specified files. Creates
the repository directory if required.
-src commit [- | -m commentstring | -f commentfile | -e] ['file'...]::
+src commit [- | -m string | -f file | -e] ['file'...]::
Enters a commit for specified files. Separately to each one.
With '-', take comment text from stdin; with '-m' use the
following string as the comment; with '-f' take from a file.
With '-e', edit even after '-f' or '-m'. ci is a synonym for commit.
+src amend [- | -m string | -f file | -e] ['revision'] ['file'...]::
+ Amends the stored comment for a specified revision, defaulting to the
+ latest revision on the current branch. Flags are as for commit.
+
src checkout [revision] ['file'...]::
Refresh the working copy of the file(s) from their history files.
co is a synonym for checkout.