# HG changeset patch # User Benoit Boissinot # Date 2009-01-09 16:34:06 # Node ID 069b29656401d59a62cb777465ad3f123925e3f0 # Parent 89207edf3973efb342bd49714b653b6de8518283 web: use the correct filectx in filelog diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -545,23 +545,24 @@ def filelog(web, req, tmpl): def entries(limit=0, **map): l = [] + repo = web.repo for i in xrange(start, end): - ctx = fctx.filectx(i) + iterfctx = fctx.filectx(i) l.insert(0, {"parity": parity.next(), "filerev": i, "file": f, - "node": hex(ctx.node()), - "author": ctx.user(), - "date": ctx.date(), - "rename": webutil.renamelink(fctx), - "parent": webutil.siblings(fctx.parents()), - "child": webutil.siblings(fctx.children()), - "desc": ctx.description(), - "tags": webutil.nodetagsdict(web.repo, ctx.node()), - "branch": webutil.nodebranchnodefault(ctx), - "inbranch": webutil.nodeinbranch(web.repo, ctx), - "branches": webutil.nodebranchdict(web.repo, ctx)}) + "node": hex(iterfctx.node()), + "author": iterfctx.user(), + "date": iterfctx.date(), + "rename": webutil.renamelink(iterfctx), + "parent": webutil.siblings(iterfctx.parents()), + "child": webutil.siblings(iterfctx.children()), + "desc": iterfctx.description(), + "tags": webutil.nodetagsdict(repo, iterfctx.node()), + "branch": webutil.nodebranchnodefault(iterfctx), + "inbranch": webutil.nodeinbranch(repo, iterfctx), + "branches": webutil.nodebranchdict(repo, iterfctx)}) if limit > 0: l = l[:limit] diff --git a/tests/test-hgweb-filelog b/tests/test-hgweb-filelog --- a/tests/test-hgweb-filelog +++ b/tests/test-hgweb-filelog @@ -16,6 +16,9 @@ hg ci -Am "second a" hg rm a hg ci -m "del2 a" +hg mv b c +hg ci -m "mv b" + hg log -p hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log @@ -36,5 +39,8 @@ echo % first version - one revision echo % before addition - error ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/0/a') +echo % should show base link, use spartan because it shows it +("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/tip/c?style=spartan') + echo % errors cat errors.log diff --git a/tests/test-hgweb-filelog.out b/tests/test-hgweb-filelog.out --- a/tests/test-hgweb-filelog.out +++ b/tests/test-hgweb-filelog.out @@ -1,8 +1,24 @@ adding b adding a adding a +changeset: 5:a3b6a9e4507e +tag: tip +user: test +date: Thu Jan 01 00:00:00 1970 +0000 +summary: mv b + +diff -r 52e848cdcd88 -r a3b6a9e4507e b +--- a/b Thu Jan 01 00:00:00 1970 +0000 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,1 +0,0 @@ +-b +diff -r 52e848cdcd88 -r a3b6a9e4507e c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/c Thu Jan 01 00:00:00 1970 +0000 +@@ -0,0 +1,1 @@ ++b + changeset: 4:52e848cdcd88 -tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: del2 a @@ -435,4 +451,73 @@ a@6563da9dcf87: not found in manifest +% should show base link, use spartan because it shows it +200 Script output follows + + + + + + + + +test: c history + + + + + +
+changelog +shortlog +graph +tags +file +annotate +rss +atom +
+ +

c revision history

+ +

navigate: (0) tip

+ + + + + + + + + + + + + + + + + + +
many years ago:mv b
revision 0: + + a3b6a9e4507e + (diff) + (annotate) +
base:b@1e88685f5dde
author:test
date:Thu Jan 01 00:00:00 1970 +0000
+ + + + + + + + + + % errors