Patchwork [4,of,6,V2] ui: add ui.statuscopies to progressive mode

login
register
mail settings
Submitter Mathias De Maré
Date April 7, 2015, 7 p.m.
Message ID <44f6145dde0d844a019c.1428433250@mathias-Latitude-E6540>
Download mbox | patch
Permalink /patch/8546/
State Changes Requested
Headers show

Comments

Mathias De Maré - April 7, 2015, 7 p.m.
# HG changeset patch
# User Mathias De Maré <mathias.demare@gmail.com>
# Date 1427229699 -3600
#      Tue Mar 24 21:41:39 2015 +0100
# Node ID 44f6145dde0d844a019c968a6bc5eeddadec533e
# Parent  29f1d521db03dea5d14aa4d3cbd6705e038849d5
ui: add ui.statuscopies to progressive mode
Matt Mackall - April 8, 2015, 7:34 p.m.
On Tue, 2015-04-07 at 21:00 +0200, mathias.demare@gmail.com wrote:
> # HG changeset patch
> # User Mathias De Maré <mathias.demare@gmail.com>
> # Date 1427229699 -3600
> #      Tue Mar 24 21:41:39 2015 +0100
> # Node ID 44f6145dde0d844a019c968a6bc5eeddadec533e
> # Parent  29f1d521db03dea5d14aa4d3cbd6705e038849d5
> ui: add ui.statuscopies to progressive mode
> 
> diff -r 29f1d521db03 -r 44f6145dde0d mercurial/ui.py
> --- a/mercurial/ui.py	Mon Apr 06 21:34:43 2015 +0200
> +++ b/mercurial/ui.py	Tue Mar 24 21:41:39 2015 +0100
> @@ -483,6 +483,9 @@
>          if not self.progressive():
>              return
>  
> +        if not self.hasconfig('ui', 'statuscopies'):
> +            self.setconfig('ui', 'statuscopies', 'True')

We should generally try to avoid this setconfig hack. Here, this
probably wants to just be a ui.progressive() check in status.

Patch

diff -r 29f1d521db03 -r 44f6145dde0d mercurial/ui.py
--- a/mercurial/ui.py	Mon Apr 06 21:34:43 2015 +0200
+++ b/mercurial/ui.py	Tue Mar 24 21:41:39 2015 +0100
@@ -483,6 +483,9 @@ 
         if not self.progressive():
             return
 
+        if not self.hasconfig('ui', 'statuscopies'):
+            self.setconfig('ui', 'statuscopies', 'True')
+
     def plain(self, feature=None):
         '''is plain mode active?
 
diff -r 29f1d521db03 -r 44f6145dde0d tests/test-status.t
--- a/tests/test-status.t	Mon Apr 06 21:34:43 2015 +0200
+++ b/tests/test-status.t	Tue Mar 24 21:41:39 2015 +0100
@@ -446,6 +446,10 @@ 
   $ hg st --config ui.statuscopies=false
   M a
   R b
+  $ hg st --config ui.progressive=true
+  M a
+    b
+  R b
 
 Other "bug" highlight, the revision status does not report the copy information.
 This is buggy behavior.