diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -498,8 +498,8 @@ def histedit(ui, repo, *parent, **opts): keep = opts.get('keep', False) revs = between(repo, parent, topmost, keep) if not revs: - ui.warn(_('nothing to edit\n')) - return 1 + raise util.Abort(_('%s is not an ancestor of working directory') % + node.short(parent)) ctxs = [repo[r] for r in revs] rules = opts.get('commands', '') diff --git a/tests/test-histedit-revspec.t b/tests/test-histedit-revspec.t --- a/tests/test-histedit-revspec.t +++ b/tests/test-histedit-revspec.t @@ -65,5 +65,5 @@ Run on a revision not ancestors of the c $ hg up 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg histedit -r 4 - nothing to edit - [1] + abort: 08d98a8350f3 is not an ancestor of working directory + [255]