Patchwork [2,of,2] mq: do not inherit settings form base repo in mqrepo (Fixes issue2358)

login
register
mail settings
Submitter Simon Heimberg
Date April 18, 2013, 10:48 p.m.
Message ID <8530ae3ae4d4d3625efa.1366325290@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1447/
State Accepted, archived
Headers show

Comments

Simon Heimberg - April 18, 2013, 10:48 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1366322019 -7200
# Node ID 8530ae3ae4d4d3625efa3b1738d3b0f1c7b81555
# Parent  a3985f97aadad4c43b53377586a8f47274b4c2b3
mq: do not inherit settings form base repo in mqrepo (Fixes issue2358)

This is done by using repo.baseui when creating the queue repo.
Matt Mackall - April 18, 2013, 10:50 p.m.
On Fri, 2013-04-19 at 00:48 +0200, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1366322019 -7200
> # Node ID 8530ae3ae4d4d3625efa3b1738d3b0f1c7b81555
> # Parent  a3985f97aadad4c43b53377586a8f47274b4c2b3
> mq: do not inherit settings form base repo in mqrepo (Fixes issue2358)
> 
> This is done by using repo.baseui when creating the queue repo.

These are queued, thanks.

Patch

diff -r a3985f97aada -r 8530ae3ae4d4 hgext/mq.py
--- a/hgext/mq.py	Don Apr 18 23:53:24 2013 +0200
+++ b/hgext/mq.py	Don Apr 18 23:53:39 2013 +0200
@@ -297,7 +297,7 @@ 
     pass
 
 class queue(object):
-    def __init__(self, ui, path, patchdir=None):
+    def __init__(self, ui, baseui, path, patchdir=None):
         self.basepath = path
         try:
             fh = open(os.path.join(path, 'patches.queue'))
@@ -312,6 +312,7 @@ 
         self.path = patchdir or curpath
         self.opener = scmutil.opener(self.path)
         self.ui = ui
+        self.baseui = baseui
         self.applieddirty = False
         self.seriesdirty = False
         self.added = []
@@ -1774,9 +1775,7 @@ 
             return True
 
     def qrepo(self, create=False):
-        ui = self.ui.copy()
-        ui.setconfig('paths', 'default', '', overlay=False)
-        ui.setconfig('paths', 'default-push', '', overlay=False)
+        ui = self.baseui.copy()
         if create or os.path.isdir(self.join(".hg")):
             return hg.repository(ui, path=self.path, create=create)
 
@@ -2761,7 +2760,7 @@ 
         if not newpath:
             ui.warn(_("no saved queues found, please use -n\n"))
             return 1
-        mergeq = queue(ui, repo.path, newpath)
+        mergeq = queue(ui, repo.baseui, repo.path, newpath)
         ui.warn(_("merging with queue at: %s\n") % mergeq.path)
     ret = q.push(repo, patch, force=opts.get('force'), list=opts.get('list'),
                  mergeq=mergeq, all=opts.get('all'), move=opts.get('move'),
@@ -2795,7 +2794,7 @@ 
     opts = fixkeepchangesopts(ui, opts)
     localupdate = True
     if opts.get('name'):
-        q = queue(ui, repo.path, repo.join(opts.get('name')))
+        q = queue(ui, repo.baseui, repo.path, repo.join(opts.get('name')))
         ui.warn(_('using patch queue: %s\n') % q.path)
         localupdate = False
     else:
@@ -3413,7 +3412,7 @@ 
     class mqrepo(repo.__class__):
         @util.propertycache
         def mq(self):
-            return queue(self.ui, self.path)
+            return queue(self.ui, self.baseui, self.path)
 
         def abortifwdirpatched(self, errmsg, force=False):
             if self.mq.applied and not force: