diff --git a/mercurial/merge.py b/mercurial/merge.py index e2dc5397bc822213cb771e3108030cf24407d080_bWVyY3VyaWFsL21lcmdlLnB5..3e20079117c5d00ea28fd976fde95b948905debc_bWVyY3VyaWFsL21lcmdlLnB5 100644 --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -342,6 +342,6 @@ def actionkey(a): return a[1] == "r" and -1 or 0, a -def getremove(repo, wctx, mctx, overwrite, args): +def getremove(repo, mctx, overwrite, args): """apply usually-non-interactive updates to the working directory @@ -346,6 +346,5 @@ """apply usually-non-interactive updates to the working directory - wctx is the working copy context mctx is the context to be merged into the working copy yields tuples for progress updates @@ -355,8 +354,6 @@ f = arg[0] if arg[1] == 'r': repo.ui.note(_("removing %s\n") % f) - if f == '.hgsubstate': # subrepo states need updating - subrepo.submerge(repo, wctx, mctx, wctx, overwrite) audit(f) try: util.unlinkpath(repo.wjoin(f), ignoremissing=True) @@ -366,8 +363,6 @@ else: repo.ui.note(_("getting %s\n") % f) repo.wwrite(f, mctx.filectx(f).data(), arg[2][0]) - if f == '.hgsubstate': # subrepo states need updating - subrepo.submerge(repo, wctx, mctx, wctx, overwrite) yield i, f def applyupdates(repo, actions, wctx, mctx, actx, overwrite): @@ -426,7 +421,11 @@ removed = len([a for a in workeractions if a[1] == 'r']) actions = [a for a in actions if a[1] not in 'gr'] - for i, item in getremove(repo, wctx, mctx, overwrite, workeractions): + hgsub = [a[1] for a in workeractions if a[0] == '.hgsubstate'] + if hgsub and hgsub[0] == 'r': + subrepo.submerge(repo, wctx, mctx, wctx, overwrite) + + for i, item in getremove(repo, mctx, overwrite, workeractions): repo.ui.progress(_('updating'), i + 1, item=item, total=numupdates, unit=_('files')) @@ -430,6 +429,9 @@ repo.ui.progress(_('updating'), i + 1, item=item, total=numupdates, unit=_('files')) + if hgsub and hgsub[0] == 'g': + subrepo.submerge(repo, wctx, mctx, wctx, overwrite) + z = len(workeractions) for i, a in enumerate(actions):