# HG changeset patch # User Matt Mackall # Date 2011-10-24 21:57:14 # Node ID a347b3614baee0326f444b708b5b3738f0c4bea8 # Parent 8ec1a2cfd2c00d5b8ba9fc53da0acddf49deda91 util: don't complain about '..' in path components not working on Windows diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -514,6 +514,7 @@ def checkwinfilename(path): "filename contains '\\\\x07', which is invalid on Windows" >>> checkwinfilename("foo/bar/bla ") "filename ends with ' ', which is not allowed on Windows" + >>> checkwinfilename("../bar") ''' for n in path.replace('\\', '/').split('/'): if not n: @@ -530,7 +531,7 @@ def checkwinfilename(path): return _("filename contains '%s', which is reserved " "on Windows") % base t = n[-1] - if t in '. ': + if t in '. ' and n not in '..': return _("filename ends with '%s', which is not allowed " "on Windows") % t