[PATCH 2 of 6] smcutil: add "casecollisionauditor._oncollision()" to be shared by multiple checks
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Thu Nov 14 10:07:58 CST 2013
# HG changeset patch
# User FUJIWARA Katsunori <foozy at 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
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:
More information about the Mercurial-devel
mailing list