# HG changeset patch # User Martin von Zweigbergk # Date 1413235127 25200 # Node ID 4f2a5c7cdf78ac2cc7e0d9f04c8018455e1d24cc # Parent 4545c5b53013bff82ea62e7f5a4439883c264e3c commit: update file nodeid and flags in the same place Now that we have a separate variable for the original 'm1' manifest, we can safely update the nodeid of the file in the new manifest in the same place as we update the flags. diff -r 4545c5b53013 -r 4f2a5c7cdf78 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Oct 13 14:11:47 2014 -0700 +++ b/mercurial/localrepo.py Mon Oct 13 14:18:47 2014 -0700 @@ -1392,7 +1392,7 @@ m = m1.copy() # check in files - new = {} + added = [] changed = [] removed = list(ctx.removed()) linkrev = len(self) @@ -1403,8 +1403,9 @@ if fctx is None: removed.append(f) else: - new[f] = self._filecommit(fctx, m1, m2, linkrev, - trp, changed) + added.append(f) + m[f] = self._filecommit(fctx, m1, m2, linkrev, + trp, changed) m.set(f, fctx.flags()) except OSError, inst: self.ui.warn(_("trouble committing %s!\n") % f) @@ -1416,14 +1417,13 @@ raise # update manifest - m.update(new) removed = [f for f in sorted(removed) if f in m1 or f in m2] drop = [f for f in removed if f in m] for f in drop: del m[f] mn = self.manifest.add(m, trp, linkrev, p1.manifestnode(), p2.manifestnode(), - new, drop) + added, drop) files = changed + removed else: mn = p1.manifestnode()