Mercurial > hg
changeset 24061:4fa72a09c73d
graphlog: remove useless check for empty repo when --follow is specified
This prepares for extracting common part from getgraphlogrevs() and
getlogrevs(). getlogrevs() does not handle empty repo specially.
When it was added at d74099ac2ac1, revs were build by old-style query, '.:0'.
So I think the purpose of "len(repo) > 0" was to handle the case of . = null.
Currently it isn't necessary for 'reverse(:.)', and it does not work if repo
is not empty but p1 is null.
$ hg up null
$ hg glog --follow -T '{rev}:{node|short}\n'
o 0:0a04b987be5a
The subsequent patch will fix this problem, so drops the wrong version for now.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 06 Feb 2015 00:06:47 +0900 |
parents | eb1c9700d19d |
children | f576addb5b77 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu Feb 05 23:49:18 2015 +0900 +++ b/mercurial/cmdutil.py Fri Feb 06 00:06:47 2015 +0900 @@ -1837,7 +1837,7 @@ if opts.get('rev'): revs = scmutil.revrange(repo, opts['rev']) else: - if follow and len(repo) > 0: + if follow: revs = repo.revs('reverse(:.)') else: revs = revset.spanset(repo)