/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

Fix some more tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
        raise InvalidRevisionSpec(self.user_spec, branch)
72
72
 
73
73
    def _history(self, branch, revid):
74
 
        history = list(branch.repository.iter_reverse_revision_history(revid))
 
74
        branch.lock_read()
 
75
        try:
 
76
            history = list(branch.repository.iter_reverse_revision_history(
 
77
                revid))
 
78
        finally:
 
79
            branch.unlock()
75
80
        history.reverse()
76
81
        return history
77
82
 
88
93
 
89
94
    def _find_short_git_sha1(self, branch, sha1):
90
95
        from bzrlib.plugins.git.mapping import (
 
96
            ForeignGit,
91
97
            mapping_registry,
92
98
            )
93
99
        parse_revid = getattr(branch.repository, "lookup_bzr_revision_id",
100
106
                    foreign_revid, mapping = parse_revid(revid)
101
107
                except InvalidRevisionId:
102
108
                    continue
 
109
                if not isinstance(mapping.vcs, ForeignGit):
 
110
                    continue
103
111
                if foreign_revid.startswith(sha1):
104
112
                    history = self._history(branch, revid)
105
113
                    return RevisionInfo.from_revision_id(branch, revid, history)