I'm working on mercurial integration with MS Visual Studio. Now i'm trying to migrate from Mercurial 2.3 to Mercurial 3.x, but found a bug (or breaking change). The following command output nothing: hg log --follow --rev null while log without follow works fine: d:\Work\Mercurial\Tests1\LogNullTest>hg log --rev null changeset: -1:000000000000 user: date: Thu Jan 01 00:00:00 1970 +0000 Also, log with --follow works fine for any other revisions but null. A while back (in mercurial v2.3 and earlier) it worked for null revision. Here are steps to reproduce: d:\Work\Mercurial\Tests1\LogNullTest>hg init d:\Work\Mercurial\Tests1\LogNullTest>echo a > a.txt d:\Work\Mercurial\Tests1\LogNullTest>hg add a.txt d:\Work\Mercurial\Tests1\LogNullTest>hg ci -m "added a.txt" d:\Work\Mercurial\Tests1\LogNullTest>hg log changeset: 0:d7db1a6e60d9 tag: tip user: Sergey Antonov <sergant_@mail.ru> date: Sun Jan 25 12:36:37 2015 +0300 summary: added a.txt d:\Work\Mercurial\Tests1\LogNullTest>hg log --follow --rev null d:\Work\Mercurial\Tests1\LogNullTest>hg log --rev null changeset: -1:000000000000 user: date: Thu Jan 01 00:00:00 1970 +0000 d:\Work\Mercurial\Tests1\LogNullTest>hg log --rev 0 changeset: 0:d7db1a6e60d9 tag: tip user: Sergey Antonov <sergant_@mail.ru> date: Sun Jan 25 12:36:37 2015 +0300 summary: added a.txt d:\Work\Mercurial\Tests1\LogNullTest>hg log --follow --rev 0 changeset: 0:d7db1a6e60d9 tag: tip user: Sergey Antonov <sergant_@mail.ru> date: Sun Jan 25 12:36:37 2015 +0300 summary: added a.txt
The first bad revision is: changeset: 21127:69402eb72115 user: Lucas Moscovicz <lmoscovicz@fb.com> date: Fri Feb 28 15:10:56 2014 -0800 files: mercurial/cmdutil.py mercurial/commands.py tests/test-glog.t description: log: changed implementation to use graphlog code It seems the graphlog code can't handle --follow -r null correctly. There are two issues involved: 1. cmdutil._makelogrevset() maps "--follow -r null" to "ancestors(-1)", which should be "ancestors(null)" 2. "ancestors(null)" revset does not include "null"
Fixed by http://selenic.com/repo/hg/rev/b1e026c25552 Yuya Nishihara <yuya@tcha.org> revset: fix ancestors(null) to include null revision (issue4512) Since 13c0327eeb6f, null parent is explicitly excluded. So, there is no reason to have nullrev in the initial seen set. (please test the fix)
Bug was set to TESTING for 7 days, resolving