changeset 28565:d2c5ad3deccb stable tip @

zeroconf: access repo on hgweb_mod properly (issue5036) hgweb_mod.hgweb.repo disappeared in ae33fff17c1e (hg: establish a cache for localrepository instances) and the code for accessing repo instances from hgweb was later refactored to go through a cache-aware context manager. Adapt zeroconf to access the repo instance via the new API.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 17 Jan 2016 20:37:29 -0800
parents 3203dfe341f9
children
files hgext/zeroconf/__init__.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/zeroconf/__init__.py
+++ b/hgext/zeroconf/__init__.py
@@ -113,9 +113,10 @@
         repos = app.repos
     except AttributeError:
         # single repo
-        name = app.reponame or os.path.basename(app.repo.root)
-        path = app.repo.ui.config("web", "prefix", "").strip('/')
-        desc = app.repo.ui.config("web", "description", name)
+        with app._obtainrepo() as repo:
+            name = app.reponame or os.path.basename(repo.root)
+            path = repo.ui.config("web", "prefix", "").strip('/')
+            desc = repo.ui.config("web", "description", name)
         publish(name, desc, path, port)
     else:
         # webdir