From: Eric S. Raymond Date: Wed, 12 Nov 2014 14:51:44 +0000 (-0500) Subject: Branchwise is implemented, but can't be tested until other bugs are fixed. X-Git-Tag: 0.6~25 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=bcef91ac3794f7ee42c2b784c2931411780f38ee;p=src.git Branchwise is implemented, but can't be tested until other bugs are fixed. Regression test passes. --- diff --git a/TODO b/TODO index ca2e4f1..f794c65 100644 --- a/TODO +++ b/TODO @@ -14,3 +14,9 @@ KNOWN BUGS * chungy reports timestamp issues messing up status on ZFS. + +* amend needs to initialize the buffer with the old content value. + +* amending commend 7 returns "src: sample : 8" + +* src list and src log aren't taking revspecs. diff --git a/src b/src index edc0501..61c7f20 100755 --- a/src +++ b/src @@ -348,6 +348,7 @@ class CommandContext: croak("repository subdirectory %s does not exist" % repodir) self.start = self.end = None self.seq = None + self.branchwise = None if type(args) == type(()): args = list(args) self.args = list(args) @@ -359,6 +360,7 @@ class CommandContext: revspec = self.args.pop(0) try: if "-" in revspec or ".." in revspec: + self.branchwise = ".." in revspec try: (self.start, self.end) = revspec.split("-") except ValueError: @@ -434,7 +436,18 @@ class CommandContext: croak("can't resolve symbol {0} in {1}".format(self.end, metadata.name)) if self.end > len(metadata): croak("{0} has no {1} revision".format(metadata.name, self.end)) - self.seq = range(self.start, self.end+1) + if not self.branchwise: + self.seq = range(self.start, self.end+1) + else: + self.seq = [self.start] + s = self.start + while True: + s = backend.succ(s, self) + if s is None: + croak("%s is not an ancestor of %s" % (self.start, self.end)) + selection.append(s) + if s == self.end: + break class CommentContext: def __init__(self, legend, args):