equal
deleted
inserted
replaced
8 |
8 |
9 from node import * |
9 from node import * |
10 from repo import * |
10 from repo import * |
11 from i18n import _ |
11 from i18n import _ |
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo |
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo |
13 import errno, lock, os, shutil, util, cmdutil |
13 import errno, lock, os, shutil, util, cmdutil, extensions |
14 import merge as _merge |
14 import merge as _merge |
15 import verify as _verify |
15 import verify as _verify |
16 |
16 |
17 def _local(path): |
17 def _local(path): |
18 return (os.path.isfile(util.drop_scheme('file', path)) and |
18 return (os.path.isfile(util.drop_scheme('file', path)) and |
48 return _lookup(repo).islocal(repo) |
48 return _lookup(repo).islocal(repo) |
49 except AttributeError: |
49 except AttributeError: |
50 return False |
50 return False |
51 return repo.local() |
51 return repo.local() |
52 |
52 |
53 repo_setup_hooks = [] |
|
54 |
|
55 def repository(ui, path='', create=False): |
53 def repository(ui, path='', create=False): |
56 """return a repository object for the specified path""" |
54 """return a repository object for the specified path""" |
57 repo = _lookup(path).instance(ui, path, create) |
55 repo = _lookup(path).instance(ui, path, create) |
58 ui = getattr(repo, "ui", ui) |
56 ui = getattr(repo, "ui", ui) |
59 for hook in repo_setup_hooks: |
57 for hook in extensions.setuphooks: |
60 hook(ui, repo) |
58 hook(ui, repo) |
61 return repo |
59 return repo |
62 |
60 |
63 def defaultdest(source): |
61 def defaultdest(source): |
64 '''return default destination of clone if none is given''' |
62 '''return default destination of clone if none is given''' |