Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/pathutil.py @ 36676:052351e3e1cd
py3: make os.pardir a bytes
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Mar 2018 12:34:35 -0500 |
parents | 705d0f2bb677 |
children | d3b893ec5f08 |
comparison
equal
deleted
inserted
replaced
36675:463df2986814 | 36676:052351e3e1cd |
---|---|
63 if util.endswithsep(path): | 63 if util.endswithsep(path): |
64 raise error.Abort(_("path ends in directory separator: %s") % path) | 64 raise error.Abort(_("path ends in directory separator: %s") % path) |
65 parts = util.splitpath(path) | 65 parts = util.splitpath(path) |
66 if (os.path.splitdrive(path)[0] | 66 if (os.path.splitdrive(path)[0] |
67 or _lowerclean(parts[0]) in ('.hg', '.hg.', '') | 67 or _lowerclean(parts[0]) in ('.hg', '.hg.', '') |
68 or os.pardir in parts): | 68 or pycompat.ospardir in parts): |
69 raise error.Abort(_("path contains illegal component: %s") % path) | 69 raise error.Abort(_("path contains illegal component: %s") % path) |
70 # Windows shortname aliases | 70 # Windows shortname aliases |
71 for p in parts: | 71 for p in parts: |
72 if "~" in p: | 72 if "~" in p: |
73 first, last = p.split("~", 1) | 73 first, last = p.split("~", 1) |