# HG changeset patch # User Pierre-Yves David # Date 1366291670 -7200 # Node ID 1163ff06ce897e6be7b336f535b29d47449418c6 # Parent 81de87f8b4801b3e53c995ee59f94db1d94e1222 histedit: more precise user message when changeset is missing Now that we explicitly detect duplicated changesets, we can explicitly detect missing ones. We cover the same cases as before, some others and we offer a better error message in all cases. diff -r 81de87f8b480 -r 1163ff06ce89 hgext/histedit.py --- a/hgext/histedit.py Thu Apr 18 15:22:24 2013 +0200 +++ b/hgext/histedit.py Thu Apr 18 15:27:50 2013 +0200 @@ -718,8 +718,6 @@ parsed = [] expected = set(str(c) for c in ctxs) seen = set() - if len(rules) != len(expected): - raise util.Abort(_('must specify a rule for each changeset once')) for r in rules: if ' ' not in r: raise util.Abort(_('malformed line "%s"') % r) @@ -738,6 +736,10 @@ if action not in actiontable: raise util.Abort(_('unknown action "%s"') % action) parsed.append([action, ha]) + missing = sorted(expected - seen) # sort to stabilize output + if missing: + raise util.Abort(_('missing rules for changeset %s') % missing[0], + hint=_('do you want to use the drop action?')) return parsed def processreplacement(repo, replacements): diff -r 81de87f8b480 -r 1163ff06ce89 tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t Thu Apr 18 15:22:24 2013 +0200 +++ b/tests/test-histedit-arguments.t Thu Apr 18 15:27:50 2013 +0200 @@ -77,7 +77,8 @@ > pick eb57da33312f 2 three > pick 08d98a8350f3 4 five > EOF - abort: must specify a rule for each changeset once + abort: missing rules for changeset c8e68270e35a + (do you want to use the drop action?) [255] Test that extra revisions are detected