Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: modules/hgweb/files/hgweb.fcgi

Issue 29323409: Issue 2867 - Introduce module hgweb and corresponding server role (Closed)
Left Patch Set: Created Aug. 10, 2015, 8:15 a.m.
Right Patch Set: Issue 2867 - Now the complete patch-set again Created Aug. 17, 2015, 6:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « modules/hgweb/files/hgaccess/users/vagrant ('k') | modules/hgweb/files/hgweb.ini » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # An example CGI script to export multiple hgweb repos, edit as necessary 3 # An example CGI script to export multiple hgweb repos, edit as necessary
4 4
5 import re 5 import re
6 6
7 # adjust python path if not a system-wide install: 7 # adjust python path if not a system-wide install:
8 #import sys 8 #import sys
9 #sys.path.insert(0, "/path/to/python/lib") 9 #sys.path.insert(0, "/path/to/python/lib")
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 # 46 #
47 # [paths] 47 # [paths]
48 # virtual/path1 = /real/path1 48 # virtual/path1 = /real/path1
49 # virtual/path2 = /real/path2 49 # virtual/path2 = /real/path2
50 # virtual/root = /real/root/* 50 # virtual/root = /real/root/*
51 # / = /real/root2/* 51 # / = /real/root2/*
52 # 52 #
53 # [collections] 53 # [collections]
54 # /prefix/to/strip/off = /root/of/tree/full/of/repos 54 # /prefix/to/strip/off = /root/of/tree/full/of/repos
55 # 55 #
56 # paths example: 56 # paths example:
57 # 57 #
58 # * First two lines mount one repository into one virtual path, like 58 # * First two lines mount one repository into one virtual path, like
59 # '/real/path1' into 'virtual/path1'. 59 # '/real/path1' into 'virtual/path1'.
60 # 60 #
61 # * The third entry tells every mercurial repository found in 61 # * The third entry tells every mercurial repository found in
62 # '/real/root', recursively, should be mounted in 'virtual/root'. This 62 # '/real/root', recursively, should be mounted in 'virtual/root'. This
63 # format is preferred over the [collections] one, using absolute paths 63 # format is preferred over the [collections] one, using absolute paths
64 # as configuration keys is not supported on every platform (including 64 # as configuration keys is not supported on every platform (including
65 # Windows). 65 # Windows).
66 # 66 #
(...skipping 19 matching lines...) Expand all
86 else: 86 else:
87 return result 87 return result
88 88
89 def do_filter(self, iter, req): 89 def do_filter(self, iter, req):
90 for chunk in iter: 90 for chunk in iter:
91 yield re.sub(r'\bemail=.*?([\r\n]|$)', r'email=xxxx\1', chunk) 91 yield re.sub(r'\bemail=.*?([\r\n]|$)', r'email=xxxx\1', chunk)
92 if hasattr(iter, 'close'): 92 if hasattr(iter, 'close'):
93 iter.close() 93 iter.close()
94 94
95 WSGIServer(hgwebdir_with_filter('/etc/hgweb.ini'), debug=False).run() 95 WSGIServer(hgwebdir_with_filter('/etc/hgweb.ini'), debug=False).run()
LEFTRIGHT

Powered by Google App Engine
This is Rietveld