backends: make HG repos throw same kind of CommitDoesNotExist errors like other backends.
This commit is contained in:
parent
4da7a88228
commit
eadfaeb34a
1 changed files with 6 additions and 1 deletions
|
|
@ -445,7 +445,12 @@ class MercurialRepository(BaseRepository):
|
|||
if isinstance(commit_id, unicode):
|
||||
commit_id = safe_str(commit_id)
|
||||
|
||||
raw_id, idx = self._remote.lookup(commit_id, both=True)
|
||||
try:
|
||||
raw_id, idx = self._remote.lookup(commit_id, both=True)
|
||||
except CommitDoesNotExistError:
|
||||
msg = "Commit %s does not exist for %s" % (
|
||||
commit_id, self)
|
||||
raise CommitDoesNotExistError(msg)
|
||||
|
||||
return MercurialCommit(self, raw_id, idx, pre_load=pre_load)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue