14 from node import nullid |
14 from node import nullid |
15 from i18n import _ |
15 from i18n import _ |
16 import os, tempfile, shutil |
16 import os, tempfile, shutil |
17 import changegroup, util, mdiff, discovery, cmdutil, scmutil, exchange |
17 import changegroup, util, mdiff, discovery, cmdutil, scmutil, exchange |
18 import localrepo, changelog, manifest, filelog, revlog, error, phases, bundle2 |
18 import localrepo, changelog, manifest, filelog, revlog, error, phases, bundle2 |
|
19 import pathutil |
19 |
20 |
20 class bundlerevlog(revlog.revlog): |
21 class bundlerevlog(revlog.revlog): |
21 def __init__(self, opener, indexfile, bundle, linkmapper): |
22 def __init__(self, opener, indexfile, bundle, linkmapper): |
22 # How it works: |
23 # How it works: |
23 # To retrieve a revision, we need to know the offset of the revision in |
24 # To retrieve a revision, we need to know the offset of the revision in |
350 # In particular, we don't want temp dir names in test outputs. |
351 # In particular, we don't want temp dir names in test outputs. |
351 cwd = os.getcwd() |
352 cwd = os.getcwd() |
352 if parentpath == cwd: |
353 if parentpath == cwd: |
353 parentpath = '' |
354 parentpath = '' |
354 else: |
355 else: |
355 cwd = os.path.join(cwd,'') |
356 cwd = pathutil.normasprefix(cwd) |
356 if parentpath.startswith(cwd): |
357 if parentpath.startswith(cwd): |
357 parentpath = parentpath[len(cwd):] |
358 parentpath = parentpath[len(cwd):] |
358 u = util.url(path) |
359 u = util.url(path) |
359 path = u.localpath() |
360 path = u.localpath() |
360 if u.scheme == 'bundle': |
361 if u.scheme == 'bundle': |