comparison mercurial/merge.py @ 18335:435909bf0257

merge: drop reference to file contents immediately after write Like 7d2aaeea67ed this reduces memory usage on large merges.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 10 Jan 2013 00:45:51 +0100
parents 44bda93df90e
children 77973b6a7b0b
comparison
equal deleted inserted replaced
18334:44bda93df90e 18335:435909bf0257
403 else: 403 else:
404 merged += 1 404 merged += 1
405 elif m == "g": # get 405 elif m == "g": # get
406 flags = a[2] 406 flags = a[2]
407 repo.ui.note(_("getting %s\n") % f) 407 repo.ui.note(_("getting %s\n") % f)
408 t = mctx.filectx(f).data() 408 repo.wwrite(f, mctx.filectx(f).data(), flags)
409 repo.wwrite(f, t, flags)
410 t = None
411 updated += 1 409 updated += 1
412 if f == '.hgsubstate': # subrepo states need updating 410 if f == '.hgsubstate': # subrepo states need updating
413 subrepo.submerge(repo, wctx, mctx, wctx, overwrite) 411 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
414 elif m == "d": # directory rename 412 elif m == "d": # directory rename
415 f2, fd, flags = a[2:] 413 f2, fd, flags = a[2:]
416 if f: 414 if f:
417 repo.ui.note(_("moving %s to %s\n") % (f, fd)) 415 repo.ui.note(_("moving %s to %s\n") % (f, fd))
418 audit(f) 416 audit(f)
419 t = wctx.filectx(f).data() 417 repo.wwrite(fd, wctx.filectx(f).data(), flags)
420 repo.wwrite(fd, t, flags)
421 util.unlinkpath(repo.wjoin(f)) 418 util.unlinkpath(repo.wjoin(f))
422 if f2: 419 if f2:
423 repo.ui.note(_("getting %s to %s\n") % (f2, fd)) 420 repo.ui.note(_("getting %s to %s\n") % (f2, fd))
424 t = mctx.filectx(f2).data() 421 repo.wwrite(fd, mctx.filectx(f2).data(), flags)
425 repo.wwrite(fd, t, flags)
426 updated += 1 422 updated += 1
427 elif m == "dr": # divergent renames 423 elif m == "dr": # divergent renames
428 fl = a[2] 424 fl = a[2]
429 repo.ui.warn(_("note: possible conflict - %s was renamed " 425 repo.ui.warn(_("note: possible conflict - %s was renamed "
430 "multiple times to:\n") % f) 426 "multiple times to:\n") % f)