[PATCH 10 of 14] merge: drop reference to file contents immediately after write
Mads Kiilerich
mads at kiilerich.com
Sun Jan 13 19:02:45 UTC 2013
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1357775151 -3600
# Node ID 583e0caedba3ec1fece6ec7afc0a2e44082d984e
# Parent 4059319bd1d4a9145c5f2b159e5d909f64bdf54c
merge: drop reference to file contents immediately after write
Like 7d2aaeea67ed this reduces memory usage on large merges.
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -405,9 +405,7 @@ def applyupdates(repo, actions, wctx, mc
elif m == "g": # get
flags = a[2]
repo.ui.note(_("getting %s\n") % f)
- t = mctx.filectx(f).data()
- repo.wwrite(f, t, flags)
- t = None
+ repo.wwrite(f, mctx.filectx(f).data(), flags)
updated += 1
if f == '.hgsubstate': # subrepo states need updating
subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
@@ -416,13 +414,11 @@ def applyupdates(repo, actions, wctx, mc
if f:
repo.ui.note(_("moving %s to %s\n") % (f, fd))
audit(f)
- t = wctx.filectx(f).data()
- repo.wwrite(fd, t, flags)
+ repo.wwrite(fd, wctx.filectx(f).data(), flags)
util.unlinkpath(repo.wjoin(f))
if f2:
repo.ui.note(_("getting %s to %s\n") % (f2, fd))
- t = mctx.filectx(f2).data()
- repo.wwrite(fd, t, flags)
+ repo.wwrite(fd, mctx.filectx(f2).data(), flags)
updated += 1
elif m == "dr": # divergent renames
fl = a[2]
More information about the Mercurial-devel
mailing list