# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-01-05 13:53:30 # Node ID b6ce3568771dcbc6a70bf0d4ddda26451bc48541 # Parent 8b958d21b19d659f3d8d802b327cec58095f8e7a annotate: add support to specify hidden revs if directaccess config is set Differential Revision: https://phab.mercurial-scm.org/D1811 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -293,7 +293,10 @@ def annotate(ui, repo, *pats, **opts): # 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: diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t --- a/tests/test-directaccess.t +++ b/tests/test-directaccess.t @@ -138,6 +138,11 @@ Testing with hash $ hg identify -r 28ad74 28ad74487de9 +`hg annotate` + + $ hg annotate -r 28ad74 a + 0: foo + `hg status` $ hg status --change 28ad74