]> thyrsus.com Git - src.git/commitdiff
The regression test passes. Of course it isn't very good yet...
authorEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 17:28:29 +0000 (12:28 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 17:28:29 +0000 (12:28 -0500)
README
src
src.asc
srctest

diff --git a/README b/README
index 2ad32579381fd023789191caa8338e4f65789e83..2cbdc1381c91cce4e1a37d309eecd4873402161c 100644 (file)
--- 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 204b8617d0c999351698ebee4a46cd708f1260a7..fc2208ade71c7f94cd0fb5cd9ed58ac529bb193f 100755 (executable)
--- 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 73afc8667b1ee656e8f8da0bf272ccb95d72c60f..efb008ca2004508af646b147c10253079aefa1e4 100644 (file)
--- 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 c763edf8ff01ad1af197f5ae99ca50eadadc36f5..d522bb112d1b3c27fc76895d096c0ad948237a3f 100755 (executable)
--- 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$$ <<EOF
 Now is the time
 for all good men
 EOF
 
-echo "Second comment" | src commit -m - 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