6 # of the GNU General Public License, incorporated herein by reference. |
6 # of the GNU General Public License, incorporated herein by reference. |
7 |
7 |
8 from node import * |
8 from node import * |
9 from repo import * |
9 from repo import * |
10 from demandload import * |
10 from demandload import * |
|
11 from i18n import gettext as _ |
11 demandload(globals(), "localrepo bundlerepo httprepo sshrepo statichttprepo") |
12 demandload(globals(), "localrepo bundlerepo httprepo sshrepo statichttprepo") |
12 |
13 |
13 def repository(ui, path=None, create=0): |
14 def repository(ui, path=None, create=0): |
14 if path: |
15 if path: |
15 if path.startswith("http://"): |
16 if path.startswith("http://"): |
16 return httprepo.httprepository(ui, path) |
17 return httprepo.httprepository(ui, path) |
17 if path.startswith("https://"): |
18 if path.startswith("https://"): |
18 return httprepo.httpsrepository(ui, path) |
19 return httprepo.httpsrepository(ui, path) |
19 if path.startswith("hg://"): |
20 if path.startswith("hg://"): |
|
21 ui.warn(_("hg:// syntax is deprecated, " |
|
22 "please use http:// instead\n")) |
20 return httprepo.httprepository( |
23 return httprepo.httprepository( |
21 ui, path.replace("hg://", "http://")) |
24 ui, path.replace("hg://", "http://")) |
22 if path.startswith("old-http://"): |
25 if path.startswith("old-http://"): |
|
26 ui.warn(_("old-http:// syntax is deprecated, " |
|
27 "please use static-http:// instead\n")) |
23 return statichttprepo.statichttprepository( |
28 return statichttprepo.statichttprepository( |
24 ui, path.replace("old-http://", "http://")) |
29 ui, path.replace("old-http://", "http://")) |
|
30 if path.startswith("static-http://"): |
|
31 return statichttprepo.statichttprepository( |
|
32 ui, path.replace("static-http://", "http://")) |
25 if path.startswith("ssh://"): |
33 if path.startswith("ssh://"): |
26 return sshrepo.sshrepository(ui, path) |
34 return sshrepo.sshrepository(ui, path) |
27 if path.startswith("bundle://"): |
35 if path.startswith("bundle://"): |
28 path = path[9:] |
36 path = path[9:] |
29 s = path.split("+", 1) |
37 s = path.split("+", 1) |