Changeset View
Changeset View
Standalone View
Standalone View
mercurial/logexchange.py
Show All 9 Lines | |||||
from .node import hex | from .node import hex | ||||
from . import ( | from . import ( | ||||
pycompat, | pycompat, | ||||
util, | util, | ||||
vfs as vfsmod, | vfs as vfsmod, | ||||
) | ) | ||||
from .utils import ( | |||||
urlutil, | |||||
) | |||||
# directory name in .hg/ in which remotenames files will be present | # directory name in .hg/ in which remotenames files will be present | ||||
remotenamedir = b'logexchange' | remotenamedir = b'logexchange' | ||||
def readremotenamefile(repo, filename): | def readremotenamefile(repo, filename): | ||||
""" | """ | ||||
reads a file from .hg/logexchange/ directory and yields it's content | reads a file from .hg/logexchange/ directory and yields it's content | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | def activepath(repo, remote): | ||||
if local: | if local: | ||||
rpath = util.pconvert(remote._repo.root) | rpath = util.pconvert(remote._repo.root) | ||||
elif not isinstance(remote, bytes): | elif not isinstance(remote, bytes): | ||||
rpath = remote._url | rpath = remote._url | ||||
# represent the remotepath with user defined path name if exists | # represent the remotepath with user defined path name if exists | ||||
for path, url in repo.ui.configitems(b'paths'): | for path, url in repo.ui.configitems(b'paths'): | ||||
# remove auth info from user defined url | # remove auth info from user defined url | ||||
noauthurl = util.removeauth(url) | noauthurl = urlutil.removeauth(url) | ||||
# Standardize on unix style paths, otherwise some {remotenames} end up | # Standardize on unix style paths, otherwise some {remotenames} end up | ||||
# being an absolute path on Windows. | # being an absolute path on Windows. | ||||
url = util.pconvert(bytes(url)) | url = util.pconvert(bytes(url)) | ||||
noauthurl = util.pconvert(noauthurl) | noauthurl = util.pconvert(noauthurl) | ||||
if url == rpath or noauthurl == rpath: | if url == rpath or noauthurl == rpath: | ||||
rpath = path | rpath = path | ||||
break | break | ||||
Show All 38 Lines |