Changeset View
Changeset View
Standalone View
Standalone View
mercurial/bundlerepo.py
Show All 37 Lines | from . import ( | ||||
mdiff, | mdiff, | ||||
pathutil, | pathutil, | ||||
phases, | phases, | ||||
pycompat, | pycompat, | ||||
revlog, | revlog, | ||||
util, | util, | ||||
vfs as vfsmod, | vfs as vfsmod, | ||||
) | ) | ||||
from .utils import ( | |||||
urlutil, | |||||
) | |||||
class bundlerevlog(revlog.revlog): | class bundlerevlog(revlog.revlog): | ||||
def __init__(self, opener, indexfile, cgunpacker, linkmapper): | def __init__(self, opener, indexfile, cgunpacker, linkmapper): | ||||
# How it works: | # How it works: | ||||
# To retrieve a revision, we need to know the offset of the revision in | # To retrieve a revision, we need to know the offset of the revision in | ||||
# the bundle (an unbundle object). We store this offset in the index | # the bundle (an unbundle object). We store this offset in the index | ||||
# (start). The base of the delta is stored in the base field. | # (start). The base of the delta is stored in the base field. | ||||
▲ Show 20 Lines • Show All 416 Lines • ▼ Show 20 Line(s) | if parentpath: | ||||
# In particular, we don't want temp dir names in test outputs. | # In particular, we don't want temp dir names in test outputs. | ||||
cwd = encoding.getcwd() | cwd = encoding.getcwd() | ||||
if parentpath == cwd: | if parentpath == cwd: | ||||
parentpath = b'' | parentpath = b'' | ||||
else: | else: | ||||
cwd = pathutil.normasprefix(cwd) | cwd = pathutil.normasprefix(cwd) | ||||
if parentpath.startswith(cwd): | if parentpath.startswith(cwd): | ||||
parentpath = parentpath[len(cwd) :] | parentpath = parentpath[len(cwd) :] | ||||
u = util.url(path) | u = urlutil.url(path) | ||||
path = u.localpath() | path = u.localpath() | ||||
if u.scheme == b'bundle': | if u.scheme == b'bundle': | ||||
s = path.split(b"+", 1) | s = path.split(b"+", 1) | ||||
if len(s) == 1: | if len(s) == 1: | ||||
repopath, bundlename = parentpath, s[0] | repopath, bundlename = parentpath, s[0] | ||||
else: | else: | ||||
repopath, bundlename = s | repopath, bundlename = s | ||||
else: | else: | ||||
▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines |