Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 1101:2cf5c8a4eae5
Separate out old-http support
- create new statichttprepo class
- pull remote bits out of localrepo
- pull remote bits out of util.opener
- switch hg.repository to use statichttprepo
author | mpm@selenic.com |
---|---|
date | Sat, 27 Aug 2005 16:28:53 -0700 |
parents | 221b5252864c |
children | c81d264cd17d |
comparison
equal
deleted
inserted
replaced
1100:d6b6a15cc7c6 | 1101:2cf5c8a4eae5 |
---|---|
7 | 7 |
8 import util | 8 import util |
9 from node import * | 9 from node import * |
10 from repo import * | 10 from repo import * |
11 from demandload import * | 11 from demandload import * |
12 demandload(globals(), "localrepo httprepo sshrepo") | 12 demandload(globals(), "localrepo httprepo sshrepo statichttprepo") |
13 | 13 |
14 def repository(ui, path=None, create=0): | 14 def repository(ui, path=None, create=0): |
15 if path: | 15 if path: |
16 if path.startswith("http://"): | 16 if path.startswith("http://"): |
17 return httprepo.httprepository(ui, path) | 17 return httprepo.httprepository(ui, path) |
19 return httprepo.httpsrepository(ui, path) | 19 return httprepo.httpsrepository(ui, path) |
20 if path.startswith("hg://"): | 20 if path.startswith("hg://"): |
21 return httprepo.httprepository( | 21 return httprepo.httprepository( |
22 ui, path.replace("hg://", "http://")) | 22 ui, path.replace("hg://", "http://")) |
23 if path.startswith("old-http://"): | 23 if path.startswith("old-http://"): |
24 return localrepo.localrepository( | 24 return statichttprepo.statichttprepository( |
25 ui, util.opener, path.replace("old-http://", "http://")) | 25 ui, path.replace("old-http://", "http://")) |
26 if path.startswith("ssh://"): | 26 if path.startswith("ssh://"): |
27 return sshrepo.sshrepository(ui, path) | 27 return sshrepo.sshrepository(ui, path) |
28 | 28 |
29 return localrepo.localrepository(ui, util.opener, path, create) | 29 return localrepo.localrepository(ui, util.opener, path, create) |