equal
deleted
inserted
replaced
9 import os |
9 import os |
10 import os.path |
10 import os.path |
11 import mimetypes |
11 import mimetypes |
12 from mercurial.demandload import demandload |
12 from mercurial.demandload import demandload |
13 demandload(globals(), "re zlib ConfigParser mimetools cStringIO sys tempfile") |
13 demandload(globals(), "re zlib ConfigParser mimetools cStringIO sys tempfile") |
14 demandload(globals(), "mercurial:mdiff,ui,hg,util,archival,templater") |
14 demandload(globals(), "mercurial:mdiff,ui,hg,util,archival,streamclone") |
|
15 demandload(globals(), "mercurial:templater") |
15 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile") |
16 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile") |
16 from mercurial.node import * |
17 from mercurial.node import * |
17 from mercurial.i18n import gettext as _ |
18 from mercurial.i18n import gettext as _ |
18 |
19 |
19 def _up(p): |
20 def _up(p): |
857 "static")) |
858 "static")) |
858 req.write(staticfile(static, fname, req) |
859 req.write(staticfile(static, fname, req) |
859 or self.t("error", error="%r not found" % fname)) |
860 or self.t("error", error="%r not found" % fname)) |
860 |
861 |
861 def do_capabilities(self, req): |
862 def do_capabilities(self, req): |
862 resp = 'unbundle' |
863 resp = 'unbundle stream=%d' % (self.repo.revlogversion,) |
863 req.httphdr("application/mercurial-0.1", length=len(resp)) |
864 req.httphdr("application/mercurial-0.1", length=len(resp)) |
864 req.write(resp) |
865 req.write(resp) |
865 |
866 |
866 def check_perm(self, req, op, default): |
867 def check_perm(self, req, op, default): |
867 '''check permission for operation based on user auth. |
868 '''check permission for operation based on user auth. |
948 finally: |
949 finally: |
949 lock.release() |
950 lock.release() |
950 finally: |
951 finally: |
951 fp.close() |
952 fp.close() |
952 os.unlink(tempname) |
953 os.unlink(tempname) |
|
954 |
|
955 def do_stream_out(self, req): |
|
956 req.httphdr("application/mercurial-0.1") |
|
957 streamclone.stream_out(self.repo, req) |