Patchwork [2,of,5,mergedriver] mergestate: add a way to record pending dirstate actions

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 23, 2015, 6 a.m.
Message ID <cbe7da5c76664eda2c9a.1448258448@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11594/
State Accepted
Headers show

Comments

Siddharth Agarwal - Nov. 23, 2015, 6 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1448067301 28800
#      Fri Nov 20 16:55:01 2015 -0800
# Node ID cbe7da5c76664eda2c9ab0369a0fa2f6ceff981c
# Parent  27d5817b6f00bf4e50351586c78809a9a8eed00a
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r cbe7da5c7666
mergestate: add a way to record pending dirstate actions

We're going to use this in resolve in the next patch.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -517,6 +517,11 @@  class mergestate(object):
                 actions[action].append((f, None, "merge result"))
         return actions
 
+    def recordactions(self):
+        """record remove/add/get actions in the dirstate"""
+        branchmerge = self._repo.dirstate.p2() != nullid
+        recordupdates(self._repo, self.actions(), branchmerge)
+
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
     if f2 is None:
         f2 = f