Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 44333:e76d98546bd2
merge: use manifestdict.walk() instead of manifestdict.matches()
As with other patches in this series, this avoids making a
potentially-expensive copy of a manifest.
Differential Revision: https://phab.mercurial-scm.org/D8084
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 05 Feb 2020 17:12:39 -0500 |
parents | c791ed6a2154 |
children | 9f8eddd2723f |
comparison
equal
deleted
inserted
replaced
44332:bbecb6d80aa7 | 44333:e76d98546bd2 |
---|---|
995 | 995 |
996 def _checkcollision(repo, wmf, actions): | 996 def _checkcollision(repo, wmf, actions): |
997 """ | 997 """ |
998 Check for case-folding collisions. | 998 Check for case-folding collisions. |
999 """ | 999 """ |
1000 | |
1001 # If the repo is narrowed, filter out files outside the narrowspec. | 1000 # If the repo is narrowed, filter out files outside the narrowspec. |
1002 narrowmatch = repo.narrowmatch() | 1001 narrowmatch = repo.narrowmatch() |
1003 if not narrowmatch.always(): | 1002 if not narrowmatch.always(): |
1004 wmf = wmf.matches(narrowmatch) | 1003 pmmf = set(wmf.walk(narrowmatch)) |
1005 if actions: | 1004 if actions: |
1006 narrowactions = {} | 1005 narrowactions = {} |
1007 for m, actionsfortype in pycompat.iteritems(actions): | 1006 for m, actionsfortype in pycompat.iteritems(actions): |
1008 narrowactions[m] = [] | 1007 narrowactions[m] = [] |
1009 for (f, args, msg) in actionsfortype: | 1008 for (f, args, msg) in actionsfortype: |
1010 if narrowmatch(f): | 1009 if narrowmatch(f): |
1011 narrowactions[m].append((f, args, msg)) | 1010 narrowactions[m].append((f, args, msg)) |
1012 actions = narrowactions | 1011 actions = narrowactions |
1013 | 1012 else: |
1014 # build provisional merged manifest up | 1013 # build provisional merged manifest up |
1015 pmmf = set(wmf) | 1014 pmmf = set(wmf) |
1016 | 1015 |
1017 if actions: | 1016 if actions: |
1018 # KEEP and EXEC are no-op | 1017 # KEEP and EXEC are no-op |
1019 for m in ( | 1018 for m in ( |
1020 ACTION_ADD, | 1019 ACTION_ADD, |