Mercurial > hg
comparison mercurial/bundlerepo.py @ 46907:ffd3e823a7e5
urlutil: extract `url` related code from `util` into the new module
The new module is well fitting for this new code. And this will be useful to
make the gathered code collaborate more later.
Differential Revision: https://phab.mercurial-scm.org/D10374
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 12 Apr 2021 03:01:04 +0200 |
parents | 6266d19556ad |
children | d55b71393907 |
comparison
equal
deleted
inserted
replaced
46906:33524c46a092 | 46907:ffd3e823a7e5 |
---|---|
40 phases, | 40 phases, |
41 pycompat, | 41 pycompat, |
42 revlog, | 42 revlog, |
43 util, | 43 util, |
44 vfs as vfsmod, | 44 vfs as vfsmod, |
45 ) | |
46 from .utils import ( | |
47 urlutil, | |
45 ) | 48 ) |
46 | 49 |
47 | 50 |
48 class bundlerevlog(revlog.revlog): | 51 class bundlerevlog(revlog.revlog): |
49 def __init__(self, opener, indexfile, cgunpacker, linkmapper): | 52 def __init__(self, opener, indexfile, cgunpacker, linkmapper): |
473 parentpath = b'' | 476 parentpath = b'' |
474 else: | 477 else: |
475 cwd = pathutil.normasprefix(cwd) | 478 cwd = pathutil.normasprefix(cwd) |
476 if parentpath.startswith(cwd): | 479 if parentpath.startswith(cwd): |
477 parentpath = parentpath[len(cwd) :] | 480 parentpath = parentpath[len(cwd) :] |
478 u = util.url(path) | 481 u = urlutil.url(path) |
479 path = u.localpath() | 482 path = u.localpath() |
480 if u.scheme == b'bundle': | 483 if u.scheme == b'bundle': |
481 s = path.split(b"+", 1) | 484 s = path.split(b"+", 1) |
482 if len(s) == 1: | 485 if len(s) == 1: |
483 repopath, bundlename = parentpath, s[0] | 486 repopath, bundlename = parentpath, s[0] |