/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/revisionspec.py

  • Committer: Aaron Bentley
  • Date: 2008-03-29 21:16:20 UTC
  • mto: (3298.2.13 revision_id_to_revno)
  • mto: This revision was merged to the branch mainline in revision 3328.
  • Revision ID: aaron@aaronbentley.com-20080329211620-1a91xrjinusqxudy
Update tests for null:, clea up slightly

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
 
101
101
        Use this if you don't know or care what the revno is.
102
102
        """
 
103
        if revision_id == revision.NULL_REVISION:
 
104
            return RevisionInfo(branch, 0, revision_id)
103
105
        try:
104
106
            revno = revs.index(revision_id) + 1
105
107
        except ValueError:
201
203
 
202
204
    def _match_on(self, branch, revs):
203
205
        trace.mutter('Returning RevisionSpec._match_on: None')
204
 
        return RevisionInfo(branch, 0, None)
 
206
        return RevisionInfo(branch, None, None)
205
207
 
206
208
    def _match_on_and_check(self, branch, revs):
207
209
        info = self._match_on(branch, revs)
208
210
        if info:
209
211
            return info
210
 
        elif info == (0, None):
211
 
            # special case - the empty tree
 
212
        elif info == (None, None):
 
213
            # special case - nothing supplied
212
214
            return info
213
215
        elif self.prefix:
214
216
            raise errors.InvalidRevisionSpec(self.user_spec, branch)
662
664
        finally:
663
665
            branch.unlock()
664
666
        if rev == len(revs):
665
 
            return RevisionInfo(branch, None)
 
667
            raise errors.InvalidRevisionSpec(self.user_spec, branch)
666
668
        else:
667
669
            return RevisionInfo(branch, rev + 1)
668
670