Patchwork [5,of,6,mergedriver] merge.mergestate: add a generator for driver-resolved files

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 14, 2015, 11:52 p.m.
Message ID <9f41136f7fa1528e1644.1444866753@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11083/
State Accepted
Commit f4a27c05c43f78c4a94d7749ee6039df6bce33d3
Delegated to: Pierre-Yves David
Headers show

Comments

Siddharth Agarwal - Oct. 14, 2015, 11:52 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444860067 25200
#      Wed Oct 14 15:01:07 2015 -0700
# Node ID 9f41136f7fa1528e16445da843b63945fbe27857
# Parent  409747fc77917ef155c9c5d5c197056e40f63da9
merge.mergestate: add a generator for driver-resolved files

Just like for unresolved files above, we need to be able to tell what files are
driver-resolved.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -329,6 +329,13 @@  class mergestate(object):
             if entry[0] == 'u':
                 yield f
 
+    def driverresolved(self):
+        """Obtain the paths of driver-resolved files."""
+
+        for f, entry in self._state.items():
+            if entry[0] == 'd':
+                yield f
+
     def _resolve(self, preresolve, dfile, wctx, labels=None):
         """rerun merge process for file path `dfile`"""
         if self[dfile] in 'rd':