mercurial/hg.py
changeset 48596 f13fb742e1d8
parent 48563 75fc2537d93c
parent 48352 f98d4d0a299a
child 48966 6000f5b25c9b
equal deleted inserted replaced
48595:d1210d56008b 48596:f13fb742e1d8
     8 
     8 
     9 from __future__ import absolute_import
     9 from __future__ import absolute_import
    10 
    10 
    11 import errno
    11 import errno
    12 import os
    12 import os
       
    13 import posixpath
    13 import shutil
    14 import shutil
    14 import stat
    15 import stat
    15 import weakref
    16 import weakref
    16 
    17 
    17 from .i18n import _
    18 from .i18n import _
  1283         subpath = urlutil.url(subpath)
  1284         subpath = urlutil.url(subpath)
  1284         if subpath.isabs():
  1285         if subpath.isabs():
  1285             source = bytes(subpath)
  1286             source = bytes(subpath)
  1286         else:
  1287         else:
  1287             p = urlutil.url(source)
  1288             p = urlutil.url(source)
  1288             p.path = os.path.normpath(b'%s/%s' % (p.path, subpath))
  1289             if p.islocal():
       
  1290                 normpath = os.path.normpath
       
  1291             else:
       
  1292                 normpath = posixpath.normpath
       
  1293             p.path = normpath(b'%s/%s' % (p.path, subpath))
  1289             source = bytes(p)
  1294             source = bytes(p)
  1290     other = peer(repo, opts, source)
  1295     other = peer(repo, opts, source)
  1291     cleanupfn = other.close
  1296     cleanupfn = other.close
  1292     try:
  1297     try:
  1293         ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(source))
  1298         ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(source))
  1354             subpath = urlutil.url(subpath)
  1359             subpath = urlutil.url(subpath)
  1355             if subpath.isabs():
  1360             if subpath.isabs():
  1356                 dest = bytes(subpath)
  1361                 dest = bytes(subpath)
  1357             else:
  1362             else:
  1358                 p = urlutil.url(dest)
  1363                 p = urlutil.url(dest)
  1359                 p.path = os.path.normpath(b'%s/%s' % (p.path, subpath))
  1364                 if p.islocal():
       
  1365                     normpath = os.path.normpath
       
  1366                 else:
       
  1367                     normpath = posixpath.normpath
       
  1368                 p.path = normpath(b'%s/%s' % (p.path, subpath))
  1360                 dest = bytes(p)
  1369                 dest = bytes(p)
  1361         branches = path.branch, opts.get(b'branch') or []
  1370         branches = path.branch, opts.get(b'branch') or []
  1362 
  1371 
  1363         ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest))
  1372         ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest))
  1364         revs, checkout = addbranchrevs(repo, repo, branches, opts.get(b'rev'))
  1373         revs, checkout = addbranchrevs(repo, repo, branches, opts.get(b'rev'))