equal
deleted
inserted
replaced
12 """ |
12 """ |
13 |
13 |
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 |
17 import changegroup, util, mdiff, discovery, cmdutil |
18 import localrepo, changelog, manifest, filelog, revlog, error |
18 import localrepo, changelog, manifest, filelog, revlog, error |
19 |
19 |
20 class bundlerevlog(revlog.revlog): |
20 class bundlerevlog(revlog.revlog): |
21 def __init__(self, opener, indexfile, bundle, linkmapper): |
21 def __init__(self, opener, indexfile, bundle, linkmapper): |
22 # How it works: |
22 # How it works: |
272 |
272 |
273 def instance(ui, path, create): |
273 def instance(ui, path, create): |
274 if create: |
274 if create: |
275 raise util.Abort(_('cannot create new bundle repository')) |
275 raise util.Abort(_('cannot create new bundle repository')) |
276 parentpath = ui.config("bundle", "mainreporoot", "") |
276 parentpath = ui.config("bundle", "mainreporoot", "") |
|
277 if not parentpath: |
|
278 # try to find the correct path to the working directory repo |
|
279 parentpath = cmdutil.findrepo(os.getcwd()) |
|
280 if parentpath is None: |
|
281 parentpath = '' |
277 if parentpath: |
282 if parentpath: |
278 # Try to make the full path relative so we get a nice, short URL. |
283 # Try to make the full path relative so we get a nice, short URL. |
279 # In particular, we don't want temp dir names in test outputs. |
284 # In particular, we don't want temp dir names in test outputs. |
280 cwd = os.getcwd() |
285 cwd = os.getcwd() |
281 if parentpath == cwd: |
286 if parentpath == cwd: |