Patchwork [07,of,10] mq: do not inherit settings form base repo in mqrepo

login
register
mail settings
Submitter Simon Heimberg
Date March 22, 2013, 1:20 a.m.
Message ID <edcf5f72fdb5621bf6c1.1363915257@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1160/
State Changes Requested, archived
Headers show

Comments

Simon Heimberg - March 22, 2013, 1:20 a.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1363886209 -3600
# Node ID edcf5f72fdb5621bf6c1c8074ea66428932f0f96
# Parent  01d17e4dac6c2b84106e38448820844c0fb62eea
mq: do not inherit settings form base repo in mqrepo

This is done by using repo.baseui when creating the queue repo.
Matt Mackall - April 18, 2013, 3:01 a.m.
On Fri, 2013-03-22 at 02:20 +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1363886209 -3600
> # Node ID edcf5f72fdb5621bf6c1c8074ea66428932f0f96
> # Parent  01d17e4dac6c2b84106e38448820844c0fb62eea
> mq: do not inherit settings form base repo in mqrepo

This looks sane enough. Queued for default, thanks.
Simon Heimberg - April 18, 2013, 9:15 p.m.
On Wed, 2013-04-17, 22:01 -0500, Matt Mackall wrote::
> On Fri, 2013-03-22 at 02:20 +0100, Simon Heimberg wrote:
> > # HG changeset patch
> > # User Simon Heimberg <simohe@besonet.ch>
> > # Date 1363886209 -3600
> > # Node ID edcf5f72fdb5621bf6c1c8074ea66428932f0f96
> > # Parent  01d17e4dac6c2b84106e38448820844c0fb62eea
> > mq: do not inherit settings form base repo in mqrepo
> 
> This looks sane enough. Queued for default, thanks.
> 
This will fail when color extension is enabled also. Some tests will
fail. Something like patch 6 must be applied first.
I have reworked [Patch 06 of 10] and split into several smaller ones. I
will send it (even when code freeze is soon).

Greetings,
simohe
Matt Mackall - April 18, 2013, 9:42 p.m.
On Thu, 2013-04-18 at 23:15 +0200, Simon Heimberg wrote:
> On Wed, 2013-04-17, 22:01 -0500, Matt Mackall wrote::
> > On Fri, 2013-03-22 at 02:20 +0100, Simon Heimberg wrote:
> > > # HG changeset patch
> > > # User Simon Heimberg <simohe@besonet.ch>
> > > # Date 1363886209 -3600
> > > # Node ID edcf5f72fdb5621bf6c1c8074ea66428932f0f96
> > > # Parent  01d17e4dac6c2b84106e38448820844c0fb62eea
> > > mq: do not inherit settings form base repo in mqrepo
> > 
> > This looks sane enough. Queued for default, thanks.
> > 
> This will fail when color extension is enabled also. Some tests will
> fail. Something like patch 6 must be applied first.
> I have reworked [Patch 06 of 10] and split into several smaller ones. I
> will send it (even when code freeze is soon).

Code freeze is about a day late. Please wait for May 1.

Patch

diff -r 01d17e4dac6c -r edcf5f72fdb5 hgext/mq.py
--- a/hgext/mq.py	Don Mär 21 18:16:49 2013 +0100
+++ b/hgext/mq.py	Don Mär 21 18:16:49 2013 +0100
@@ -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: