[PATCH 1 of 6] graphlog: remove too early return from getgraphlogrevs() for empty repo

Yuya Nishihara yuya at tcha.org
Fri Feb 6 14:40:57 UTC 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1423145684 -32400
#      Thu Feb 05 23:14:44 2015 +0900
# Node ID 3935fb2aa125fd7ca09979e0bbd7369a6a19935a
# Parent  a9b61dbdb827165a9fd9d44dd42b892dbd9fa07c
graphlog: remove too early return from getgraphlogrevs() for empty repo

Even if repository is empty, null revision should exist.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1830,8 +1830,6 @@ def getgraphlogrevs(repo, pats, opts):
     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...
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -1541,6 +1541,9 @@ have 2 filelog topological heads in a li
   $ testlog --follow
   []
   []
+  $ testlog -rnull
+  ['null']
+  []
   $ echo a > a
   $ echo aa > aa
   $ echo f > f


More information about the Mercurial-devel mailing list