hgext/histedit.py
changeset 19017 c5c8613f265e
parent 18995 0023a6e49268
child 19018 730614b9b352
equal deleted inserted replaced
19016:27ec54f2946e 19017:c5c8613f265e
   616         # this happen e.g during conflicting pick where we revert content
   616         # this happen e.g during conflicting pick where we revert content
   617         # to parent.
   617         # to parent.
   618         replacements.append((ctx.node(), tuple(newchildren)))
   618         replacements.append((ctx.node(), tuple(newchildren)))
   619 
   619 
   620     if action in ('f', 'fold'):
   620     if action in ('f', 'fold'):
   621         # finalize fold operation if applicable
   621         if newchildren:
   622         if new is None:
   622             # finalize fold operation if applicable
   623             new = newchildren[-1]
   623             if new is None:
       
   624                 new = newchildren[-1]
       
   625             else:
       
   626                 newchildren.pop()  # remove new from internal changes
       
   627             parentctx, repl = finishfold(ui, repo, parentctx, ctx, new, opts,
       
   628                                          newchildren)
       
   629             replacements.extend(repl)
   624         else:
   630         else:
   625             newchildren.pop()  # remove new from internal changes
   631             # newchildren is empty if the fold did not result in any commit
   626         parentctx, repl = finishfold(ui, repo, parentctx, ctx, new, opts,
   632             # this happen when all folded change are discarded during the
   627                                      newchildren)
   633             # merge.
   628         replacements.extend(repl)
   634             replacements.append((ctx.node(), (parentctx.node(),)))
   629     elif newchildren:
   635     elif newchildren:
   630         # otherwise update "parentctx" before proceeding to further operation
   636         # otherwise update "parentctx" before proceeding to further operation
   631         parentctx = repo[newchildren[-1]]
   637         parentctx = repo[newchildren[-1]]
   632     return parentctx, replacements
   638     return parentctx, replacements
   633 
   639