From: Eric S. Raymond Date: Mon, 10 Nov 2014 15:14:48 +0000 (-0500) Subject: Fix recently introduced bug in cat. Regression test passes. X-Git-Tag: 0.4~21 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=07cb7bafb928f0f6493064bcf4abbcd537beaf4a;p=src.git Fix recently introduced bug in cat. Regression test passes. --- diff --git a/src b/src index 834eb61..1e57c91 100755 --- a/src +++ b/src @@ -332,6 +332,10 @@ class CommandContext: "Set the range to all revisions." self.start = 1 self.end = len(metadata) + def select_tip(self, metadata): + "Set the range to the tip revision." + self.start = len(metadata) + self.end = None def __contains__(self, i): "Does the spec contain the given revno?" return i >= self.start and (self.end is None or i <= self.end) @@ -570,7 +574,7 @@ def cat_method(*args): metadata = History(arg) ctx.resolve(metadata) if ctx.is_empty(): - ctx.select_all(metadata) + ctx.select_tip(metadata) with backend.lifter(arg): for item in metadata: if item.revno in ctx: diff --git a/srctest b/srctest index ba44935..912bf6a 100755 --- a/srctest +++ b/srctest @@ -59,9 +59,8 @@ check "nonempty diff" echo "Second comment" | src $TESTOPTS commit - testfile1 >/dev/null check "commit with -" -# FIXME: test fails for unknown reasons -#src $TESTOPTS cat testfile1 | diff -u testfile1 - -#check "content check after second commit" +src $TESTOPTS cat testfile1 | diff -u testfile1 - +check "content check after second commit" cat >testfile2 <