# HG changeset patch # User FUJIWARA Katsunori # Date 1324037380 -32400 # Node ID 081e795c60e0e725f0259b13e5c0050ccd91f603 # Parent ec8730886f36d263ce204ad7d78523cb0e5e47d7 pathauditor: preserve case in abort messages this patch uses both plain and normcase()-ed pathes to preserve letter case of path in abort messages. diff -r ec8730886f36 -r 081e795c60e0 mercurial/scmutil.py --- a/mercurial/scmutil.py Fri Dec 16 21:09:40 2011 +0900 +++ b/mercurial/scmutil.py Fri Dec 16 21:09:40 2011 +0900 @@ -87,7 +87,7 @@ # AIX ignores "/" at end of path, others raise EISDIR. if util.endswithsep(path): raise util.Abort(_("path ends in directory separator: %s") % path) - parts = util.splitpath(normpath) + parts = util.splitpath(path) if (os.path.splitdrive(path)[0] or parts[0].lower() in ('.hg', '.hg.', '') or os.pardir in parts): @@ -101,11 +101,16 @@ raise util.Abort(_('path %r is inside nested repo %r') % (path, base)) + normparts = util.splitpath(normpath) + assert len(parts) == len(normparts) + parts.pop() + normparts.pop() prefixes = [] while parts: prefix = os.sep.join(parts) - if prefix in self.auditeddir: + normprefix = os.sep.join(normparts) + if normprefix in self.auditeddir: break curpath = os.path.join(self.root, prefix) try: @@ -125,8 +130,9 @@ if not self.callback or not self.callback(curpath): raise util.Abort(_('path %r is inside nested repo %r') % (path, prefix)) - prefixes.append(prefix) + prefixes.append(normprefix) parts.pop() + normparts.pop() self.audited.add(normpath) # only add prefixes to the cache after checking everything: we don't