hgwebfs: make push work

This commit is contained in:
cinap_lenrek 2012-03-16 17:47:36 +01:00
parent e86a1f3fbe
commit 9c71514b71

View file

@ -11,17 +11,14 @@ class Webconn:
self.dir = mnt+'/'+ctl.readline().rstrip('\n') self.dir = mnt+'/'+ctl.readline().rstrip('\n')
ctl.seek(0) ctl.seek(0)
ctl.write('url '+self.url) ctl.write('url '+self.url)
m = '' m = 'User-Agent: mercurial/proto-1.0\r\n';
for h in req.headers: for h in req.headers:
m += h+': '+req.headers[h]+'\r\n' m += h+': '+req.headers[h]+'\r\n'
if len(m) > 0: ctl.seek(0)
m = 'headers '+m ctl.write('headers '+m)
print m
ctl.seek(0)
ctl.write(m)
if req.has_data(): if req.has_data():
data = req.get_data() data = req.get_data()
post = open(self.dir+'/postdata', 'w', 0); post = open(self.dir+'/postbody', 'w', 0);
try: try:
while True: while True:
buf = data.read(4096) buf = data.read(4096)