8 def __init__(self, mnt, req):
17 params = errstr[errstr.index("needkey ")+8:]
18 if params.find("!password?") < 0:
20 if os.spawnl(os.P_WAIT, "/boot/factotum", "getkey", "-g", params) != 0:
26 def open(self, mnt, req):
30 self.url = req.get_full_url()
31 if self.url[0:5] == 'file:':
33 while path[0:2] == '//':
35 self.dir = '/dev/null'
36 self.body = open(path, 'r', 0)
38 ctl = open(mnt+'/clone', 'r+', 0)
40 self.dir = mnt+'/'+ctl.readline().rstrip('\n')
42 ctl.write('url '+self.url)
43 m = 'User-Agent: mercurial/proto-1.0\r\n';
45 m += h+': '+req.headers[h]+'\r\n'
47 ctl.write('headers '+m)
50 post = open(self.dir+'/postbody', 'w', 0);
60 self.body = open(self.dir+'/body', 'r', 0)
64 def read(self, amt=4096):
65 return self.body.read(amt);
75 def getheader(self, key):
76 name = re.sub(r'[^a-z]+', '', key.lower())
78 f = open(self.dir+'/'+name, 'r', 0)
91 def add_handler(self, handler):
94 def open(self, req, data=None):
95 return Webconn('/mnt/web', req)
101 def webopener(ui, authinfo=None):
104 mercurial.url.has_https = 1
105 mercurial.url.opener = webopener