Patchwork [6,of,6] merge.mergestate: use mergectx wrapper

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 9, 2015, 6:46 p.m.
Message ID <b9680b02e1d11a2b0888.1444416373@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/10925/
State Accepted
Headers show

Comments

Siddharth Agarwal - Oct. 9, 2015, 6:46 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444372511 25200
#      Thu Oct 08 23:35:11 2015 -0700
# Node ID b9680b02e1d11a2b0888f17c627cf6e127e38205
# Parent  9e90b12aded615f7d16c042637a69f4b85847a9b
merge.mergestate: use mergectx wrapper

This is much cleaner to use.
Pierre-Yves David - Oct. 9, 2015, 10:57 p.m.
On 10/09/2015 11:46 AM, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1444372511 25200
> #      Thu Oct 08 23:35:11 2015 -0700
> # Node ID b9680b02e1d11a2b0888f17c627cf6e127e38205
> # Parent  9e90b12aded615f7d16c042637a69f4b85847a9b
> merge.mergestate: use mergectx wrapper

These one are pushed to the clowncopter.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -309,13 +309,11 @@  class mergestate(object):
         f = self._repo.vfs('merge/' + hash)
         self._repo.wwrite(dfile, f.read(), flags)
         f.close()
-        mergecr = filemerge.filemerge(self._repo, self._local, lfile, fcd, fco,
+        mergectx = filemerge.mergectx(self._repo, self._local, lfile, fcd, fco,
                                       fca, labels=labels)
-        try:
-            next(mergecr)  # premerge
-            next(mergecr)  # merge
-        except StopIteration as e:
-            r = e.args[0]
+        paused, r = mergectx.premerge()
+        if paused:
+            r = mergectx.merge()
 
         if r is None:
             # no real conflict