From: Eric S. Raymond Date: Sat, 20 Dec 2014 12:43:59 +0000 (-0500) Subject: In list and log, explicit ranges are no longer reversed. X-Git-Tag: 0.18~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=f159b9ed68ad244737d49d4237188f86a1a499b3;p=src.git In list and log, explicit ranges are no longer reversed. --- diff --git a/NEWS b/NEWS index c748885..fec1770 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ Repository headL Reversed range expressons are now supported. + In list and log, explicit ranges are no longer reversed. 0.17: 2014-12-19 Undocumented 'add' command abolished; Emacs VC will use 'commit -a' instead. diff --git a/TODO b/TODO index beb615b..a149e72 100644 --- a/TODO +++ b/TODO @@ -6,8 +6,6 @@ * Next step: Run with files always 'unlocked' in RCS terminology, except during commit. This would eliminate the need for the 'release' command. -* Implement reverse ranges and remove automatic reversal in print and log. - * Stop using rcsdiff, it leaks RCS version numbers onto the screen. * Should be possible to range-restrict a tag or branch listing. diff --git a/src b/src index 3028045..af57514 100755 --- a/src +++ b/src @@ -435,8 +435,7 @@ take a singleton revision spec. Some commands (log, list, diff, fast-export) accept a range or a singleton. Unless otherwise noted under individual commands, the default revision -is the tip revision on the current branch and the default range is all -revisions on the current branch. +is the tip revision on the current branch. A good topic to read next would be 'commands'. """, @@ -484,11 +483,13 @@ src list [-l n] [-f fmt] ['revision-range'] ['file'...] The summary line tagged with '*' is the state that the file would return to on checkout without a revision-spec. See 'help list' for information about custom formats. Use -l n to omit the listing length. + Default range is thec current branch, reversed. src log [-l n] ['revision-range'] ['file'...] Sends log information about the specified commits to standard output. - Use -l n to omit the listing length. - + Use -l n to omit the listing length. Default range is the current branch, + reversed. + src diff ['revision-range'] ['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, @@ -927,7 +928,7 @@ class CommandContext: if self.seq is None: croak("revision spec hasn't been resolved") return i in self.seq - def resolve(self, metadata, backwards=True): + def resolve(self, metadata): "Resolve a revision spec that may contain tags into revnos." if debug >= DEBUG_SEQUENCE: sys.stderr.write("Entering resolve with start=%s, end=%s\n" % (self.start, self.end)) @@ -978,11 +979,11 @@ class CommandContext: else: e = e.parent if debug >= DEBUG_SEQUENCE: - sys.stderr.write("selection: %s, branchwise is %s\n" % (self.seq, "on" if self.branchwise else "off")) + sys.stderr.write("selection: %s, branchwise is %s\n" % ([x.revno for x in self.seq], "on" if self.branchwise else "off")) for item in metadata.revlist: sys.stdout.write("%s\t%s\t%s\n" % (item.revno, item.date, item.native)) # Because in the branchwise case the sequence is generated in reverse - if backwards != self.branchwise: + if self.branchwise: self.seq.reverse() # Range might have been reversed if reversed: @@ -1186,7 +1187,7 @@ def list_method(*args): continue if custom is None: sys.stdout.write("= %s %s\n" % (arg, ((WIDTH - len(arg) - 3) * "="))) - for item in ctx.resolve(History(arg), backwards=True): + for item in ctx.resolve(History(arg)): # Must allow enough room for revno and date if item.selected(): mark = "*" @@ -1230,7 +1231,7 @@ def log_method(*args): if ignore(arg) or os.path.isdir(arg) or not registered(arg): continue sys.stdout.write("= %s %s\n" % (arg, ((WIDTH - len(arg) - 3) * "="))) - for item in ctx.resolve(History(arg), backwards=True): + for item in ctx.resolve(History(arg)): sys.stdout.write("%-4d | %s | %s\n%s" \ % (item.revno, item.date, item.branch, item.log)) sys.stdout.write(("-" * WIDTH) + "\n") diff --git a/srctest b/srctest index c88dc0b..fed4bbc 100755 --- a/srctest +++ b/srctest @@ -485,7 +485,7 @@ Second comment. ------------------------------------------------------------------------ EOF -src $TESTOPTS log 2-6 sample >tryit +src $TESTOPTS log 6-2 sample >tryit diff -u tryit sample.seqlog check "traversal by -" @@ -505,7 +505,7 @@ Second comment. ------------------------------------------------------------------------ EOF -src $TESTOPTS log 2..6 sample >tryit +src $TESTOPTS log 6..2 sample >tryit diff -u tryit sample.branchlog check "traversal by .."