graphlog: fix regression with filelogs introduced by 7bc62ebe7693
authorPeter Arrenbrecht <peter.arrenbrecht@gmail.com>
Sun, 16 Nov 2008 20:55:30 +0100
changeset 7383 b501c7f3c2ad
parent 7382 f5f6b7dcd217
child 7384 62b75d73c33d
graphlog: fix regression with filelogs introduced by 7bc62ebe7693
hgext/graphlog.py
tests/test-glog
tests/test-glog.out
--- a/hgext/graphlog.py	Sat Nov 15 15:57:12 2008 +0100
+++ b/hgext/graphlog.py	Sun Nov 16 20:55:30 2008 +0100
@@ -40,7 +40,7 @@
     filerev = len(repo.file(path)) - 1
     while filerev >= 0:
         fctx = repo.filectx(path, fileid=filerev)
-        parents = [f.filerev() for f in fctx.parents() if f.path() == path]
+        parents = [f.linkrev() for f in fctx.parents() if f.path() == path]
         parents.sort()
         if fctx.rev() <= start:
             yield (fctx, parents)
--- a/tests/test-glog	Sat Nov 15 15:57:12 2008 +0100
+++ b/tests/test-glog	Sun Nov 16 20:55:30 2008 +0100
@@ -151,3 +151,16 @@
 hg glog -l1 repo/0
 hg glog -l1 repo/missing
 
+echo % file log with revs != cset revs
+hg init flog
+cd flog
+echo one >one
+hg add one
+hg commit -mone
+echo two >two
+hg add two
+hg commit -mtwo
+echo more >two
+hg commit -mmore
+hg glog two
+
--- a/tests/test-glog.out	Sat Nov 15 15:57:12 2008 +0100
+++ b/tests/test-glog.out	Sun Nov 16 20:55:30 2008 +0100
@@ -369,3 +369,15 @@
    date:        Thu Jan 01 00:00:00 1970 +0000
    summary:     (0) root
 
+% file log with revs != cset revs
+@  changeset:   2:12c28321755b
+|  tag:         tip
+|  user:        test
+|  date:        Thu Jan 01 00:00:00 1970 +0000
+|  summary:     more
+|
+o  changeset:   1:5ac72c0599bf
+   user:        test
+   date:        Thu Jan 01 00:00:00 1970 +0000
+   summary:     two
+