##// END OF EJS Templates
Autodetect static-http
Matt Mackall -
r7211:25c0dee1 default
parent child Browse files
Show More
@@ -30,10 +30,7 b' revision::'
30
30
31 repository path::
31 repository path::
32 either the pathname of a local repository or the URI of a remote
32 either the pathname of a local repository or the URI of a remote
33 repository. There are two available URI protocols, http:// which is
33 repository.
34 fast and the static-http:// protocol which is much slower but does not
35 require a special server on the web host.
36
37
34
38 include::hg.1.gendoc.txt[]
35 include::hg.1.gendoc.txt[]
39
36
@@ -2071,13 +2071,10 b' def pull(ui, repo, source="default", **o'
2071 http://[user[:pass]@]host[:port]/[path]
2071 http://[user[:pass]@]host[:port]/[path]
2072 https://[user[:pass]@]host[:port]/[path]
2072 https://[user[:pass]@]host[:port]/[path]
2073 ssh://[user[:pass]@]host[:port]/[path]
2073 ssh://[user[:pass]@]host[:port]/[path]
2074 static-http://host[:port]/[path]
2075
2074
2076 Paths in the local filesystem can either point to Mercurial
2075 Paths in the local filesystem can either point to Mercurial
2077 repositories or to bundle files (as created by 'hg bundle' or
2076 repositories or to bundle files (as created by 'hg bundle' or
2078 'hg incoming --bundle'). The static-http:// protocol, albeit slow,
2077 'hg incoming --bundle').
2079 allows access to a Mercurial repository where you simply use a web
2080 server to publish the .hg directory as static content.
2081
2078
2082 An optional identifier after # indicates a particular branch, tag,
2079 An optional identifier after # indicates a particular branch, tag,
2083 or changeset to pull.
2080 or changeset to pull.
@@ -6,10 +6,10 b''
6 # This software may be used and distributed according to the terms
6 # This software may be used and distributed according to the terms
7 # of the GNU General Public License, incorporated herein by reference.
7 # of the GNU General Public License, incorporated herein by reference.
8
8
9 from node import bin, hex
9 from node import bin, hex, nullid
10 from i18n import _
10 from i18n import _
11 import repo, os, urllib, urllib2, urlparse, zlib, util, httplib
11 import repo, os, urllib, urllib2, urlparse, zlib, util, httplib
12 import errno, keepalive, socket, changegroup
12 import errno, keepalive, socket, changegroup, statichttprepo
13
13
14 class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm):
14 class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm):
15 def __init__(self, ui):
15 def __init__(self, ui):
@@ -455,6 +455,13 b' class httpsrepository(httprepository):'
455 def instance(ui, path, create):
455 def instance(ui, path, create):
456 if create:
456 if create:
457 raise util.Abort(_('cannot create new http repository'))
457 raise util.Abort(_('cannot create new http repository'))
458 if path.startswith('https:'):
458 try:
459 return httpsrepository(ui, path)
459 if path.startswith('https:'):
460 return httprepository(ui, path)
460 inst = httpsrepository(ui, path)
461 else:
462 inst = httprepository(ui, path)
463 inst.between([(nullid, nullid)])
464 return inst
465 except repo.RepoError:
466 ui.note('(falling back to static-http)\n')
467 return statichttprepo.instance(ui, "static-" + path, create)
@@ -76,7 +76,7 b' class statichttprepository(localrepo.loc'
76 self.decodepats = None
76 self.decodepats = None
77
77
78 def url(self):
78 def url(self):
79 return 'static-' + self._url
79 return self._url
80
80
81 def local(self):
81 def local(self):
82 return False
82 return False
@@ -2,7 +2,7 b''
2
2
3 cp "$TESTDIR"/printenv.py .
3 cp "$TESTDIR"/printenv.py .
4
4
5 http_proxy= hg clone static-http://localhost:$HGPORT/ copy
5 http_proxy= hg clone http://localhost:$HGPORT/ copy
6 echo $?
6 echo $?
7 test -d copy || echo copy: No such file or directory
7 test -d copy || echo copy: No such file or directory
8
8
@@ -1,4 +1,4 b''
1 abort: Connection refused
1 abort: error: Connection refused
2 255
2 255
3 copy: No such file or directory
3 copy: No such file or directory
4 changeset: 0:53e17d176ae6
4 changeset: 0:53e17d176ae6
@@ -21,7 +21,7 b' checking files'
21 1 files, 1 changesets, 1 total revisions
21 1 files, 1 changesets, 1 total revisions
22 foo
22 foo
23 adding quux
23 adding quux
24 changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=static-http://localhost/remote
24 changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=http://localhost/remote
25 pulling from static-http://localhost/remote
25 pulling from static-http://localhost/remote
26 searching for changes
26 searching for changes
27 adding changesets
27 adding changesets
General Comments 0
You need to be logged in to leave comments. Login now