Show More
@@ -1,28 +1,36 b'' | |||
|
1 | 1 | # hg.py - repository classes for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms |
|
6 | 6 | # of the GNU General Public License, incorporated herein by reference. |
|
7 | 7 | |
|
8 | 8 | from node import * |
|
9 | 9 | from repo import * |
|
10 | 10 | from demandload import * |
|
11 | demandload(globals(), "localrepo httprepo sshrepo statichttprepo") | |
|
11 | demandload(globals(), "localrepo bundlerepo httprepo sshrepo statichttprepo") | |
|
12 | 12 | |
|
13 | 13 | def repository(ui, path=None, create=0): |
|
14 | 14 | if path: |
|
15 | 15 | if path.startswith("http://"): |
|
16 | 16 | return httprepo.httprepository(ui, path) |
|
17 | 17 | if path.startswith("https://"): |
|
18 | 18 | return httprepo.httpsrepository(ui, path) |
|
19 | 19 | if path.startswith("hg://"): |
|
20 | 20 | return httprepo.httprepository( |
|
21 | 21 | ui, path.replace("hg://", "http://")) |
|
22 | 22 | if path.startswith("old-http://"): |
|
23 | 23 | return statichttprepo.statichttprepository( |
|
24 | 24 | ui, path.replace("old-http://", "http://")) |
|
25 | 25 | if path.startswith("ssh://"): |
|
26 | 26 | return sshrepo.sshrepository(ui, path) |
|
27 | if path.startswith("bundle://"): | |
|
28 | path = path[9:] | |
|
29 | s = path.split("+", 1) | |
|
30 | if len(s) == 1: | |
|
31 | repopath, bundlename = "", s[0] | |
|
32 | else: | |
|
33 | repopath, bundlename = s | |
|
34 | return bundlerepo.bundlerepository(ui, repopath, bundlename) | |
|
27 | 35 | |
|
28 | 36 | return localrepo.localrepository(ui, path, create) |
General Comments 0
You need to be logged in to leave comments.
Login now