From: Eric S. Raymond Date: Fri, 7 Nov 2014 12:11:51 +0000 (-0500) Subject: Make ".." a synonym for "-". X-Git-Tag: 0.2~60 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=773537d2256904e07cfeab65509ba8de1e48a0f2;p=src.git Make ".." a synonym for "-". --- diff --git a/src b/src index 322871a..df15ecb 100755 --- 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 f105ed4..a60e82a 100644 --- 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