# HG changeset patch # User Sean Farley # Date 2013-01-23 06:12:52 # Node ID ac0c12123743b659bc933e859d408676d05c63e0 # Parent 3aa8b4b36b6487ae5690ac62561536a7ed30cb6b log: remove any ancestors of nullrev (issue3772) For the special case, ":null" we remove the implied revision 0 since that wouldn't make any sense here. A test case is added to make sure only nullrev is shown. diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -6,6 +6,7 @@ # GNU General Public License version 2 or any later version. from i18n import _ +from mercurial.node import nullrev import util, error, osutil, revset, similar, encoding, phases import match as matchmod import os, errno, re, stat, sys, glob @@ -647,6 +648,8 @@ def revrange(repo, revs): start, end = spec.split(_revrangesep, 1) start = revfix(repo, start, 0) end = revfix(repo, end, len(repo) - 1) + if end == nullrev and start <= 0: + start = nullrev rangeiter = repo.changelog.revs(start, end) if not seen and not l: # by far the most common case: revs = ["-1:0"] diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1296,4 +1296,13 @@ test hg log on non-existent files and on changeset: 0:65624cd9070a $ hg log -l1 .d6/f1 | grep changeset changeset: 0:65624cd9070a + +issue3772: hg log -r :null showing revision 0 as well + + $ hg log -r :null + changeset: -1:000000000000 + user: + date: Thu Jan 01 00:00:00 1970 +0000 + + $ cd ..