diff --git a/hgext/imerge.py b/hgext/imerge.py --- a/hgext/imerge.py +++ b/hgext/imerge.py @@ -8,7 +8,7 @@ imerge - interactive merge from mercurial.i18n import _ from mercurial.node import hex, short from mercurial import commands, cmdutil, dispatch, fancyopts -from mercurial import hg, filemerge, util +from mercurial import hg, filemerge, util, revlog import os, tarfile class InvalidStateFileException(Exception): pass @@ -78,8 +78,8 @@ class Imerge(object): try: parents = [self.repo.changectx(n) for n in status[:2]] - except LookupError: - raise util.Abort('merge parent %s not in repository' % short(p)) + except revlog.LookupError, e: + raise util.Abort('merge parent %s not in repository' % e.name) status = status[2:] conflicts = int(status.pop(0)) * 3 diff --git a/tests/test-imerge b/tests/test-imerge --- a/tests/test-imerge +++ b/tests/test-imerge @@ -61,4 +61,10 @@ hg up 0 echo % nothing to merge hg imerge +cd .. +hg -q clone -r 0 base clone +cd clone +echo % load unknown parent +hg imerge load ../savedmerge + exit 0 diff --git a/tests/test-imerge.out b/tests/test-imerge.out --- a/tests/test-imerge.out +++ b/tests/test-imerge.out @@ -46,3 +46,5 @@ abort: there is nothing to merge 2 files updated, 0 files merged, 1 files removed, 0 files unresolved % nothing to merge abort: there is nothing to merge - use "hg update" instead +% load unknown parent +abort: merge parent e6da4671640124fe5d3d70d2f54441d6cd76ae35 not in repository