[PATCH 06 of 18] configitems: register the 'bundle.mainreporoot' config

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jul 1 22:57:34 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1498786286 -7200
#      Fri Jun 30 03:31:26 2017 +0200
# Node ID c38bc2d9680f7f1e132cd8a206fcdd1db3337081
# Parent  72b37b0de882ee2f1e28ad388c8c04971f478b49
# EXP-Topic config.register.core
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r c38bc2d9680f
configitems: register the 'bundle.mainreporoot' config

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -414,7 +414,7 @@ def instance(ui, path, create):
     if create:
         raise error.Abort(_('cannot create new bundle repository'))
     # internal config: bundle.mainreporoot
-    parentpath = ui.config("bundle", "mainreporoot", "")
+    parentpath = ui.config("bundle", "mainreporoot")
     if not parentpath:
         # try to find the correct path to the working directory repo
         parentpath = cmdutil.findrepo(pycompat.getcwd())
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -63,6 +63,10 @@ coreconfigitem('auth', 'cookiefile',
 coreconfigitem('bookmarks', 'pushing',
     default=list,
 )
+# bundle.mainreporoot: internal hack for bundlerepo
+coreconfigitem('bundle', 'mainreporoot',
+    default='',
+)
 coreconfigitem('color', 'mode',
     default='auto',
 )
diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -232,7 +232,7 @@ class unionrepository(localrepo.localrep
 def instance(ui, path, create):
     if create:
         raise error.Abort(_('cannot create new union repository'))
-    parentpath = ui.config("bundle", "mainreporoot", "")
+    parentpath = ui.config("bundle", "mainreporoot")
     if not parentpath:
         # try to find the correct path to the working directory repo
         parentpath = cmdutil.findrepo(pycompat.getcwd())


More information about the Mercurial-devel mailing list