[PATCH 1 of 1] graphlog: Do not display hidden secret unless --hidden is provided

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Jan 9 08:33:28 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1326048482 -3600
# Node ID 21da9e31a6b929db6d5b30f3a7b2196b005da235
# Parent  e2943fc093513d893e4a87c018086f4d7b33fec1
graphlog: Do not display hidden secret unless --hidden is provided

This option and behavior match the standard log one.

diff --git a/hgext/graphlog.py b/hgext/graphlog.py
--- a/hgext/graphlog.py
+++ b/hgext/graphlog.py
@@ -285,6 +285,10 @@
     for path in pats:
         optrevset.append('file(%r)' % path)
 
+    # this is a reversed logic so it does not fit in loop
+    if not opts.get('hidden', False):
+        optrevset.append('not hidden()')
+
     if revset or optrevset:
         if revset:
             revset = ['(' + ' or '.join(revset) + ')']
@@ -312,6 +316,7 @@
      _('limit number of changes displayed'), _('NUM')),
     ('p', 'patch', False, _('show patch')),
     ('r', 'rev', [], _('show the specified revision or range'), _('REV')),
+    ('', 'hidden', False, _('show hidden changesets (DEPRECATED)')),
     ] + templateopts,
     _('hg glog [OPTION]... [FILE]'))
 def graphlog(ui, repo, *pats, **opts):
diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -243,11 +243,9 @@
 def visibleheads(repo):
     """return the set of visible head of this repo"""
     # XXX we want a cache on this
-    sroots = repo._phaseroots[secret]
-    if sroots:
+    if repo._phaseroots[secret]:
         # XXX very slow revset. storing heads or secret "boundary" would help.
-        revset = repo.set('heads(not (%ln::))', sroots)
-
+        revset = repo.set('heads(not secret())')
         vheads = [ctx.node() for ctx in revset]
         if not vheads:
             vheads.append(nullid)


More information about the Mercurial-devel mailing list