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

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 2:57 a.m.
Message ID <c38bc2d9680f7f1e132c.1498964254@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21899/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 2:57 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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

Patch

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())