Patchwork [2,of,2] debug: pass debug flag to remote ui object

login
register
mail settings
Submitter Eric Sumner
Date April 14, 2015, 8:32 p.m.
Message ID <b10599cba2adb8bf281e.1429043549@waste.org>
Download mbox | patch
Permalink /patch/8669/
State Changes Requested
Delegated to: Augie Fackler
Headers show

Comments

Eric Sumner - April 14, 2015, 8:32 p.m.
# HG changeset patch
# User Eric Sumner <ericsumner@fb.com>
# Date 1429043033 14400
#      Tue Apr 14 16:23:53 2015 -0400
# Node ID b10599cba2adb8bf281ea9c913d6f235780618bf
# Parent  b30cb32ea6821e165aab65051767aa810fdb8464
debug: pass debug flag to remote ui object

When we're talking to another repository, --debug shows more information than
setting ui.debug=True inside .hg/hgrc; this patch adds ui.debug to the config
options that get copied into the new UI object for remote repos
Pierre-Yves David - April 15, 2015, 4:27 a.m.
On 04/14/2015 04:32 PM, Eric Sumner wrote:
> # HG changeset patch
> # User Eric Sumner <ericsumner@fb.com>
> # Date 1429043033 14400
> #      Tue Apr 14 16:23:53 2015 -0400
> # Node ID b10599cba2adb8bf281ea9c913d6f235780618bf
> # Parent  b30cb32ea6821e165aab65051767aa810fdb8464
> debug: pass debug flag to remote ui object
>
> When we're talking to another repository, --debug shows more information than
> setting ui.debug=True inside .hg/hgrc; this patch adds ui.debug to the config
> options that get copied into the new UI object for remote repos

Eric managed to convinces me that the "remote" is a small object that 
exit in the "local" world, it does not read the other repo 
configuration. So it make sense to reuse some of the local config (and 
actually already to it). However, this mean we should also copy other ui 
flag like 'verbose' or 'quiet'. I'm expecting a V2 with those, and some 
testing.
Matt Mackall - April 16, 2015, 11:39 p.m.
On Wed, 2015-04-15 at 00:27 -0400, Pierre-Yves David wrote:
> 
> On 04/14/2015 04:32 PM, Eric Sumner wrote:
> > # HG changeset patch
> > # User Eric Sumner <ericsumner@fb.com>
> > # Date 1429043033 14400
> > #      Tue Apr 14 16:23:53 2015 -0400
> > # Node ID b10599cba2adb8bf281ea9c913d6f235780618bf
> > # Parent  b30cb32ea6821e165aab65051767aa810fdb8464
> > debug: pass debug flag to remote ui object
> >
> > When we're talking to another repository, --debug shows more information than
> > setting ui.debug=True inside .hg/hgrc; this patch adds ui.debug to the config
> > options that get copied into the new UI object for remote repos
> 
> Eric managed to convinces me that the "remote" is a small object that 
> exit in the "local" world, it does not read the other repo 
> configuration. So it make sense to reuse some of the local config (and 
> actually already to it). However, this mean we should also copy other ui 
> flag like 'verbose' or 'quiet'. I'm expecting a V2 with those, and some 
> testing.

This is odd. The way I'd expect this to work is:

- user adds --debug
- "global" ui gets created with debug set
- "repo" ui gets created based on global ui, inherits debug
- "remote" ui gets created based on global ui, inherits debug

If that's not working, then we should figure out why not.
Pierre-Yves David - April 17, 2015, 8:31 a.m.
On 04/16/2015 07:39 PM, Matt Mackall wrote:
> On Wed, 2015-04-15 at 00:27 -0400, Pierre-Yves David wrote:
>>
>> On 04/14/2015 04:32 PM, Eric Sumner wrote:
>>> # HG changeset patch
>>> # User Eric Sumner <ericsumner@fb.com>
>>> # Date 1429043033 14400
>>> #      Tue Apr 14 16:23:53 2015 -0400
>>> # Node ID b10599cba2adb8bf281ea9c913d6f235780618bf
>>> # Parent  b30cb32ea6821e165aab65051767aa810fdb8464
>>> debug: pass debug flag to remote ui object
>>>
>>> When we're talking to another repository, --debug shows more information than
>>> setting ui.debug=True inside .hg/hgrc; this patch adds ui.debug to the config
>>> options that get copied into the new UI object for remote repos
>>
>> Eric managed to convinces me that the "remote" is a small object that
>> exit in the "local" world, it does not read the other repo
>> configuration. So it make sense to reuse some of the local config (and
>> actually already to it). However, this mean we should also copy other ui
>> flag like 'verbose' or 'quiet'. I'm expecting a V2 with those, and some
>> testing.
>
> This is odd. The way I'd expect this to work is:
>
> - user adds --debug
> - "global" ui gets created with debug set
> - "repo" ui gets created based on global ui, inherits debug
> - "remote" ui gets created based on global ui, inherits debug
>
> If that's not working, then we should figure out why not.

Eric's case is where ui.debug=True is set in the local repo.
Matt Mackall - April 17, 2015, 3:08 p.m.
On Fri, 2015-04-17 at 04:31 -0400, Pierre-Yves David wrote:
> 
> On 04/16/2015 07:39 PM, Matt Mackall wrote:
> > On Wed, 2015-04-15 at 00:27 -0400, Pierre-Yves David wrote:
> >>
> >> On 04/14/2015 04:32 PM, Eric Sumner wrote:
> >>> # HG changeset patch
> >>> # User Eric Sumner <ericsumner@fb.com>
> >>> # Date 1429043033 14400
> >>> #      Tue Apr 14 16:23:53 2015 -0400
> >>> # Node ID b10599cba2adb8bf281ea9c913d6f235780618bf
> >>> # Parent  b30cb32ea6821e165aab65051767aa810fdb8464
> >>> debug: pass debug flag to remote ui object
> >>>
> >>> When we're talking to another repository, --debug shows more information than
> >>> setting ui.debug=True inside .hg/hgrc; this patch adds ui.debug to the config
> >>> options that get copied into the new UI object for remote repos
> >>
> >> Eric managed to convinces me that the "remote" is a small object that
> >> exit in the "local" world, it does not read the other repo
> >> configuration. So it make sense to reuse some of the local config (and
> >> actually already to it). However, this mean we should also copy other ui
> >> flag like 'verbose' or 'quiet'. I'm expecting a V2 with those, and some
> >> testing.
> >
> > This is odd. The way I'd expect this to work is:
> >
> > - user adds --debug
> > - "global" ui gets created with debug set
> > - "repo" ui gets created based on global ui, inherits debug
> > - "remote" ui gets created based on global ui, inherits debug
> >
> > If that's not working, then we should figure out why not.
> 
> Eric's case is where ui.debug=True is set in the local repo.

I see. I think this is more trouble than it's worth.

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -691,4 +691,9 @@ 
     elif v:
         dst.setconfig('web', 'cacerts', util.expandpath(v), 'copied')
 
+    # copy debug flag
+    r = src.config('ui', 'debug')
+    if r:
+        dst.setconfig('ui', 'debug', r, 'copied')
+
     return dst