##// END OF EJS Templates
hgweb: remove support for short query string based aliases (BC)...
Gregory Szorc -
r36875:422be995 default
parent child Browse files
Show More
@@ -27,37 +27,6 b' from .. import ('
27 util,
27 util,
28 )
28 )
29
29
30 shortcuts = {
31 'cl': [('cmd', ['changelog']), ('rev', None)],
32 'sl': [('cmd', ['shortlog']), ('rev', None)],
33 'cs': [('cmd', ['changeset']), ('node', None)],
34 'f': [('cmd', ['file']), ('filenode', None)],
35 'fl': [('cmd', ['filelog']), ('filenode', None)],
36 'fd': [('cmd', ['filediff']), ('node', None)],
37 'fa': [('cmd', ['annotate']), ('filenode', None)],
38 'mf': [('cmd', ['manifest']), ('manifest', None)],
39 'ca': [('cmd', ['archive']), ('node', None)],
40 'tags': [('cmd', ['tags'])],
41 'tip': [('cmd', ['changeset']), ('node', ['tip'])],
42 'static': [('cmd', ['static']), ('file', None)]
43 }
44
45 def normalize(form):
46 # first expand the shortcuts
47 for k in shortcuts:
48 if k in form:
49 for name, value in shortcuts[k]:
50 if value is None:
51 value = form[k]
52 form[name] = value
53 del form[k]
54 # And strip the values
55 bytesform = {}
56 for k, v in form.iteritems():
57 bytesform[pycompat.bytesurl(k)] = [
58 pycompat.bytesurl(i.strip()) for i in v]
59 return bytesform
60
61 @attr.s(frozen=True)
30 @attr.s(frozen=True)
62 class parsedrequest(object):
31 class parsedrequest(object):
63 """Represents a parsed WSGI request.
32 """Represents a parsed WSGI request.
@@ -258,7 +227,7 b' class wsgirequest(object):'
258 self.run_once = wsgienv[r'wsgi.run_once']
227 self.run_once = wsgienv[r'wsgi.run_once']
259 self.env = wsgienv
228 self.env = wsgienv
260 self.req = parserequestfromenv(wsgienv, inp)
229 self.req = parserequestfromenv(wsgienv, inp)
261 self.form = normalize(self.req.querystringdict)
230 self.form = self.req.querystringdict
262 self._start_response = start_response
231 self._start_response = start_response
263 self.server_write = None
232 self.server_write = None
264 self.headers = []
233 self.headers = []
@@ -17,7 +17,7 b' Test raw style of hgweb'
17 $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
17 $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
18
18
19 $ cat hg.pid >> $DAEMON_PIDS
19 $ cat hg.pid >> $DAEMON_PIDS
20 $ (get-with-headers.py localhost:$HGPORT '?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
20 $ (get-with-headers.py localhost:$HGPORT 'raw-file/bf0ff59095c9/sub/some%20text%25.txt' content-type content-length content-disposition) >getoutput.txt
21
21
22 $ killdaemons.py hg.pid
22 $ killdaemons.py hg.pid
23
23
@@ -32,14 +32,14 b' Test raw style of hgweb'
32 It is very boring to read, but computers don't
32 It is very boring to read, but computers don't
33 care about things like that.
33 care about things like that.
34 $ cat access.log error.log
34 $ cat access.log error.log
35 $LOCALIP - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
35 $LOCALIP - - [$LOGDATE$] "GET /raw-file/bf0ff59095c9/sub/some%20text%25.txt HTTP/1.1" 200 - (glob)
36
36
37 $ rm access.log error.log
37 $ rm access.log error.log
38 $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid \
38 $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid \
39 > --config web.guessmime=True
39 > --config web.guessmime=True
40
40
41 $ cat hg.pid >> $DAEMON_PIDS
41 $ cat hg.pid >> $DAEMON_PIDS
42 $ (get-with-headers.py localhost:$HGPORT '?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
42 $ (get-with-headers.py localhost:$HGPORT 'raw-file/bf0ff59095c9/sub/some%20text%25.txt' content-type content-length content-disposition) >getoutput.txt
43 $ killdaemons.py hg.pid
43 $ killdaemons.py hg.pid
44
44
45 $ cat getoutput.txt
45 $ cat getoutput.txt
@@ -53,6 +53,6 b' Test raw style of hgweb'
53 It is very boring to read, but computers don't
53 It is very boring to read, but computers don't
54 care about things like that.
54 care about things like that.
55 $ cat access.log error.log
55 $ cat access.log error.log
56 $LOCALIP - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
56 $LOCALIP - - [$LOGDATE$] "GET /raw-file/bf0ff59095c9/sub/some%20text%25.txt HTTP/1.1" 200 - (glob)
57
57
58 $ cd ..
58 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now