[PATCH] dispatch: take --hidden from individual commands into account

Julien Cristau julien.cristau at logilab.fr
Mon Jan 27 02:42:36 CST 2014


# HG changeset patch
# User Julien Cristau <julien.cristau at logilab.fr>
# Date 1390590026 -3600
#      Fri Jan 24 20:00:26 2014 +0100
# Branch stable
# Node ID 6faa528c91ae251ee99c55a01180c57cde764488
# Parent  427d672c0e4e07642d2400a28946cefde11e04ff
dispatch: take --hidden from individual commands into account

The command server would otherwise ignore that option, since the repo
object is only created once.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -772,12 +772,10 @@ def _dispatch(req):
         else:
             try:
                 repo = hg.repository(ui, path=path)
                 if not repo.local():
                     raise util.Abort(_("repository '%s' is not local") % path)
-                if options['hidden']:
-                    repo = repo.unfiltered()
                 repo.ui.setconfig("bundle", "mainreporoot", repo.root)
             except error.RequirementError:
                 raise
             except error.RepoError:
                 if cmd not in commands.optionalrepo.split():
@@ -793,10 +791,12 @@ def _dispatch(req):
                                                 " (.hg not found)")
                                               % os.getcwd())
                     raise
         if repo:
             ui = repo.ui
+            if options['hidden']:
+                repo = repo.unfiltered()
         args.insert(0, repo)
     elif rpath:
         ui.warn(_("warning: --repository ignored\n"))
 
     msg = ' '.join(' ' in a and repr(a) or a for a in fullargs)


More information about the Mercurial-devel mailing list