/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 revspec.py

Override GitRevisionSpec.__nonzero__ as the default implementation uses has_revision(), which is not available on remote git repositories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    InvalidRevisionSpec,
22
22
    NoSuchRevision,
23
23
    )
 
24
from bzrlib.revision import (
 
25
    NULL_REVISION,
 
26
    )
24
27
from bzrlib.revisionspec import (
25
28
    RevisionInfo,
26
29
    RevisionSpec,
60
63
        history.reverse()
61
64
        return history
62
65
 
 
66
    def __nonzero__(self):
 
67
        # The default implementation uses branch.repository.has_revision()
 
68
        if self.rev_id is None:
 
69
            return False
 
70
        if self.rev_id == NULL_REVISION:
 
71
            return False
 
72
        return True
 
73
 
63
74
    def _find_short_git_sha1(self, branch, sha1):
64
75
        parse_revid = getattr(branch.repository, "lookup_git_revid",
65
76
                              mapping_registry.parse_revision_id)