D3575: narrow: filter set of files to check for case-folding to core

2018-05-18 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG18e6ea9ba81d: narrow: filter set of files to check for 
case-folding to core (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3575?vs=8729=8738

REVISION DETAIL
  https://phab.mercurial-scm.org/D3575

AFFECTED FILES
  hgext/narrow/narrowmerge.py
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -903,6 +903,23 @@
 return actions
 
 def _checkcollision(repo, wmf, actions):
+"""
+Check for case-folding collisions.
+"""
+
+# If the repo is narrowed, filter out files outside the narrowspec.
+narrowmatch = repo.narrowmatch()
+if not narrowmatch.always():
+wmf = wmf.matches(narrowmatch)
+if actions:
+narrowactions = {}
+for m, actionsfortype in actions.iteritems():
+narrowactions[m] = []
+for (f, args, msg) in actionsfortype:
+if narrowmatch(f):
+narrowactions[m].append((f, args, msg))
+actions = narrowactions
+
 # build provisional merged manifest up
 pmmf = set(wmf)
 
diff --git a/hgext/narrow/narrowmerge.py b/hgext/narrow/narrowmerge.py
--- a/hgext/narrow/narrowmerge.py
+++ b/hgext/narrow/narrowmerge.py
@@ -10,26 +10,9 @@
 from mercurial import (
 copies,
 extensions,
-merge,
 )
 
 def setup():
-def _checkcollision(orig, repo, wmf, actions):
-narrowmatch = repo.narrowmatch()
-if not narrowmatch.always():
-wmf = wmf.matches(narrowmatch)
-if actions:
-narrowactions = {}
-for m, actionsfortype in actions.iteritems():
-narrowactions[m] = []
-for (f, args, msg) in actionsfortype:
-if narrowmatch(f):
-narrowactions[m].append((f, args, msg))
-actions = narrowactions
-return orig(repo, wmf, actions)
-
-extensions.wrapfunction(merge, '_checkcollision', _checkcollision)
-
 def _computenonoverlap(orig, repo, *args, **kwargs):
 u1, u2 = orig(repo, *args, **kwargs)
 narrowmatch = repo.narrowmatch()



To: martinvonz, durin42, #hg-reviewers, pulkit
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3575: narrow: filter set of files to check for case-folding to core

2018-05-17 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3575

AFFECTED FILES
  hgext/narrow/narrowmerge.py
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -903,6 +903,23 @@
 return actions
 
 def _checkcollision(repo, wmf, actions):
+"""
+Check for case-folding collisions.
+"""
+
+# If the repo is narrowed, filter out files outside the narrowspec.
+narrowmatch = repo.narrowmatch()
+if not narrowmatch.always():
+wmf = wmf.matches(narrowmatch)
+if actions:
+narrowactions = {}
+for m, actionsfortype in actions.iteritems():
+narrowactions[m] = []
+for (f, args, msg) in actionsfortype:
+if narrowmatch(f):
+narrowactions[m].append((f, args, msg))
+actions = narrowactions
+
 # build provisional merged manifest up
 pmmf = set(wmf)
 
diff --git a/hgext/narrow/narrowmerge.py b/hgext/narrow/narrowmerge.py
--- a/hgext/narrow/narrowmerge.py
+++ b/hgext/narrow/narrowmerge.py
@@ -10,26 +10,9 @@
 from mercurial import (
 copies,
 extensions,
-merge,
 )
 
 def setup():
-def _checkcollision(orig, repo, wmf, actions):
-narrowmatch = repo.narrowmatch()
-if not narrowmatch.always():
-wmf = wmf.matches(narrowmatch)
-if actions:
-narrowactions = {}
-for m, actionsfortype in actions.iteritems():
-narrowactions[m] = []
-for (f, args, msg) in actionsfortype:
-if narrowmatch(f):
-narrowactions[m].append((f, args, msg))
-actions = narrowactions
-return orig(repo, wmf, actions)
-
-extensions.wrapfunction(merge, '_checkcollision', _checkcollision)
-
 def _computenonoverlap(orig, repo, *args, **kwargs):
 u1, u2 = orig(repo, *args, **kwargs)
 narrowmatch = repo.narrowmatch()



To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel