# HG changeset patch # User Thomas Arendsen Hein # Date 1160596884 -7200 # Node ID ce8f31e0b3b826f5c73e601b18fa0ea43688e2d7 # Parent 887da2247b577a02b0128517dc542c3dc6fa383e hgweb: Apply the new method of passing session variables to links. diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -715,25 +715,10 @@ class hgweb(object): if style != self.repo.ui.config('web', 'style', ''): fields.append(('style', style)) + separator = req.url[-1] == '?' and ';' or '?' for name, value in fields: - yield dict(name=name, value=value) - - def queryprefix(**map): - return req.url[-1] == '?' and ';' or '?' - - def getentries(**map): - fields = {} - if req.form.has_key('style'): - style = req.form['style'][0] - if style != self.repo.ui.config('web', 'style', ''): - fields['style'] = style - - if fields: - fields = ['%s=%s' % (k, urllib.quote(v)) - for k, v in fields.iteritems()] - yield '%s%s' % (queryprefix(), ';'.join(fields)) - else: - yield '' + yield dict(name=name, value=value, separator=separator) + separator = ';' self.refresh() @@ -764,9 +749,7 @@ class hgweb(object): "header": header, "footer": footer, "rawfileheader": rawfileheader, - "sessionvars": sessionvars, - "queryprefix": queryprefix, - "getentries": getentries + "sessionvars": sessionvars }) if not req.form.has_key('cmd'): diff --git a/templates/changelog.tmpl b/templates/changelog.tmpl --- a/templates/changelog.tmpl +++ b/templates/changelog.tmpl @@ -6,9 +6,9 @@
-shortlog -tags -manifest +shortlog +tags +manifest #archives%archiveentry# rss
diff --git a/templates/changelogentry.tmpl b/templates/changelogentry.tmpl --- a/templates/changelogentry.tmpl +++ b/templates/changelogentry.tmpl @@ -5,7 +5,7 @@ changeset #rev#: - #node|short# + #node|short# #parent%changelogparent# #child%changelogchild# @@ -19,7 +19,7 @@ #date|date# - files: + files: #files# diff --git a/templates/changeset.tmpl b/templates/changeset.tmpl --- a/templates/changeset.tmpl +++ b/templates/changeset.tmpl @@ -4,10 +4,10 @@
-changelog -shortlog -tags -manifest +changelog +shortlog +tags +manifest raw #archives%archiveentry#
@@ -17,7 +17,7 @@ - + #parent%changesetparent# #child%changesetchild# diff --git a/templates/fileannotate.tmpl b/templates/fileannotate.tmpl --- a/templates/fileannotate.tmpl +++ b/templates/fileannotate.tmpl @@ -4,13 +4,13 @@
-changelog -shortlog -tags -changeset -manifest -file -revisions +changelog +shortlog +tags +changeset +manifest +file +revisions raw
@@ -19,7 +19,7 @@
changeset #rev#:#node|short##node|short#
- + #rename%filerename# #parent%fileannotateparent# #child%fileannotatechild# diff --git a/templates/filediff.tmpl b/templates/filediff.tmpl --- a/templates/filediff.tmpl +++ b/templates/filediff.tmpl @@ -4,13 +4,13 @@
-changelog -shortlog -tags -changeset -file -revisions -annotate +changelog +shortlog +tags +changeset +file +revisions +annotate raw
@@ -19,7 +19,7 @@
changeset #rev#:#node|short#
#node|short#
- + #parent%filediffparent# #child%filediffchild# diff --git a/templates/filelog.tmpl b/templates/filelog.tmpl --- a/templates/filelog.tmpl +++ b/templates/filelog.tmpl @@ -7,11 +7,11 @@
-changelog -shortlog -tags -file -annotate +changelog +shortlog +tags +file +annotate rss
diff --git a/templates/filelogentry.tmpl b/templates/filelogentry.tmpl --- a/templates/filelogentry.tmpl +++ b/templates/filelogentry.tmpl @@ -1,14 +1,14 @@
revision #rev#:#node|short##node|short#
- + #rename%filelogrename# diff --git a/templates/filerevision.tmpl b/templates/filerevision.tmpl --- a/templates/filerevision.tmpl +++ b/templates/filerevision.tmpl @@ -4,13 +4,13 @@
-changelog -shortlog -tags -changeset -manifest -revisions -annotate +changelog +shortlog +tags +changeset +manifest +revisions +annotate raw
@@ -19,7 +19,7 @@
#date|age# ago:#desc|strip|firstline|escape##desc|strip|firstline|escape#
revision #filerev#: - #node|short# - (diff) - (annotate) + #node|short# + (diff) + (annotate)
- + #rename%filerename# #parent%filerevparent# #child%filerevchild# diff --git a/templates/gitweb/changelog.tmpl b/templates/gitweb/changelog.tmpl --- a/templates/gitweb/changelog.tmpl +++ b/templates/gitweb/changelog.tmpl @@ -6,7 +6,7 @@ @@ -18,7 +18,7 @@ diff --git a/templates/gitweb/changelogentry.tmpl b/templates/gitweb/changelogentry.tmpl --- a/templates/gitweb/changelogentry.tmpl +++ b/templates/gitweb/changelogentry.tmpl @@ -1,9 +1,9 @@
-#date|age# ago#desc|strip|firstline|escape# +#date|age# ago#desc|strip|firstline|escape#
#author|obfuscate# [#date|rfc822date#] rev #rev#
diff --git a/templates/gitweb/changeset.tmpl b/templates/gitweb/changeset.tmpl --- a/templates/gitweb/changeset.tmpl +++ b/templates/gitweb/changeset.tmpl @@ -6,11 +6,11 @@
@@ -21,7 +21,7 @@
- + #parent%changesetparent# #child%changesetchild# #changesettag# diff --git a/templates/gitweb/error.tmpl b/templates/gitweb/error.tmpl --- a/templates/gitweb/error.tmpl +++ b/templates/gitweb/error.tmpl @@ -6,11 +6,11 @@
diff --git a/templates/gitweb/fileannotate.tmpl b/templates/gitweb/fileannotate.tmpl --- a/templates/gitweb/fileannotate.tmpl +++ b/templates/gitweb/fileannotate.tmpl @@ -6,20 +6,20 @@ @@ -28,13 +28,13 @@ annotate |
changeset #rev#:#node|short#
#node|short#
author#author|obfuscate#
#date|date# (#date|age# ago)
changeset#node|short#
manifest#node|short#
manifest#node|short#
- + #rename%filerename# #parent%fileannotateparent# #child%fileannotatechild# - + diff --git a/templates/gitweb/filediff.tmpl b/templates/gitweb/filediff.tmpl --- a/templates/gitweb/filediff.tmpl +++ b/templates/gitweb/filediff.tmpl @@ -6,18 +6,18 @@
changeset #rev#:#node|short#
#node|short#
manifest:#node|short#
#node|short#
author: #author|obfuscate#
- + {parent%filediffparent} {child%filediffchild} - +
changeset {rev}:{node|short}{node|short}
manifest:{node|short}{node|short}
diff --git a/templates/gitweb/filelog.tmpl b/templates/gitweb/filelog.tmpl --- a/templates/gitweb/filelog.tmpl +++ b/templates/gitweb/filelog.tmpl @@ -6,18 +6,18 @@ diff --git a/templates/gitweb/filerevision.tmpl b/templates/gitweb/filerevision.tmpl --- a/templates/gitweb/filerevision.tmpl +++ b/templates/gitweb/filerevision.tmpl @@ -6,20 +6,20 @@ @@ -28,13 +28,13 @@ file | - + #rename%filerename# #parent%fileannotateparent# #child%fileannotatechild# - + diff --git a/templates/gitweb/manifest.tmpl b/templates/gitweb/manifest.tmpl --- a/templates/gitweb/manifest.tmpl +++ b/templates/gitweb/manifest.tmpl @@ -6,16 +6,16 @@
#path|escape#
@@ -24,7 +24,7 @@ manifest | - + #dentries%manifestdirentry# diff --git a/templates/gitweb/map b/templates/gitweb/map --- a/templates/gitweb/map +++ b/templates/gitweb/map @@ -5,50 +5,51 @@ search = search.tmpl changelog = changelog.tmpl summary = summary.tmpl error = error.tmpl -naventry = '#label|escape# ' -navshortentry = '#label|escape# ' -filedifflink = '#file|escape# ' -filenodelink = '' +naventry = '#label|escape# ' +navshortentry = '#label|escape# ' +filedifflink = '#file|escape# ' +filenodelink = '' fileellipses = '...' changelogentry = changelogentry.tmpl searchentry = changelogentry.tmpl changeset = changeset.tmpl manifest = manifest.tmpl -manifestdirentry = '' -manifestfileentry = '' +manifestdirentry = '' +manifestfileentry = '' filerevision = filerevision.tmpl fileannotate = fileannotate.tmpl filediff = filediff.tmpl filelog = filelog.tmpl fileline = '
   #linenumber# #line|escape#
' -annotateline = '' +annotateline = '' difflineplus = '
#line|escape#
' difflineminus = '
#line|escape#
' difflineat = '
#line|escape#
' diffline = '
#line|escape#
' -changelogparent = '' -changesetparent = '' -filerevparent = '' -filerename = '' -filelogrename = '| base' -fileannotateparent = '' -changelogchild = '' -changesetchild = '' -filerevchild = '' -fileannotatechild = '' +changelogparent = '' +changesetparent = '' +filerevparent = '' +filerename = '' +filelogrename = '| base' +fileannotateparent = '' +changelogchild = '' +changesetchild = '' +filerevchild = '' +fileannotatechild = '' tags = tags.tmpl -tagentry = '' +tagentry = '' diffblock = '
#lines#
' changelogtag = '' changesettag = '' -filediffparent = '' -filelogparent = '' -filediffchild = '' -filelogchild = '' +filediffparent = '' +filelogparent = '' +filediffchild = '' +filelogchild = '' shortlog = shortlog.tmpl -shortlogentry = '' -filelogentry = '' +shortlogentry = '' +filelogentry = '' archiveentry = ' | #type|escape# ' indexentry = '' index = index.tmpl +urlparameter = '#separator##name#=#value|urlescape#' hiddenformentry = '' diff --git a/templates/gitweb/search.tmpl b/templates/gitweb/search.tmpl --- a/templates/gitweb/search.tmpl +++ b/templates/gitweb/search.tmpl @@ -1,10 +1,10 @@ #header#

searching for #query|escape#

diff --git a/templates/gitweb/shortlog.tmpl b/templates/gitweb/shortlog.tmpl --- a/templates/gitweb/shortlog.tmpl +++ b/templates/gitweb/shortlog.tmpl @@ -6,7 +6,7 @@ @@ -17,11 +17,11 @@
changeset #rev#:#node|short#
#node|short#
manifest:#node|short#
#node|short#
author: #author|obfuscate#
drwxr-xr-x [up][up]
#file|escape#
#file|escape#
drwxr-xr-x#basename|escape#/
#permissions|permissions##size##basename|escape#
drwxr-xr-x#basename|escape#/
#permissions|permissions##size##basename|escape#
#author|obfuscate#@#rev#
#line|escape#
#author|obfuscate#@#rev#
#line|escape#
parent #rev#:#node|short#
parent#node|short#
parent:#node|short#
parent:#file|escape#@#node|short#
parent:#node|short#
child #rev#:#node|short#
child#node|short#
child:#node|short#
child:#node|short#
parent #rev#:#node|short#
parent#node|short#
parent:#node|short#
parent:#file|escape#@#node|short#
parent:#node|short#
child #rev#:#node|short#
child#node|short#
child:#node|short#
child:#node|short#
#date|age# ago#tag|escape#
#date|age# ago#tag|escape#
tag:#tag|escape#
tag#tag|escape#
parent #rev#:#node|short#
parent #rev#: #node|short#
child #rev#:#node|short#
child #rev#: #node|short#
parent #rev#:#node|short#
parent #rev#: #node|short#
child #rev#:#node|short#
child #rev#: #node|short#
#date|age# ago#author##desc|strip|firstline|escape#
#date|age# ago#desc|strip|firstline|escape#
#date|age# ago#author##desc|strip|firstline|escape#
#date|age# ago#desc|strip|firstline|escape#
#name|escape##description##contact|obfuscate##lastchange|age# ago
last change#lastchange|rfc822date#
-
changes
+
changes
#shortlog# - +
...
...
-
tags
+
tags
#tags# - +
...
...
#footer# diff --git a/templates/gitweb/tags.tmpl b/templates/gitweb/tags.tmpl --- a/templates/gitweb/tags.tmpl +++ b/templates/gitweb/tags.tmpl @@ -6,15 +6,15 @@ diff --git a/templates/manifest.tmpl b/templates/manifest.tmpl --- a/templates/manifest.tmpl +++ b/templates/manifest.tmpl @@ -4,10 +4,10 @@
-changelog -shortlog -tags -changeset +changelog +shortlog +tags +changeset #archives%archiveentry#
@@ -17,7 +17,7 @@ drwxr-xr-x    - [up] + [up] #dentries%manifestdirentry# #fentries%manifestfileentry# diff --git a/templates/map b/templates/map --- a/templates/map +++ b/templates/map @@ -5,50 +5,51 @@ search = search.tmpl changelog = changelog.tmpl shortlog = shortlog.tmpl shortlogentry = shortlogentry.tmpl -naventry = '#label|escape# ' -navshortentry = '#label|escape# ' -filedifflink = '#file|escape# ' -filenodelink = '#file|escape# ' +naventry = '#label|escape# ' +navshortentry = '#label|escape# ' +filedifflink = '#file|escape# ' +filenodelink = '#file|escape# ' fileellipses = '...' changelogentry = changelogentry.tmpl searchentry = changelogentry.tmpl changeset = changeset.tmpl manifest = manifest.tmpl -manifestdirentry = 'drwxr-xr-x  #basename|escape#/' -manifestfileentry = '#permissions|permissions# #size# #basename|escape#' +manifestdirentry = 'drwxr-xr-x  #basename|escape#/' +manifestfileentry = '#permissions|permissions# #size# #basename|escape#' filerevision = filerevision.tmpl fileannotate = fileannotate.tmpl filediff = filediff.tmpl filelog = filelog.tmpl fileline = '
#linenumber##line|escape#
' filelogentry = filelogentry.tmpl -annotateline = '#author|obfuscate#@#rev#
#line|escape#
' +annotateline = '#author|obfuscate#@#rev#
#line|escape#
' difflineplus = '#line|escape#' difflineminus = '#line|escape#' difflineat = '#line|escape#' diffline = '#line|escape#' -changelogparent = 'parent #rev#:#node|short#' -changesetparent = 'parent #rev#:#node|short#' -filerevparent = 'parent:#node|short#' -filerename = 'parent:#file|escape#@#node|short#' -filelogrename = 'base:#file|escape#@#node|short#' -fileannotateparent = 'parent:#node|short#' -changesetchild = 'child #rev#:#node|short#' -changelogchild = 'child #rev#:#node|short#' -filerevchild = 'child:#node|short#' -fileannotatechild = 'child:#node|short#' +changelogparent = 'parent #rev#:#node|short#' +changesetparent = 'parent #rev#:#node|short#' +filerevparent = 'parent:#node|short#' +filerename = 'parent:#file|escape#@#node|short#' +filelogrename = 'base:#file|escape#@#node|short#' +fileannotateparent = 'parent:#node|short#' +changesetchild = 'child #rev#:#node|short#' +changelogchild = 'child #rev#:#node|short#' +filerevchild = 'child:#node|short#' +fileannotatechild = 'child:#node|short#' tags = tags.tmpl -tagentry = '
  • #node# #tag|escape#
  • ' +tagentry = '
  • #node# #tag|escape#
  • ' diffblock = '
    #lines#
    ' changelogtag = 'tag:#tag|escape#' changesettag = 'tag:#tag|escape#' -filediffparent = 'parent #rev#:#node|short#' -filelogparent = 'parent #rev#:#node|short#' -filediffchild = 'child #rev#:#node|short#' -filelogchild = 'child #rev#:#node|short#' +filediffparent = 'parent #rev#:#node|short#' +filelogparent = 'parent #rev#:#node|short#' +filediffchild = 'child #rev#:#node|short#' +filelogchild = 'child #rev#:#node|short#' indexentry = '#name|escape##description##contact|obfuscate##lastchange|age# agoRSS #archives%archiveentry#' index = index.tmpl archiveentry = '#type|escape# ' notfound = notfound.tmpl error = error.tmpl +urlparameter = '#separator##name#=#value|urlescape#' hiddenformentry = '' diff --git a/templates/search.tmpl b/templates/search.tmpl --- a/templates/search.tmpl +++ b/templates/search.tmpl @@ -4,10 +4,10 @@
    -changelog -shortlog -tags -manifest +changelog +shortlog +tags +manifest

    searching for #query|escape#

    diff --git a/templates/shortlog.tmpl b/templates/shortlog.tmpl --- a/templates/shortlog.tmpl +++ b/templates/shortlog.tmpl @@ -6,9 +6,9 @@
    -changelog -tags -manifest +changelog +tags +manifest #archives%archiveentry# rss
    diff --git a/templates/shortlogentry.tmpl b/templates/shortlogentry.tmpl --- a/templates/shortlogentry.tmpl +++ b/templates/shortlogentry.tmpl @@ -2,6 +2,6 @@ #date|age# #author|obfuscate# - #desc|strip|firstline|escape# + #desc|strip|firstline|escape# diff --git a/templates/tags.tmpl b/templates/tags.tmpl --- a/templates/tags.tmpl +++ b/templates/tags.tmpl @@ -6,9 +6,9 @@
    -changelog -shortlog -manifest +changelog +shortlog +manifest rss