Skip to content
Snippets Groups Projects
Commit 02c71f96 authored by Alexander Plavin's avatar Alexander Plavin
Browse files

hgweb: always start graph with the revision in url

It is the same fix for graph command, as was recently for log. This makes the
specified revision be always on top of the graph view.
Before the patch, for example with repo having revisions 0, 1, 2, 3 and revision
in url being '2', all revisions were shown and the specified one wasn't
the first.
parent a987972d
No related branches found
No related tags found
No related merge requests found
...@@ -879,8 +879,7 @@ ...@@ -879,8 +879,7 @@
count = len(web.repo) count = len(web.repo)
pos = rev pos = rev
start = max(0, pos - revcount + 1) start = max(0, pos - revcount + 1)
end = min(count, start + revcount) end = pos + 1
pos = end - 1
uprev = min(max(0, count - 1), rev + revcount) uprev = min(max(0, count - 1), rev + revcount)
downrev = max(0, rev - revcount) downrev = max(0, rev - revcount)
......
...@@ -1324,9 +1324,8 @@ ...@@ -1324,9 +1324,8 @@
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \ $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \
> 'graph/e06180cbfb0?style=raw&revcount=3' | grep changeset > 'graph/e06180cbfb0?style=raw&revcount=3' | grep changeset
changeset: ab4f1438558b
changeset: e06180cbfb0c changeset: e06180cbfb0c
changeset: b4e73ffab476 changeset: b4e73ffab476
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \ $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \
> 'graph/b4e73ffab47?style=raw&revcount=3' | grep changeset > 'graph/b4e73ffab47?style=raw&revcount=3' | grep changeset
...@@ -1328,10 +1327,8 @@ ...@@ -1328,10 +1327,8 @@
changeset: e06180cbfb0c changeset: e06180cbfb0c
changeset: b4e73ffab476 changeset: b4e73ffab476
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \ $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT \
> 'graph/b4e73ffab47?style=raw&revcount=3' | grep changeset > 'graph/b4e73ffab47?style=raw&revcount=3' | grep changeset
changeset: ab4f1438558b
changeset: e06180cbfb0c
changeset: b4e73ffab476 changeset: b4e73ffab476
$ cat errors.log $ cat errors.log
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment