]> thyrsus.com Git - src.git/commitdiff
Suppoprt bare @ as a revision spec.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 19 Nov 2014 23:14:19 +0000 (18:14 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 19 Nov 2014 23:14:19 +0000 (18:14 -0500)
src
src.asc

diff --git a/src b/src
index b67ac64ec535cdf52f140d466f33da6fb561821f..c67f345c065984f2eabcac6861720974b957ca40 100755 (executable)
--- a/src
+++ b/src
@@ -40,7 +40,7 @@
 # status.
 #
 #                   git     hg     svn      src
-# Unmodified        ' '     'C'    ' '      '.'
+# Unmodified        ' '     'C'    ' '      '='
 # Renamed           'R'      -      -        -
 # Deleted           'D'     'R'    'D'       -
 # Copied            'C'      -      -        -
@@ -400,7 +400,8 @@ A good help topics to read after this one would be 'revisions'.
     "revisions": """
 A 'revision' is a 1-origin integer, or a tag name designating an
 integer revision, or a branch name designating the tip revision of its
-branch. Revision numbers always increase in commit-date order.
+branch, or '@' meaning the currently fetched revision. Revision
+numbers always increase in commit-date order.
 
 A revision range is a single revision, or a pair of revisions M-N (all
 revisions numerically from M to N) or M..N (all revisions that are
@@ -905,6 +906,8 @@ class CommandContext:
             part = token
             if type(part) == type(0):
                 return part
+            if token == '':    # User specified @
+                return metadata.current().revno
             if part not in metadata.symbols:
                 croak("in {0}, can't resolve symbol {1}".format(metadata.name,token))
             else:
diff --git a/src.asc b/src.asc
index e6d7cd4e5bd5fe4fe32b9932c8c340e21b69e8e1..1fc57c88975a0143079c312092e5bd5cf8a3c06b 100644 (file)
--- a/src.asc
+++ b/src.asc
@@ -39,7 +39,8 @@ revisions numerically from M to N) or M..N (all revisions that are
 branch ancestors of N and branch successors of M).
 
 If src complains that your revision spec looks like a nonexistent
-filename, you can prefix it with @ (this is always allowed).
+filename, you can prefix it with @ (this is always allowed). @ by
+itself means the current (checked-out) revision
 
 Unless otherwise noted under individual commands, the default revision
 is the tip revision on the current branch and the default range is all