[PATCH 5 of 5 v3] graft: apply get-only changes in-memory

Matt Mackall mpm at selenic.com
Tue Dec 4 16:59:59 CST 2012


On Tue, 2012-12-04 at 12:58 -0800, David Schleimer wrote:
> # HG changeset patch
> # User David Schleimer <dschleimer at fb.com>
> # Date 1354654458 28800
> # Node ID df518d2b8f24b4b5aa0c0271c368e045b1b28885
> # Parent  7cc8b808bfcb3a282cdcfeacd73a0583efc4b58a
> graft: apply get-only changes in-memory

Still too big, I'm afraid.

I recommend a first step here is to change update() to calculate+apply.

We're going to want to do this apply-in-memory trick elsewhere (eg
rebase, evolve), so it makes sense to have ALL of the apply-in-memory
magic in merge.py to minimize the complexity at the use sites. Something
like:

actionlist = mergemod.calculate()
if maybeinmemory:
   result = mergemod.applyinmemory(actionlist)
if not maybeinmemory or result is bad:
   if working directory lags:
      update(current)
   result = mergemod.applytodisk(actionlist)

..and then leave it up to applyinmemory() to know what it can and cannot
do. Ideally, all the other details (like decoupling 'current' from '.'
and fiddling with extra) are staged so that the above is done in a short
patch of its own.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list