imported patch collision
authorMatt Mackall <mpm@selenic.com>
Mon, 04 Dec 2006 17:10:31 -0600
changeset 3785 6398ff7cb705
parent 3784 1427949b8f80
child 3786 8d603f8567ae
imported patch collision
mercurial/merge.py
--- a/mercurial/merge.py	Mon Dec 04 17:10:29 2006 -0600
+++ b/mercurial/merge.py	Mon Dec 04 17:10:31 2006 -0600
@@ -68,6 +68,16 @@
                 raise util.Abort(_("untracked local file '%s' differs"\
                                    " from remote version") % f)
 
+def checkcollision(mctx):
+    "check for case folding collisions in the destination context"
+    folded = {}
+    for fn in mctx.manifest():
+        fold = fn.lower()
+        if fold in folded:
+            raise util.Abort(_("case-folding collision between %s and %s")
+                             % (fn, folded[fold]))
+        folded[fold] = fn
+
 def forgetremoved(wctx, mctx):
     """
     Forget removed files
@@ -460,6 +470,8 @@
     action = []
     if not force:
         checkunknown(wc, p2)
+    if not util.checkfolding(repo.path):
+        checkcollision(p2)
     if not branchmerge:
         action += forgetremoved(wc, p2)
     action += manifestmerge(repo, wc, p2, pa, overwrite, partial)