Mercurial > hg-stable
diff hgext/convert/subversion.py @ 34645:75979c8d4572
codemod: use pycompat.iswindows
This is done by:
sed -i "s/pycompat\.osname == 'nt'/pycompat.iswindows/" **/*.py
sed -i "s/pycompat\.osname != 'nt'/not pycompat.iswindows/" **/*.py
sed -i 's/pycompat.osname == "nt"/pycompat.iswindows/' **/*.py
Differential Revision: https://phab.mercurial-scm.org/D1034
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 12 Oct 2017 23:30:46 -0700 |
parents | 0cfa7d9b889c |
children | effae88bccdb |
line wrap: on
line diff
--- a/hgext/convert/subversion.py Thu Oct 12 19:20:04 2017 -0700 +++ b/hgext/convert/subversion.py Thu Oct 12 23:30:46 2017 -0700 @@ -103,7 +103,7 @@ pass if os.path.isdir(path): path = os.path.normpath(os.path.abspath(path)) - if pycompat.osname == 'nt': + if pycompat.iswindows: path = '/' + util.normpath(path) # Module URL is later compared with the repository URL returned # by svn API, which is UTF-8. @@ -254,7 +254,7 @@ try: proto, path = url.split('://', 1) if proto == 'file': - if (pycompat.osname == 'nt' and path[:1] == '/' + if (pycompat.iswindows and path[:1] == '/' and path[1:2].isalpha() and path[2:6].lower() == '%3a/'): path = path[:2] + ':/' + path[6:] path = urlreq.url2pathname(path)