diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -813,7 +813,13 @@ def pullrebase(orig, ui, repo, *args, ** def summaryhook(ui, repo): if not os.path.exists(repo.join('rebasestate')): return - state = restorestatus(repo)[2] + try: + state = restorestatus(repo)[2] + except error.RepoLookupError: + # i18n: column positioning for "hg summary" + msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n') + ui.write(msg) + return numrebased = len([i for i in state.itervalues() if i != -1]) # i18n: column positioning for "hg summary" ui.write(_('rebase: %s, %s (rebase --continue)\n') % diff --git a/tests/test-rebase-abort.t b/tests/test-rebase-abort.t --- a/tests/test-rebase-abort.t +++ b/tests/test-rebase-abort.t @@ -95,6 +95,8 @@ earlier than 2.7 by renaming ".hg/rebase abort: cannot continue inconsistent rebase (use "hg rebase --abort" to clear borken state) [255] + $ hg summary | grep '^rebase: ' + rebase: (use "hg rebase --abort" to clear broken state) $ hg rebase --abort rebase aborted (no revision is removed, only broken state is cleared)