mercurial/merge.py
changeset 8814 ab668c92a036
parent 8753 af5f099d932b
child 9030 3f56055ff1d7
--- a/mercurial/merge.py	Mon Jun 15 02:45:38 2009 -0500
+++ b/mercurial/merge.py	Mon Jun 15 02:45:38 2009 -0500
@@ -7,7 +7,7 @@
 
 from node import nullid, nullrev, hex, bin
 from i18n import _
-import util, filemerge, copies
+import util, filemerge, copies, subrepo
 import errno, os, shutil
 
 class mergestate(object):
@@ -241,12 +241,15 @@
     ms.reset(wctx.parents()[0].node())
     moves = []
     action.sort(key=actionkey)
+    substate = wctx.substate # prime
 
     # prescan for merges
     for a in action:
         f, m = a[:2]
         if m == 'm': # merge
             f2, fd, flags, move = a[2:]
+            if f == '.hgsubstate': # merged internally
+                continue
             repo.ui.debug(_("preserving %s for resolve of %s\n") % (f, fd))
             fcl = wctx[f]
             fco = mctx[f2]
@@ -270,6 +273,8 @@
         if m == "r": # remove
             repo.ui.note(_("removing %s\n") % f)
             audit_path(f)
+            if f == '.hgsubstate': # subrepo states need updating
+                subrepo.submerge(repo, wctx, mctx, wctx)
             try:
                 util.unlink(repo.wjoin(f))
             except OSError, inst:
@@ -278,6 +283,9 @@
                                  (f, inst.strerror))
             removed += 1
         elif m == "m": # merge
+            if f == '.hgsubstate': # subrepo states need updating
+                subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx))
+                continue
             f2, fd, flags, move = a[2:]
             r = ms.resolve(fd, wctx, mctx)
             if r > 0:
@@ -297,6 +305,8 @@
             t = mctx.filectx(f).data()
             repo.wwrite(f, t, flags)
             updated += 1
+            if f == '.hgsubstate': # subrepo states need updating
+                subrepo.submerge(repo, wctx, mctx, wctx)
         elif m == "d": # directory rename
             f2, fd, flags = a[2:]
             if f: