From: Eric S. Raymond Date: Wed, 19 Nov 2014 23:14:19 +0000 (-0500) Subject: Suppoprt bare @ as a revision spec. X-Git-Tag: 0.11~7 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=770e7d152eb165bd01ca6d69f9a60482a4813b96;p=src.git Suppoprt bare @ as a revision spec. --- diff --git a/src b/src index b67ac64..c67f345 100755 --- 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 e6d7cd4..1fc57c8 100644 --- 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