diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-09-08 01:55:46 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-09-08 01:55:46 +0200 |
commit | aead11533ec4d17f4382b1e10f850042391bccb2 (patch) | |
tree | 0286d01ca66961450ab07dbbd74e0b92f7d3f431 | |
parent | 72c1608409b2c2e56d7f35700f87182c0a7e018d (diff) | |
download | plan9front-aead11533ec4d17f4382b1e10f850042391bccb2.tar.xz |
support file:// urls in hgwebfs extension as apparently hg uses them. m(
-rw-r--r-- | sys/lib/python/hgext/hgwebfs.py | 9 |
1 files changed, 8 insertions, 1 deletions
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) |