From: Eric S. Raymond Date: Fri, 7 Nov 2014 17:28:29 +0000 (-0500) Subject: The regression test passes. Of course it isn't very good yet... X-Git-Tag: 0.2~49 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=bafbda8661d58f45b7e081a9e28831ace42e82de;p=src.git The regression test passes. Of course it isn't very good yet... --- diff --git a/README b/README index 2ad3257..2cbdc13 100644 --- a/README +++ b/README @@ -13,5 +13,7 @@ revision numbers, lockless operation, embedded command help, and a command set that will seem familiar to users of Subversion, Mercurial, and Git. +Run 'make check' for the regression test. + Eric S. Raymond November 2014 diff --git a/src b/src index 204b861..fc2208a 100755 --- a/src +++ b/src @@ -228,10 +228,12 @@ def help_method(*args): "Summarize src commands, or (with argument) show help for a single command." print""" A revision-spec can be a 1-origin revno or a pair of them separated by -'-' or '..'. Revisions can be designated by named tags. +'-' or '..'. Revisions can be designated by named tags. Unless otherwise +noted under individual commands, if no revision-spec is included in a +command that wants one, the tip revision on the current branch is selected. The token "--" tells the command-line interpreter that revision-specs -ad subcommands are done - everything after it is a filename, even +and subcommands are done - everything after it is a filename, even if it looks like a subcommand or revision number. src help [command] @@ -249,7 +251,7 @@ src commit [- | -m 'commentstring' | -f 'commentfile'] ['file'...] following string as the comment; with '-f' take from a file. ci is a synonym for commit. -src checkout [revision-spec] ['file'...] +src checkout ['revision-spec'] ['file'...] Refresh the working copy of the file(s) from their history files. co is a synonym for checkout. @@ -265,11 +267,13 @@ src tag [delete|del|-d] ['tagname'] ['revision-spec'] ['file'...] 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. + state that checkout would return to. The default revision-spec is + all commits on the current branch. src log ['revision-spec'] ['file'...] Sends log information about the specified commits to standard output. - + The default revision-spec is all commits on the current branch. + src diff ['revision-spec'] ['file'...] Sends a diff listing to standard output. With no revision spec, diffs the working copy against the last version checked in. With one revno, @@ -368,7 +372,7 @@ def commit_method(*args): if args[0] == '--': args.pop(0) elif args[0] == "-": - commentfp = sys.stdin.read() + comment = sys.stdin.read() args.pop(0) elif args[0] == "-m": args.pop(0) @@ -468,7 +472,7 @@ def cat_method(*args): master = RCSLog(arg) revspec = master.resolve(revspec) if revspec is None: - revspec = range(1, len(master)+1) + revspec = [master.tip().revno] with lifted(arg): for item in master: if item.revno in revspec: diff --git a/src.asc b/src.asc index 73afc86..efb008c 100644 --- a/src.asc +++ b/src.asc @@ -30,11 +30,13 @@ an editor instance when you perform a commit. == COMMAND SUMMARY == A revision spec is a 1-origin integer N, or a range literal M-N. -Revisions can be designated by named tags. ".." is treated as -a synonym for "-". +Revisions can be designated by named tags. ".." is treated as a +synonym for "-". Unless otherwise noted under individual commands, if +no revision-spec is included in a command that wants one, the tip +revision on the current branch is selected. The token "--" tells the command-line interpreter that revision-specs -ad subcommands are done - everything after it is a filename, even +and subcommands are done - everything after it is a filename, even if it looks like a subcommand or revision number. src help [command]:: @@ -68,10 +70,12 @@ src tag [delete|del|-d] ['tagname'] ['revision-spec'] ['file'...] 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. + state that checkout would return to. The default revision-spec is + all commits on the current branch. src log ['revision-spec'] ['file'...] Sends log information about the specified commits to standard output. + The default revision-spec is all commits on the current branch. src diff ['revision-spec'] ['file'...] Sends a diff listing to standard output. With no revision spec, diffs diff --git a/srctest b/srctest index c763edf..d522bb1 100755 --- a/srctest +++ b/srctest @@ -23,17 +23,20 @@ src add testfile$$ >/dev/null check "add" src commit -m "First comment" testfile$$ >/dev/null -check "commit" +check "commit with -m option" src cat testfile$$ | diff testfile$$ - >/dev/null -check "diff" +check "content check after first commit" cat >testfile$$ </dev/null -check "commit" +echo "Second comment" | src commit - testfile$$ >/dev/null +check "commit with -" + +src cat testfile$$ | diff testfile$$ - +check "content check after second commit" # end