Mercurial > hg > mercurial-source
diff mercurial/pathutil.py @ 23611:6dad422ecc5a stable 3.2.3
pathauditor: check for Windows shortname aliases
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 18 Dec 2014 14:18:28 -0600 (2014-12-18) |
parents | c02a05cc6f5e |
children | a4679a74df14 |
line wrap: on
line diff
--- a/mercurial/pathutil.py +++ b/mercurial/pathutil.py @@ -46,6 +46,13 @@ or _lowerclean(parts[0]) in ('.hg', '.hg.', '') or os.pardir in parts): raise util.Abort(_("path contains illegal component: %s") % path) + # Windows shortname aliases + for p in parts: + if "~" in p: + first, last = p.split("~", 1) + if last.isdigit() and first.upper() in ["HG", "HG8B6C"]: + raise util.Abort(_("path contains illegal component: %s") + % path) if '.hg' in _lowerclean(path): lparts = [_lowerclean(p.lower()) for p in parts] for p in '.hg', '.hg.':