<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 7:34 PM, David Soria Parra <span dir="ltr"><<a href="mailto:davidsp@fb.com" target="_blank">davidsp@fb.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User David Soria Parra <<a href="mailto:davidsp@fb.com">davidsp@fb.com</a>><br>
# Date 1413479209 25200<br>
#      Thu Oct 16 10:06:49 2014 -0700<br>
# Node ID 638453c54662a68d4243976c36712f0ac3ea272d<br>
# Parent  cbe0c2c08822ca9a36463c385601ecd9a5bb53e2<br>
histedit: pass state to processreplacement<br>
<br>
diff --git a/hgext/histedit.py b/hgext/histedit.py<br>
--- a/hgext/histedit.py<br>
+++ b/hgext/histedit.py<br>
@@ -572,8 +572,7 @@<br>
         state = bootstrapcontinue(ui, state, opts)<br>
     elif goal == 'abort':<br>
         state = readstate(repo)<br>
-        mapping, tmpnodes, leafs, _ntm = processreplacement(repo,<br>
-                state.replacements)<br>
+        mapping, tmpnodes, leafs, _ntm = processreplacement(repo, state)<br></blockquote><div>The repo parameter becomes unnecessary here since you keep a reference to the repo in the state object being sent in?</div><div>For consistencies sake it would be nice if you could assign it like in patch <span style="font-size:13px;color:rgb(0,0,0);font-family:arial,sans-serif">cbe0c2c08822ca9a36463c385601ec</span><span style="font-size:13px;color:rgb(0,0,0);font-family:arial,sans-serif">d9a5bb53e2</span></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
         ui.debug('restore wc to old parent %s\n' % node.short(state.topmost))<br>
         # check whether we should update away<br>
         parentnodes = [c.node() for c in repo[None].parents()]<br>
@@ -649,8 +648,7 @@<br>
<br>
     hg.update(repo, state.parentctx.node())<br>
<br>
-    mapping, tmpnodes, created, ntm = processreplacement(repo,<br>
-            state.replacements)<br>
+    mapping, tmpnodes, created, ntm = processreplacement(repo, state)<br></blockquote><div>same. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
     if mapping:<br>
         for prec, succs in mapping.iteritems():<br>
             if not succs:<br>
@@ -841,12 +839,13 @@<br>
                          hint=_('do you want to use the drop action?'))<br>
     return parsed<br>
<br>
-def processreplacement(repo, replacements):<br>
+def processreplacement(repo, state):<br></blockquote><div>def processreplacement(state):</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
     """process the list of replacements to return<br>
<br>
     1) the final mapping between original and created nodes<br>
     2) the list of temporary node created by histedit<br>
     3) the list of new commit created by histedit"""<br>
+    replacements = state.replacements<br></blockquote><div>repo = state.repo </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
     allsuccs = set()<br>
     replaced = set()<br>
     fullmapping = {}<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com">Mercurial-devel@selenic.com</a><br>
<a href="http://selenic.com/mailman/listinfo/mercurial-devel" target="_blank">http://selenic.com/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Olle
</div></div>