Patchwork [2,of,6] smcutil: add "casecollisionauditor._oncollision()" to be shared by multiple checks

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Nov. 14, 2013, 4:07 p.m.
Message ID <8d55541fd42a8bd9ea4f.1384445278@juju>
Download mbox | patch
Permalink /patch/2945/
State Superseded
Headers show

Comments

Katsunori FUJIWARA - Nov. 14, 2013, 4:07 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1384438902 -32400
#      Thu Nov 14 23:21:42 2013 +0900
# Node ID 8d55541fd42a8bd9ea4fec42b42c89b7dea6cfb8
# Parent  657b0bc5f761ccd031c396d84b28f00354778614
smcutil: add "casecollisionauditor._oncollision()" to be shared by multiple checks

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -101,13 +101,16 @@ 
             return
         fl = encoding.lower(f)
         if fl in self._loweredfiles and f not in self._dirstate:
-            msg = _('possible case-folding collision for %s') % f
-            if self._abort:
-                raise util.Abort(msg)
-            self._ui.warn(_("warning: %s\n") % msg)
+            self._oncollision(f)
         self._loweredfiles.add(fl)
         self._newfiles.add(f)
 
+    def _oncollision(self, f):
+        msg = _('possible case-folding collision for %s') % f
+        if self._abort:
+            raise util.Abort(msg)
+        self._ui.warn(_("warning: %s\n") % msg)
+
 class pathauditor(object):
     '''ensure that a filesystem path contains no banned components.
     the following properties of a path are checked: