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
-branch ancestors of N and branch successors of M).
+branch ancestors of N and branch successors of M). If N is less than
+M, the range is generated as if N >= M then reversed.
If src complains that your revision spec looks like a nonexistent
filename, you can prefix it with @ (this is always allowed).
return metadata.native_to_revno(part)
self.start = subresolve(self.start)
self.end = subresolve(self.end)
+ reversed = (self.start > self.end)
+ if reversed:
+ swapme = self.end
+ self.end = self.start
+ self.start = swapme
if self.end > len(metadata):
croak("{0} has no {1} revision".format(metadata.name, self.end))
if not self.branchwise:
# Because in the branchwise case the sequence is generated in reverse
if backwards != self.branchwise:
self.seq.reverse()
+ # Range might have been reversed
+ if reversed:
+ self.seq.reverse()
return self.seq
class CommentContext: