Merge lp:~jelmer/bzr/kill-revspec-nonzero into lp:bzr

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 6382
Proposed branch: lp:~jelmer/bzr/kill-revspec-nonzero
Merge into: lp:bzr
Diff against target: 12 lines (+0/-2)
1 file modified
bzrlib/revisionspec.py (+0/-2)
To merge this branch: bzr merge lp:~jelmer/bzr/kill-revspec-nonzero
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+86171@code.launchpad.net

Commit message

In RevisionSpec.__nonzero__, only check the revision id, not the revision number.

Description of the change

In RevisionSpec.__nonzero__, only check the revision id,
not the revision number.

Checking the revision number means in some cases iterating over all
of history, even when the operation that's being executed
("bzr diff -rrevid:A..B") doesn't need revision numbers.

All tests passed with this changed, so we didn't seem to be relying
on this behaviour anywhere either.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

  vote approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/revisionspec.py'
2--- bzrlib/revisionspec.py 2011-12-01 23:10:02 +0000
3+++ bzrlib/revisionspec.py 2011-12-18 18:08:25 +0000
4@@ -78,8 +78,6 @@
5 # first the easy ones...
6 if self.rev_id is None:
7 return False
8- if self.revno is not None:
9- return True
10 # TODO: otherwise, it should depend on how I was built -
11 # if it's in_history(branch), then check revision_history(),
12 # if it's in_store(branch), do the check below