Show More
@@ -28,7 +28,7 b' def _up(p):' | |||
|
28 | 28 | return "/" |
|
29 | 29 | return up + "/" |
|
30 | 30 | |
|
31 | def revnavgen(pos, pagelen, limit): | |
|
31 | def revnavgen(pos, pagelen, limit, nodefunc): | |
|
32 | 32 | def seq(factor, limit=None): |
|
33 | 33 | if limit: |
|
34 | 34 | yield limit |
@@ -50,16 +50,16 b' def revnavgen(pos, pagelen, limit):' | |||
|
50 | 50 | break |
|
51 | 51 | last = f |
|
52 | 52 | if pos + f < limit: |
|
53 | l.append(("+%d" % f, pos + f)) | |
|
53 | l.append(("+%d" % f, hex(nodefunc(pos + f).node()))) | |
|
54 | 54 | if pos - f >= 0: |
|
55 | l.insert(0, ("-%d" % f, pos - f)) | |
|
55 | l.insert(0, ("-%d" % f, hex(nodefunc(pos - f).node()))) | |
|
56 | 56 | |
|
57 |
yield {"label": "(0)", " |
|
|
57 | yield {"label": "(0)", "node": hex(nodefunc(0).node())} | |
|
58 | 58 | |
|
59 |
for label, |
|
|
60 |
yield {"label": label, " |
|
|
59 | for label, node in l: | |
|
60 | yield {"label": label, "node": node} | |
|
61 | 61 | |
|
62 |
yield {"label": "tip", " |
|
|
62 | yield {"label": "tip", "node": hex(nodefunc('-1').node())} | |
|
63 | 63 | |
|
64 | 64 | return nav |
|
65 | 65 | |
@@ -215,7 +215,7 b' class hgweb(object):' | |||
|
215 | 215 | end = min(count, start + maxchanges) |
|
216 | 216 | pos = end - 1 |
|
217 | 217 | |
|
218 | changenav = revnavgen(pos, maxchanges, count) | |
|
218 | changenav = revnavgen(pos, maxchanges, count, self.repo.changectx) | |
|
219 | 219 | |
|
220 | 220 | yield self.t(shortlog and 'shortlog' or 'changelog', |
|
221 | 221 | changenav=changenav, |
@@ -338,7 +338,8 b' class hgweb(object):' | |||
|
338 | 338 | for e in l: |
|
339 | 339 | yield e |
|
340 | 340 | |
|
341 | nav = revnavgen(pos, pagelen, count) | |
|
341 | nodefunc = lambda x: fctx.filectx(fileid=x) | |
|
342 | nav = revnavgen(pos, pagelen, count, nodefunc) | |
|
342 | 343 | yield self.t("filelog", file=f, node=hex(fctx.node()), nav=nav, |
|
343 | 344 | entries=entries) |
|
344 | 345 |
@@ -5,9 +5,9 b' search = search.tmpl' | |||
|
5 | 5 | changelog = changelog.tmpl |
|
6 | 6 | summary = summary.tmpl |
|
7 | 7 | error = error.tmpl |
|
8 |
naventry = '<a href=" |
|
|
9 |
navshortentry = '<a href=" |
|
|
10 |
filenaventry = '<a href="{url}log/{ |
|
|
8 | naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' | |
|
9 | navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' | |
|
10 | filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> ' | |
|
11 | 11 | filedifflink = '<a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> ' |
|
12 | 12 | filenodelink = '<tr class="parity#parity#"><td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">#file|escape#</a></td><td></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> | <a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a></td></tr>' |
|
13 | 13 | fileellipses = '...' |
@@ -5,9 +5,9 b' search = search.tmpl' | |||
|
5 | 5 | changelog = changelog.tmpl |
|
6 | 6 | shortlog = shortlog.tmpl |
|
7 | 7 | shortlogentry = shortlogentry.tmpl |
|
8 |
naventry = '<a href=" |
|
|
9 |
navshortentry = '<a href=" |
|
|
10 |
filenaventry = '<a href="{url}log/{ |
|
|
8 | naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' | |
|
9 | navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' | |
|
10 | filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> ' | |
|
11 | 11 | filedifflink = '<a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> ' |
|
12 | 12 | filenodelink = '<a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> ' |
|
13 | 13 | fileellipses = '...' |
@@ -5,8 +5,8 b' search = search.tmpl' | |||
|
5 | 5 | changelog = changelog.tmpl |
|
6 | 6 | shortlog = shortlog.tmpl |
|
7 | 7 | shortlogentry = shortlogentry.tmpl |
|
8 |
naventry = '<a href="?cl= |
|
|
9 |
navshortentry = '<a href="?sl= |
|
|
8 | naventry = '<a href="?cl={node|short}">{label|escape}</a> ' | |
|
9 | navshortentry = '<a href="?sl={node|short}">{label|escape}</a> ' | |
|
10 | 10 | filedifflink = '<a href="?fd=#node|short#;file=#file|urlescape#">#file|escape#</a> ' |
|
11 | 11 | filenodelink = '<a href="?f=#node|short#;file=#file|urlescape#">#file|escape#</a> ' |
|
12 | 12 | fileellipses = '...' |
General Comments 0
You need to be logged in to leave comments.
Login now