(link_includes): use sticky parameters for a link.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@171 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/tags/V0_7
parent
262f3569c7
commit
945cb91e38
10
lib/blame.py
10
lib/blame.py
|
@ -427,7 +427,7 @@ class CVSParser(rcsparse.Sink):
|
||||||
re_includes = re.compile('\\#(\\s*)include(\\s*)"(.*?)"')
|
re_includes = re.compile('\\#(\\s*)include(\\s*)"(.*?)"')
|
||||||
re_filename = re.compile('(.*[\\\\/])?(.+)')
|
re_filename = re.compile('(.*[\\\\/])?(.+)')
|
||||||
|
|
||||||
def link_includes(text, root, rcs_path):
|
def link_includes(text, root, rcs_path, sticky = None):
|
||||||
match = re_includes.match(text)
|
match = re_includes.match(text)
|
||||||
if match:
|
if match:
|
||||||
incfile = match.group(3)
|
incfile = match.group(3)
|
||||||
|
@ -436,9 +436,11 @@ def link_includes(text, root, rcs_path):
|
||||||
file = os.path.join(root, trial_root)
|
file = os.path.join(root, trial_root)
|
||||||
file = os.path.normpath(os.path.join(file, incfile + ',v'))
|
file = os.path.normpath(os.path.join(file, incfile + ',v'))
|
||||||
if os.access(file, os.F_OK):
|
if os.access(file, os.F_OK):
|
||||||
|
url = os.path.join(rel_path, incfile)
|
||||||
|
if sticky:
|
||||||
|
url = url + '?' + sticky
|
||||||
return '#%sinclude%s"<a href="%s">%s</a>"' % \
|
return '#%sinclude%s"<a href="%s">%s</a>"' % \
|
||||||
(match.group(1), match.group(2),
|
(match.group(1), match.group(2), url, incfile)
|
||||||
os.path.join(rel_path, incfile), incfile)
|
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def make_html(root, rcs_path, opt_rev = None, sticky = None):
|
def make_html(root, rcs_path, opt_rev = None, sticky = None):
|
||||||
|
@ -488,7 +490,7 @@ def make_html(root, rcs_path, opt_rev = None, sticky = None):
|
||||||
|
|
||||||
# Add a link to traverse to included files
|
# Add a link to traverse to included files
|
||||||
if 1: # opt_includes
|
if 1: # opt_includes
|
||||||
thisline = link_includes(thisline, root, file_head)
|
thisline = link_includes(thisline, root, file_head, sticky)
|
||||||
|
|
||||||
output = ''
|
output = ''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue