Follow up for D1795.
Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHG991f0be9dc39: py3: use bytes instead of pycompat.bytestr
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| yuja |
| hg-reviewers |
Follow up for D1795.
| Lint Skipped |
| Unit Tests Skipped |
| return sub._relpath | return sub._relpath | ||||
| def _abssource(repo, push=False, abort=True): | def _abssource(repo, push=False, abort=True): | ||||
| """return pull/push path of repo - either based on parent repo .hgsub info | """return pull/push path of repo - either based on parent repo .hgsub info | ||||
| or on the top repo config. Abort or return None if no source found.""" | or on the top repo config. Abort or return None if no source found.""" | ||||
| if util.safehasattr(repo, '_subparent'): | if util.safehasattr(repo, '_subparent'): | ||||
| source = util.url(repo._subsource) | source = util.url(repo._subsource) | ||||
| if source.isabs(): | if source.isabs(): | ||||
| return pycompat.bytestr(source) | return bytes(source) | ||||
| source.path = posixpath.normpath(source.path) | source.path = posixpath.normpath(source.path) | ||||
| parent = _abssource(repo._subparent, push, abort=False) | parent = _abssource(repo._subparent, push, abort=False) | ||||
| if parent: | if parent: | ||||
| parent = util.url(util.pconvert(parent)) | parent = util.url(util.pconvert(parent)) | ||||
| parent.path = posixpath.join(parent.path or '', source.path) | parent.path = posixpath.join(parent.path or '', source.path) | ||||
| parent.path = posixpath.normpath(parent.path) | parent.path = posixpath.normpath(parent.path) | ||||
| return pycompat.bytestr(parent) | return bytes(parent) | ||||
| else: # recursion reached top repo | else: # recursion reached top repo | ||||
| if util.safehasattr(repo, '_subtoppath'): | if util.safehasattr(repo, '_subtoppath'): | ||||
| return repo._subtoppath | return repo._subtoppath | ||||
| if push and repo.ui.config('paths', 'default-push'): | if push and repo.ui.config('paths', 'default-push'): | ||||
| return repo.ui.config('paths', 'default-push') | return repo.ui.config('paths', 'default-push') | ||||
| if repo.ui.config('paths', 'default'): | if repo.ui.config('paths', 'default'): | ||||
| return repo.ui.config('paths', 'default') | return repo.ui.config('paths', 'default') | ||||
| if repo.shared(): | if repo.shared(): | ||||