hgext/histedit.py
changeset 27414 6602a7b9deec
parent 27407 bf4d5d8dc2aa
child 27451 f209c85183a7
--- a/hgext/histedit.py	Wed Dec 16 12:33:54 2015 +0100
+++ b/hgext/histedit.py	Tue Dec 15 13:27:09 2015 -0800
@@ -143,6 +143,9 @@
 repository that Mercurial does not detect to be related to the source
 repo, you can add a ``--force`` option.
 
+Config
+------
+
 Histedit rule lines are truncated to 80 characters by default. You
 can customize this behavior by setting a different length in your
 configuration file::
@@ -156,6 +159,14 @@
 
   [histedit]
   defaultrev = only(.) & draft()
+
+By default each edited revision needs to be present in histedit commands.
+To remove revision you need to use ``drop`` operation. You can configure
+the drop to be implicit for missing commits by adding:
+
+  [histedit]
+  dropmissing = True
+
 """
 
 try:
@@ -1225,10 +1236,17 @@
                         ha[:12])
             seen.add(ha)
     missing = sorted(expected - seen)  # sort to stabilize output
-    if missing:
+
+    if state.repo.ui.configbool('histedit', 'dropmissing'):
+        drops = [drop(state, node.bin(n)) for n in missing]
+        # put the in the beginning so they execute immediately and
+        # don't show in the edit-plan in the future
+        actions[:0] = drops
+    elif missing:
         raise error.Abort(_('missing rules for changeset %s') %
                 missing[0][:12],
-                hint=_('use "drop %s" to discard the change') % missing[0][:12])
+                hint=_('use "drop %s" to discard, see also: '
+                       '"hg help -e histedit.config"') % missing[0][:12])
 
 def newnodestoabort(state):
     """process the list of replacements to return