Patchwork D8075: config: also respect HGRCSKIPREPO in the zeroconf extension

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2020, 4:48 p.m.
Message ID <d610c654ed289550ae785c05c19b0868@localhost.localdomain>
Download mbox | patch
Permalink /patch/44960/
State Not Applicable
Headers show

Comments

phabricator - Feb. 5, 2020, 4:48 p.m.
Closed by commit rHG1c530957a3ea: config: also respect HGRCSKIPREPO in the zeroconf extension (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8075?vs=19880&id=19913

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8075/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8075

AFFECTED FILES
  hgext/zeroconf/__init__.py
  tests/test-hgrc.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t
--- a/tests/test-hgrc.t
+++ b/tests/test-hgrc.t
@@ -299,3 +299,11 @@ 
   $ killdaemons.py
   $ cat access.log
   $ cat errors.log
+
+Check that zeroconf respect HGRCSKIPREPO=1
+
+  $ hg paths --config extensions.zeroconf=
+  hg: parse error at $TESTTMP/.hg/hgrc:3: [broken
+  [255]
+  $ HGRCSKIPREPO=1 hg paths --config extensions.zeroconf=
+  foo = $TESTTMP/bar
diff --git a/hgext/zeroconf/__init__.py b/hgext/zeroconf/__init__.py
--- a/hgext/zeroconf/__init__.py
+++ b/hgext/zeroconf/__init__.py
@@ -35,6 +35,7 @@ 
     extensions,
     hg,
     pycompat,
+    rcutil,
     ui as uimod,
 )
 from mercurial.hgweb import server as servermod
@@ -144,7 +145,8 @@ 
         prefix = app.ui.config(b"web", b"prefix", b"").strip(b'/') + b'/'
         for repo, path in repos:
             u = app.ui.copy()
-            u.readconfig(os.path.join(path, b'.hg', b'hgrc'))
+            if rcutil.use_repo_hgrc():
+                u.readconfig(os.path.join(path, b'.hg', b'hgrc'))
             name = os.path.basename(repo)
             path = (prefix + repo).strip(b'/')
             desc = u.config(b'web', b'description')