Patchwork D1215: merge: skip subrepo state, update hooks, and updating the dirstate in IMM

login
register
mail settings
Submitter phabricator
Date Nov. 16, 2017, 6:16 a.m.
Message ID <dc370ea910dcfe6285825b9bda899d4e@localhost.localdomain>
Download mbox | patch
Permalink /patch/25604/
State Not Applicable
Headers show

Comments

phabricator - Nov. 16, 2017, 6:16 a.m.
phillco updated this revision to Diff 3561.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1215?vs=3555&id=3561

REVISION DETAIL
  https://phab.mercurial-scm.org/D1215

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




To: phillco, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1825,8 +1825,9 @@ 
             if not force and (wc.files() or wc.deleted()):
                 raise error.Abort(_("uncommitted changes"),
                                  hint=_("use 'hg status' to list changes"))
-            for s in sorted(wc.substate):
-                wc.sub(s).bailifchanged()
+            if not wc.isinmemory():
+                for s in sorted(wc.substate):
+                    wc.sub(s).bailifchanged()
 
         elif not overwrite:
             if p1 == p2: # no-op update
@@ -1941,7 +1942,7 @@ 
         ### apply phase
         if not branchmerge: # just jump to the new rev
             fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
-        if not partial:
+        if not partial and not wc.isinmemory():
             repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
             # note that we're in the middle of an update
             repo.vfs.write('updatestate', p2.hex())
@@ -1980,7 +1981,7 @@ 
 
         stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
 
-        if not partial:
+        if not partial and not wc.isinmemory():
             with repo.dirstate.parentchange():
                 repo.setparents(fp1, fp2)
                 recordupdates(repo, actions, branchmerge)