changeset 35547:b6dbc860570d

log: don't expand aliases in revset built from command options Only -rREV should be rewritten with user aliases.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 04 Jan 2018 12:00:18 +0900
parents 5e1d4ccab455
children b14c8bcfbad9
files mercurial/cmdutil.py tests/test-log.t
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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 <user1@example.org>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+
   $ cd ..
 
   $ hg init branches