Mercurial > public > mercurial-scm > hg-stable
diff mercurial/merge.py @ 21082:0d67fccc0d43
merge: let manifestmerge emit 'keep' actions when keeping wd version
Such a 'keep' action will later be the preferred (non)action when there
is multiple ancestors. It is thus very convenient to have it explicitly.
The extra actions will only be emitted in the case where the local file has
changed since the ancestor but the other hasn't. That is the symmetrical
operation to a 'get' action.
This will create more action tuples that not really serve a purpose. The number
of actions will however have the number of changed files as upper bound and it
should thus not increase the memory/cpu use significantly.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 07 Apr 2014 02:12:28 +0200 |
parents | ffd7b6ce46ff |
children | f4014f646f71 |
line wrap: on
line diff
--- a/mercurial/merge.py Sun Apr 06 13:39:51 2014 +0200 +++ b/mercurial/merge.py Mon Apr 07 02:12:28 2014 +0200 @@ -449,7 +449,7 @@ fla = ma.flags(fa) nol = 'l' not in fl1 + fl2 + fla if n2 == a and fl2 == fla: - pass # remote unchanged - keep local + actions.append((f, "k", (), "keep")) # remote unchanged elif n1 == a and fl1 == fla: # local unchanged - use remote if n1 == n2: # optimization: keep local content actions.append((f, "e", (fl2,), "update permissions")) @@ -634,13 +634,13 @@ audit(f) util.unlinkpath(repo.wjoin(f)) - numupdates = len(actions) + numupdates = len([a for a in actions if a[1] != 'k']) workeractions = [a for a in actions if a[1] in 'gr'] updateactions = [a for a in workeractions if a[1] == 'g'] updated = len(updateactions) removeactions = [a for a in workeractions if a[1] == 'r'] removed = len(removeactions) - actions = [a for a in actions if a[1] not in 'gr'] + actions = [a for a in actions if a[1] not in 'grk'] hgsub = [a[1] for a in workeractions if a[0] == '.hgsubstate'] if hgsub and hgsub[0] == 'r': @@ -778,6 +778,8 @@ repo.dirstate.drop(f) elif m == "e": # exec change repo.dirstate.normallookup(f) + elif m == "k": # keep + pass elif m == "g": # get if branchmerge: repo.dirstate.otherparent(f)