##// 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 except ImportError:
157 except ImportError:
158 import pickle
158 import pickle
159 import errno
159 import errno
160 import inspect
161 import os
160 import os
162 import sys
161 import sys
163
162
@@ -844,12 +843,8 b' def _histedit(ui, repo, state, *freeargs'
844 state.write()
843 state.write()
845 action, ha = state.rules.pop(0)
844 action, ha = state.rules.pop(0)
846 ui.debug('histedit: processing %s %s\n' % (action, ha[:12]))
845 ui.debug('histedit: processing %s %s\n' % (action, ha[:12]))
847 act = actiontable[action]
846 actobj = actiontable[action].fromrule(state, ha)
848 if inspect.isclass(act):
847 parentctx, replacement_ = actobj.run()
849 actobj = act.fromrule(state, ha)
850 parentctx, replacement_ = actobj.run()
851 else:
852 parentctx, replacement_ = act(ui, state, ha, opts)
853 state.parentctxnode = parentctx.node()
848 state.parentctxnode = parentctx.node()
854 state.replacements.extend(replacement_)
849 state.replacements.extend(replacement_)
855 state.write()
850 state.write()
@@ -890,62 +885,20 b' def _histedit(ui, repo, state, *freeargs'
890 if os.path.exists(repo.sjoin('undo')):
885 if os.path.exists(repo.sjoin('undo')):
891 os.unlink(repo.sjoin('undo'))
886 os.unlink(repo.sjoin('undo'))
892
887
893 def gatherchildren(repo, ctx):
888 def bootstrapcontinue(ui, state, opts):
894 # is there any new commit between the expected parent and "."
889 repo = state.repo
895 #
890 action, currentnode = state.rules.pop(0)
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
904
891
905 def bootstrapcontinue(ui, state, opts):
892 actobj = actiontable[action].fromrule(state, currentnode)
906 repo, parentctxnode = state.repo, state.parentctxnode
907 action, currentnode = state.rules.pop(0)
908
893
909 s = repo.status()
894 s = repo.status()
910 replacements = []
895 if s.modified or s.added or s.removed or s.deleted:
911
896 actobj.continuedirty()
912 act = actiontable[action]
897 s = repo.status()
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
929 if s.modified or s.added or s.removed or s.deleted:
898 if s.modified or s.added or s.removed or s.deleted:
930 # prepare the message for the commit to comes
899 raise util.Abort(_("working copy still dirty"))
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)
938
900
939 # track replacements
901 parentctx, replacements = actobj.continueclean()
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]]
949
902
950 state.parentctxnode = parentctx.node()
903 state.parentctxnode = parentctx.node()
951 state.replacements.extend(replacements)
904 state.replacements.extend(replacements)
General Comments 0
You need to be logged in to leave comments. Login now