comparison mercurial/subrepo.py @ 35585:35fb3367f72d

py3: use pycompat.bytestr() instead of str() Differential Revision: https://phab.mercurial-scm.org/D1795
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 29 Dec 2017 05:29:04 +0530
parents 72b91f905065
children f2f0a777b2e2
comparison
equal deleted inserted replaced
35584:6f62a1c3e11d 35585:35fb3367f72d
387 """return pull/push path of repo - either based on parent repo .hgsub info 387 """return pull/push path of repo - either based on parent repo .hgsub info
388 or on the top repo config. Abort or return None if no source found.""" 388 or on the top repo config. Abort or return None if no source found."""
389 if util.safehasattr(repo, '_subparent'): 389 if util.safehasattr(repo, '_subparent'):
390 source = util.url(repo._subsource) 390 source = util.url(repo._subsource)
391 if source.isabs(): 391 if source.isabs():
392 return str(source) 392 return pycompat.bytestr(source)
393 source.path = posixpath.normpath(source.path) 393 source.path = posixpath.normpath(source.path)
394 parent = _abssource(repo._subparent, push, abort=False) 394 parent = _abssource(repo._subparent, push, abort=False)
395 if parent: 395 if parent:
396 parent = util.url(util.pconvert(parent)) 396 parent = util.url(util.pconvert(parent))
397 parent.path = posixpath.join(parent.path or '', source.path) 397 parent.path = posixpath.join(parent.path or '', source.path)
398 parent.path = posixpath.normpath(parent.path) 398 parent.path = posixpath.normpath(parent.path)
399 return str(parent) 399 return pycompat.bytestr(parent)
400 else: # recursion reached top repo 400 else: # recursion reached top repo
401 if util.safehasattr(repo, '_subtoppath'): 401 if util.safehasattr(repo, '_subtoppath'):
402 return repo._subtoppath 402 return repo._subtoppath
403 if push and repo.ui.config('paths', 'default-push'): 403 if push and repo.ui.config('paths', 'default-push'):
404 return repo.ui.config('paths', 'default-push') 404 return repo.ui.config('paths', 'default-push')