From aead11533ec4d17f4382b1e10f850042391bccb2 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 8 Sep 2012 01:55:46 +0200 Subject: support file:// urls in hgwebfs extension as apparently hg uses them. m( --- sys/lib/python/hgext/hgwebfs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/lib/python/hgext/hgwebfs.py b/sys/lib/python/hgext/hgwebfs.py index ff54ff036..e8eb03cba 100644 --- a/sys/lib/python/hgext/hgwebfs.py +++ b/sys/lib/python/hgext/hgwebfs.py @@ -5,9 +5,16 @@ import re class Webconn: def __init__(self, mnt, req): + if type(req) == str: + self.url = req + else: + self.url = req.get_full_url() + if self.url[0:5] == 'file:': + self.dir = '/dev/null' + self.body = open(self.url[5:], 'r', 0) + return ctl = open(mnt+'/clone', 'r+', 0) try: - self.url = req.get_full_url() self.dir = mnt+'/'+ctl.readline().rstrip('\n') ctl.seek(0) ctl.write('url '+self.url) -- cgit v1.2.3