src add ['file'...]
Initialize new project histories for specified files.
-src commit ['revison-spec'] ['file'...]
+src commit [- | -m 'commentstring' | -f 'commentfile'] ['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.
ci is a synonym for commit.
-src checkout [revspec] ['file'...]
+src checkout [revision-spec] ['file'...]
Refresh the working copy of the file(s) from their history files.
co is a synonym for checkout.
-src cat [revspec] ['file'...]
+src cat [revision-spec] ['file'...]
Send the specified revisions of the files to standard output.
-src branch [delete] ['branchname']
+src branch [delete|del|-d] ['branchname']
Create, switch to, or delete a branch. With no arguments, list branches.
-src tag [delete] ['tagname'] ['revspec'] ['file'...]
+src tag [delete|del|-d] ['tagname'] ['revision-spec'] ['file'...]
Create, switch to, or delete a tag. With no arguments, list tags.
src list ['revision-spec'] ['file'...]
Sends summary information about the specified commits to standard output.
- In each file listing, the summary line tagged with '*' matches the
- state of the working copy.
+ In each file listing, the summary line tagged with '*' is the
+ state that checkout would return to.
src log ['revision-spec'] ['file'...]
Sends log information about the specified commits to standard output.
def commit_method(*args):
"Commit changes to files."
+ comment = None
+ if args[0] == '--':
+ args.pop(0)
+ elif args[0] == "-":
+ commentfp = sys.stdin.read()
+ args.pop(0)
+ elif args[0] == "-m":
+ try:
+ comment = args[1]
+ except IndexError:
+ croak("commit -m requires a following string.")
+ elif args[0] == "-f":
+ try:
+ comment = open(args[1]).read()
+ except IndexError:
+ croak("commit -f requires a following filename argument.")
+ except OSError:
+ croak("couldn't open %s." % args[1])
+ args.pop(0)
(revspec, args) = preamble("commit", args)
if revspec is not None:
croak("commit doesn't take a revision spec")
elif not os.path.exists(".src/%s,v" % arg):
complain("%s is not registered." % arg)
else:
- editor = os.getenv("EDITOR") or "emacsclient"
- scratchfile = "/tmp/src%dtmp" % os.getpid()
- do_or_die(editor + " " + scratchfile, loud=True)
- logcomment = open(scratchfile).read()
- logcomment = "." + logcomment.replace("\n", "\n.")[:-1]
+ if not comment:
+ editor = os.getenv("EDITOR") or "emacsclient"
+ commentfile = "/tmp/src%dtmp" % os.getpid()
+ do_or_die(editor + " " + commentfile, loud=True)
+ comment = open(commentfile).read()
+ comment = "." + comment.replace("\n", "\n.")[:-1]
+ comment = comment.replace("'", r"\'")
with lifted(arg):
- do_or_die("ci -l -m'{1}' {0}".format(arg, logcomment))
+ do_or_die("ci -l -m'{1}' {0}".format(arg, comment))
announce("%s -> %d" % (arg, len(RCSLog(arg))))
def list_method(*args):
src add ['file'...]
Initialize new project histories for specified files.
-src commit ['file'...]
+src commit [- | -m commentstring | -f commentfile] ['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.
+ ci is a synonym for commit.
-src checkout [revspec] ['file'...]
+src checkout [revision-spec] ['file'...]
Refresh the working copy of the file(s) from their history files.
+ co is a synonym for checkout.
-src cat [revspec] ['file'...]
+src cat [revision-spec] ['file'...]
Send the specified revisions of the files to standard output.
-src branch [delete] ['branchname']
+src branch [delete|del|-d] ['branchname']
Create, switch to, or delete a branch. With no arguments, list branches.
-src tag [delete] ['tagname'] ['revspec'] ['file'...]
+src tag [delete|del|-d] ['tagname'] ['revision-spec'] ['file'...]
Create, switch to, or delete a tag. With no arguments, list tags.
src list ['revision-spec'] ['file'...]
Sends summary information about the specified commits to standard output.
+ In each file listing, the summary line tagged with '*' is the
+ state that checkout would return to.
src log ['revision-spec'] ['file'...]
Sends log information about the specified commits to standard output.
src diff ['revision-spec'] ['file'...]
- Sends a diff listing to standard output
+ Sends a diff listing to standard output. With no revision spec, diffs
+ the working copy against the last version checked in. With one revno,
+ diffs the working copy against that stored revision; with a range,
src fast-export ['file'...]
Export one or more projects as a git fast-import stream.
+ The committer identification is copied from your Git configuration.
If no files are specified, all eligible files are operated on in sequence.