/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

make 'bzr pull --revision' work for remote repositories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from bzrlib.plugins.git import (
30
30
    lazy_check_versions,
31
31
    )
 
32
from bzrlib.plugins.git.errors import (
 
33
    GitSmartRemoteNotSupported,
 
34
    )
32
35
from bzrlib.plugins.git.mapping import (
33
36
    mapping_registry,
34
37
    )
40
43
    """
41
44
    
42
45
    prefix = 'git:'
 
46
    wants_revision_history = False
43
47
 
44
48
    def _lookup_git_sha1(self, branch, sha1):
45
 
        bzr_revid = branch.mapping.revision_id_foreign_to_bzr(git_sha1)
46
 
        if branch.repository.has_revision(bzr_revid):
47
 
            history = self._history(branch, bzr_revid)
48
 
            return RevisionInfo.from_revision_id(branch, bzr_revid, history)
 
49
        bzr_revid = branch.mapping.revision_id_foreign_to_bzr(sha1)
 
50
        try:
 
51
            if branch.repository.has_revision(bzr_revid):
 
52
                history = self._history(branch, bzr_revid)
 
53
                return RevisionInfo.from_revision_id(branch, bzr_revid, history)
 
54
        except GitSmartRemoteNotSupported:
 
55
            return RevisionInfo(branch, None, bzr_revid)
49
56
        raise InvalidRevisionSpec(self.user_spec, branch)
50
57
 
51
58
    def _history(self, branch, revid):