graphlog: remove too early return from getgraphlogrevs() for empty repo
authorYuya Nishihara <yuya@tcha.org>
Thu, 05 Feb 2015 23:14:44 +0900
changeset 24059 8d295ce6e488
parent 24058 d1fcff9400c9
child 24060 eb1c9700d19d
graphlog: remove too early return from getgraphlogrevs() for empty repo Even if repository is empty, null revision should exist.
mercurial/cmdutil.py
tests/test-glog.t
--- a/mercurial/cmdutil.py	Thu Jan 22 22:22:09 2015 -0800
+++ b/mercurial/cmdutil.py	Thu Feb 05 23:14:44 2015 +0900
@@ -1830,8 +1830,6 @@
     callable taking a revision number and returning a match objects
     filtering the files to be detailed when displaying the revision.
     """
-    if not len(repo):
-        return [], None, None
     limit = loglimit(opts)
     # Default --rev value depends on --follow but --follow behaviour
     # depends on revisions resolved from --rev...
--- a/tests/test-glog.t	Thu Jan 22 22:22:09 2015 -0800
+++ b/tests/test-glog.t	Thu Feb 05 23:14:44 2015 +0900
@@ -1541,6 +1541,9 @@
   $ testlog --follow
   []
   []
+  $ testlog -rnull
+  ['null']
+  []
   $ echo a > a
   $ echo aa > aa
   $ echo f > f