[PATCH] Support exposing hidden changesets

Gregory Szorc gregory.szorc at gmail.com
Fri Jan 3 14:43:16 CST 2014

# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1388781195 28800
#      Fri Jan 03 12:33:15 2014 -0800
# Node ID 62ed6cc0955d5e4ba4122821bf796092d9e19922
# Parent  c13b99b01008dfd7694e32f803fa679ff0c070d1
Support exposing hidden changesets

hg serve will default to a filtered repo. Some clients may wish to
obtain information about hidden changesets. This patch adds a flag
to allow clients to talk with an unfiltered repo.

It's worth noting that currently the filtered/unfiltered decision is
made at server start time rather than command dispatch time. In the
future, we may wish to patch the command dispatch logic for the server
in Mercurial core so that --hidden on command flags can be honored at
command time.

diff --git a/hglib/client.py b/hglib/client.py
--- a/hglib/client.py
+++ b/hglib/client.py
@@ -36,23 +36,25 @@ class revision(tuple):
         return self[6]
 class hgclient(object):
     inputfmt = '>I'
     outputfmt = '>cI'
     outputfmtsize = struct.calcsize(outputfmt)
     retfmt = '>i'
-    def __init__(self, path, encoding, configs, connect=True):
+    def __init__(self, path, encoding, configs, connect=True, hidden=False):
         self._args = [hglib.HGPATH, 'serve', '--cmdserver', 'pipe',
                 '--config', 'ui.interactive=True']
         if path:
             self._args += ['-R', path]
         if configs:
             self._args += ['--config'] + configs
+        if hidden:
+            self._args += ['--hidden']
         self._env = {'HGPLAIN': '1'}
         if encoding:
             self._env['HGENCODING'] = encoding
         self.server = None
         self._version = None
         if connect:

More information about the Mercurial-devel mailing list