##// END OF EJS Templates
new type of repo: bundle://path/to/repo+/path/to/bundlename...
Benoit Boissinot -
r1945:dec6d3c1 default
parent child Browse files
Show More
@@ -1,28 +1,36 b''
1 # hg.py - repository classes for mercurial
1 # hg.py - repository classes for mercurial
2 #
2 #
3 # Copyright 2005 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
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 demandload(globals(), "localrepo httprepo sshrepo statichttprepo")
11 demandload(globals(), "localrepo bundlerepo httprepo sshrepo statichttprepo")
12
12
13 def repository(ui, path=None, create=0):
13 def repository(ui, path=None, create=0):
14 if path:
14 if path:
15 if path.startswith("http://"):
15 if path.startswith("http://"):
16 return httprepo.httprepository(ui, path)
16 return httprepo.httprepository(ui, path)
17 if path.startswith("https://"):
17 if path.startswith("https://"):
18 return httprepo.httpsrepository(ui, path)
18 return httprepo.httpsrepository(ui, path)
19 if path.startswith("hg://"):
19 if path.startswith("hg://"):
20 return httprepo.httprepository(
20 return httprepo.httprepository(
21 ui, path.replace("hg://", "http://"))
21 ui, path.replace("hg://", "http://"))
22 if path.startswith("old-http://"):
22 if path.startswith("old-http://"):
23 return statichttprepo.statichttprepository(
23 return statichttprepo.statichttprepository(
24 ui, path.replace("old-http://", "http://"))
24 ui, path.replace("old-http://", "http://"))
25 if path.startswith("ssh://"):
25 if path.startswith("ssh://"):
26 return sshrepo.sshrepository(ui, path)
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 return localrepo.localrepository(ui, path, create)
36 return localrepo.localrepository(ui, path, create)
General Comments 0
You need to be logged in to leave comments. Login now