##// END OF EJS Templates
histedit: delete all non-actionclass related code...
Durham Goode -
r24774:a9d63d87 default
parent child Browse files
Show More
@@ -157,7 +157,6 b' try:'
157 157 except ImportError:
158 158 import pickle
159 159 import errno
160 import inspect
161 160 import os
162 161 import sys
163 162
@@ -844,12 +843,8 b' def _histedit(ui, repo, state, *freeargs'
844 843 state.write()
845 844 action, ha = state.rules.pop(0)
846 845 ui.debug('histedit: processing %s %s\n' % (action, ha[:12]))
847 act = actiontable[action]
848 if inspect.isclass(act):
849 actobj = act.fromrule(state, ha)
850 parentctx, replacement_ = actobj.run()
851 else:
852 parentctx, replacement_ = act(ui, state, ha, opts)
846 actobj = actiontable[action].fromrule(state, ha)
847 parentctx, replacement_ = actobj.run()
853 848 state.parentctxnode = parentctx.node()
854 849 state.replacements.extend(replacement_)
855 850 state.write()
@@ -890,62 +885,20 b' def _histedit(ui, repo, state, *freeargs'
890 885 if os.path.exists(repo.sjoin('undo')):
891 886 os.unlink(repo.sjoin('undo'))
892 887
893 def gatherchildren(repo, ctx):
894 # is there any new commit between the expected parent and "."
895 #
896 # note: does not take non linear new change in account (but previous
897 # implementation didn't used them anyway (issue3655)
898 newchildren = [c.node() for c in repo.set('(%d::.)', ctx)]
899 if ctx.node() != node.nullid:
900 if not newchildren:
901 return []
902 newchildren.pop(0) # remove ctx
903 return newchildren
888 def bootstrapcontinue(ui, state, opts):
889 repo = state.repo
890 action, currentnode = state.rules.pop(0)
904 891
905 def bootstrapcontinue(ui, state, opts):
906 repo, parentctxnode = state.repo, state.parentctxnode
907 action, currentnode = state.rules.pop(0)
892 actobj = actiontable[action].fromrule(state, currentnode)
908 893
909 894 s = repo.status()
910 replacements = []
911
912 act = actiontable[action]
913 if inspect.isclass(act):
914 actobj = act.fromrule(state, currentnode)
915 if s.modified or s.added or s.removed or s.deleted:
916 actobj.continuedirty()
917 s = repo.status()
918 if s.modified or s.added or s.removed or s.deleted:
919 raise util.Abort(_("working copy still dirty"))
920
921 parentctx, replacements_ = actobj.continueclean()
922 replacements.extend(replacements_)
923 else:
924 parentctx = repo[parentctxnode]
925 ctx = repo[currentnode]
926 newchildren = gatherchildren(repo, parentctx)
927 # Commit dirty working directory if necessary
928 new = None
895 if s.modified or s.added or s.removed or s.deleted:
896 actobj.continuedirty()
897 s = repo.status()
929 898 if s.modified or s.added or s.removed or s.deleted:
930 # prepare the message for the commit to comes
931 message = ctx.description()
932 editor = cmdutil.getcommiteditor()
933 commit = commitfuncfor(repo, ctx)
934 new = commit(text=message, user=ctx.user(), date=ctx.date(),
935 extra=ctx.extra(), editor=editor)
936 if new is not None:
937 newchildren.append(new)
899 raise util.Abort(_("working copy still dirty"))
938 900
939 # track replacements
940 if ctx.node() not in newchildren:
941 # note: new children may be empty when the changeset is dropped.
942 # this happen e.g during conflicting pick where we revert content
943 # to parent.
944 replacements.append((ctx.node(), tuple(newchildren)))
945
946 if newchildren:
947 # otherwise update "parentctx" before proceeding further
948 parentctx = repo[newchildren[-1]]
901 parentctx, replacements = actobj.continueclean()
949 902
950 903 state.parentctxnode = parentctx.node()
951 904 state.replacements.extend(replacements)
General Comments 0
You need to be logged in to leave comments. Login now