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

Cope with Dulwich returning KeyError when a commit is not found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
                parent_map[revision_id] = ()
135
135
                continue
136
136
            hexsha, mapping = self.lookup_git_revid(revision_id)
137
 
            commit  = self._git.commit(hexsha)
 
137
            try:
 
138
                commit = self._git.commit(hexsha)
 
139
            except KeyError:
 
140
                continue
138
141
            if commit is None:
 
142
                # Older versions of Dulwich used to return None rather than 
 
143
                # raise KeyError.
139
144
                continue
140
145
            else:
141
146
                parent_map[revision_id] = [mapping.revision_id_foreign_to_bzr(p) for p in commit.parents]