hgext/histedit.py
changeset 27414 6602a7b9deec
parent 27407 bf4d5d8dc2aa
child 27451 f209c85183a7
equal deleted inserted replaced
27413:f675ab4d0781 27414:6602a7b9deec
   141 If you run ``hg histedit --outgoing`` on the clone then it is the same
   141 If you run ``hg histedit --outgoing`` on the clone then it is the same
   142 as running ``hg histedit 836302820282``. If you need plan to push to a
   142 as running ``hg histedit 836302820282``. If you need plan to push to a
   143 repository that Mercurial does not detect to be related to the source
   143 repository that Mercurial does not detect to be related to the source
   144 repo, you can add a ``--force`` option.
   144 repo, you can add a ``--force`` option.
   145 
   145 
       
   146 Config
       
   147 ------
       
   148 
   146 Histedit rule lines are truncated to 80 characters by default. You
   149 Histedit rule lines are truncated to 80 characters by default. You
   147 can customize this behavior by setting a different length in your
   150 can customize this behavior by setting a different length in your
   148 configuration file::
   151 configuration file::
   149 
   152 
   150   [histedit]
   153   [histedit]
   154 revision to use. To change which base revision is used, define a
   157 revision to use. To change which base revision is used, define a
   155 revset in your configuration file::
   158 revset in your configuration file::
   156 
   159 
   157   [histedit]
   160   [histedit]
   158   defaultrev = only(.) & draft()
   161   defaultrev = only(.) & draft()
       
   162 
       
   163 By default each edited revision needs to be present in histedit commands.
       
   164 To remove revision you need to use ``drop`` operation. You can configure
       
   165 the drop to be implicit for missing commits by adding:
       
   166 
       
   167   [histedit]
       
   168   dropmissing = True
       
   169 
   159 """
   170 """
   160 
   171 
   161 try:
   172 try:
   162     import cPickle as pickle
   173     import cPickle as pickle
   163     pickle.dump # import now
   174     pickle.dump # import now
  1223             if _constraints.noduplicates in constraints and ha in seen:
  1234             if _constraints.noduplicates in constraints and ha in seen:
  1224                 raise error.Abort(_('duplicated command for changeset %s') %
  1235                 raise error.Abort(_('duplicated command for changeset %s') %
  1225                         ha[:12])
  1236                         ha[:12])
  1226             seen.add(ha)
  1237             seen.add(ha)
  1227     missing = sorted(expected - seen)  # sort to stabilize output
  1238     missing = sorted(expected - seen)  # sort to stabilize output
  1228     if missing:
  1239 
       
  1240     if state.repo.ui.configbool('histedit', 'dropmissing'):
       
  1241         drops = [drop(state, node.bin(n)) for n in missing]
       
  1242         # put the in the beginning so they execute immediately and
       
  1243         # don't show in the edit-plan in the future
       
  1244         actions[:0] = drops
       
  1245     elif missing:
  1229         raise error.Abort(_('missing rules for changeset %s') %
  1246         raise error.Abort(_('missing rules for changeset %s') %
  1230                 missing[0][:12],
  1247                 missing[0][:12],
  1231                 hint=_('use "drop %s" to discard the change') % missing[0][:12])
  1248                 hint=_('use "drop %s" to discard, see also: '
       
  1249                        '"hg help -e histedit.config"') % missing[0][:12])
  1232 
  1250 
  1233 def newnodestoabort(state):
  1251 def newnodestoabort(state):
  1234     """process the list of replacements to return
  1252     """process the list of replacements to return
  1235 
  1253 
  1236     1) the list of final node
  1254     1) the list of final node