Patchwork [2,of,5,v3] merge: support calculating merge actions against non-working contexts

login
register
mail settings
Submitter David Schleimer
Date Dec. 4, 2012, 8:58 p.m.
Message ID <3a6b107fd5d39114ead6.1354654717@dev010.prn1.facebook.com>
Download mbox | patch
Permalink /patch/14/
State Superseded
Commit 26627c30735a610f59979a36885b327b25d8dbff
Headers show

Comments

David Schleimer - Dec. 4, 2012, 8:58 p.m.
# HG changeset patch
# User David Schleimer <dschleimer at fb.com>
# Date 1354654458 28800
# Node ID 3a6b107fd5d39114ead60e07c998da6fabb4a1dc
# Parent  5b661fc9662414d64156489e6503aca683f38cbe
merge: support calculating merge actions against non-working contexts

This is not currently used.  It is instead a pre-requisite to
performing non-conflicting grafts in memory, which a subsequent patch
will do.

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -355,6 +355,9 @@ 
     def dirs(self):
         return self._dirs
 
+    def dirty(self):
+        return False
+
 class filectx(object):
     """A filecontext object makes access to data related to a particular
        filerevision convenient."""
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -7,7 +7,7 @@ 
 
 from node import nullid, nullrev, hex, bin
 from i18n import _
-import error, scmutil, util, filemerge, copies, subrepo
+import error, scmutil, util, filemerge, copies, subrepo, context
 import errno, os, shutil
 
 class mergestate(object):
@@ -461,7 +461,8 @@ 
             _checkcollision(mctx, tctx)
     if not force:
         _checkunknown(repo, tctx, mctx)
-    action += _forgetremoved(tctx, mctx, branchmerge)
+    if tctx.rev() is None:
+        action += _forgetremoved(tctx, mctx, branchmerge)
     action += manifestmerge(repo, tctx, mctx,
                             ancestor,
                             force and not branchmerge,