annotate: add support to specify hidden revs if directaccess config is set
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 05 Jan 2018 19:23:30 +0530
changeset 35534 b6ce3568771d
parent 35533 8b958d21b19d
child 35535 ffd7b7cd309b
annotate: add support to specify hidden revs if directaccess config is set Differential Revision: https://phab.mercurial-scm.org/D1811
mercurial/commands.py
tests/test-directaccess.t
--- a/mercurial/commands.py	Fri Jan 05 19:30:30 2018 +0800
+++ b/mercurial/commands.py	Fri Jan 05 19:23:30 2018 +0530
@@ -293,7 +293,10 @@
         # to mimic the behavior of Mercurial before version 1.5
         opts['file'] = True
 
-    ctx = scmutil.revsingle(repo, opts.get('rev'))
+    rev = opts.get('rev')
+    if rev:
+        repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
+    ctx = scmutil.revsingle(repo, rev)
 
     rootfm = ui.formatter('annotate', opts)
     if ui.quiet:
--- a/tests/test-directaccess.t	Fri Jan 05 19:30:30 2018 +0800
+++ b/tests/test-directaccess.t	Fri Jan 05 19:23:30 2018 +0530
@@ -138,6 +138,11 @@
   $ hg identify -r 28ad74
   28ad74487de9
 
+`hg annotate`
+
+  $ hg annotate -r 28ad74 a
+  0: foo
+
 `hg status`
 
   $ hg status --change 28ad74