# HG changeset patch # User Yuya Nishihara # Date 1515034818 -32400 # Node ID b6dbc860570d7164ae31a24406554a38c9776fee # Parent 5e1d4ccab45510652d2087a98ceb1551f28f9c06 log: don't expand aliases in revset built from command options Only -rREV should be rewritten with user aliases. diff -r 5e1d4ccab455 -r b6dbc860570d mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Oct 22 22:52:36 2017 +0900 +++ b/mercurial/cmdutil.py Thu Jan 04 12:00:18 2018 +0900 @@ -2523,7 +2523,7 @@ if not (revs.isdescending() or revs.istopo()): revs.sort(reverse=True) if expr: - matcher = revset.match(repo.ui, expr) + matcher = revset.match(None, expr) revs = matcher(repo, revs) if limit is not None: revs = revs.slice(0, limit) diff -r 5e1d4ccab455 -r b6dbc860570d tests/test-log.t --- a/tests/test-log.t Sun Oct 22 22:52:36 2017 +0900 +++ b/tests/test-log.t Thu Jan 04 12:00:18 2018 +0900 @@ -1252,6 +1252,16 @@ $ hg log -u "user3" +"-u USER" shouldn't be overridden by "user(USER)" alias + + $ hg log --config 'revsetalias.user(x)=branch(x)' -u default + $ hg log --config 'revsetalias.user(x)=branch(x)' -u user1 + changeset: 0:29a4c94f1924 + user: User One + date: Thu Jan 01 00:00:00 1970 +0000 + summary: a + + $ cd .. $ hg init branches