]> thyrsus.com Git - src.git/commitdiff
Make ".." a synonym for "-".
authorEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 12:11:51 +0000 (07:11 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 12:11:51 +0000 (07:11 -0500)
src
src.asc

diff --git a/src b/src
index 322871a66308ca82f786463e0cb8dd3daebaad81..df15ecb4d50f1ec028dd39da7a1cec5dc7ee2bc5 100755 (executable)
--- a/src
+++ b/src
@@ -204,8 +204,8 @@ class RCSLog:
 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 '-'.
-Revisions can be designated by named tags
+A revision-spec can be a 1-origin revno or a pair of them separated by
+'-' or '..'. Revisions can be designated by named tags.
 
 The token "--" tells the command-line interpreter that revision-specs
 ad subcommands are done - everything after it is a filename, even
@@ -276,8 +276,14 @@ def preamble(cmd, args):
         elif args[0].isdigit():
             revspec = args.pop(0)
             try:
-                if "-" in revspec:
-                    (start, end) = revspec.split("-")
+                if "-" in revspec or ".." in revspec:
+                    try:
+                        (start, end) = revspec.split("-")
+                    except ValueError:
+                        try:
+                            (start, end) = revspec.split("..")
+                        except ValueError:
+                            croak("internal error - argument parser is confused")
                     try:
                         start = int(start)
                     except ValueError:
diff --git a/src.asc b/src.asc
index f105ed491bcb86490a18e7c1e26003b2f70248e7..a60e82ad94f2ed0382e0cc5751a5be01b66f36b5 100644 (file)
--- a/src.asc
+++ b/src.asc
@@ -10,7 +10,9 @@ src - simple revision control
 == 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.
+venerable RCS, hence the anagrammatic acronym. The desigh is
+tuned for use cases like all those little scripts in your ~/bin 
+directory, or a directory full of HOWTOs.
 
 SRC revision histories are single, human-readable files beneath a hidden .src 
 subdirectory in the directory where they live.  There may be multiple
@@ -19,15 +21,17 @@ and history files can be moved elsewhere at any time.
 
 SRC gives you simple, consecutive integer revision numbers. It
 supports tags and branching. It does not show committer information,
-because the committer is always you.
+because the committer is always you.  The command set is intended
+to look familiar if you have ever used Subversion, Mercurial, or Git.
 
 SRC interprets the EDITOR variable in the usual way, using it to spawn
 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
+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 "-".
 
 The token "--" tells the command-line interpreter that revision-specs
 ad subcommands are done - everything after it is a filename, even