[PATCH 1 of 6 V2] commands: add ui.statuscopies config knob
mathias.demare at gmail.com
mathias.demare at gmail.com
Tue Apr 7 19:00:47 UTC 2015
# HG changeset patch
# User Mathias De Maré <mathias.demare at gmail.com>
# Date 1427228757 -3600
# Tue Mar 24 21:25:57 2015 +0100
# Node ID 953040f303b16578919e465aa2a46533990a46ae
# Parent b2fb1403994e033584aed8a487ab162a9d75fa80
commands: add ui.statuscopies config knob
statuscopies enables viewing of copies and moves in 'hg status' by default.
diff -r b2fb1403994e -r 953040f303b1 mercurial/commands.py
--- a/mercurial/commands.py Mon Apr 06 17:16:55 2015 -0500
+++ b/mercurial/commands.py Tue Mar 24 21:25:57 2015 +0100
@@ -5794,7 +5794,8 @@
opts.get('subrepos'))
changestates = zip(states, 'MAR!?IC', stat)
- if (opts.get('all') or opts.get('copies')) and not opts.get('no_status'):
+ if (opts.get('all') or opts.get('copies') \
+ or ui.configbool('ui', 'statuscopies')) and not opts.get('no_status'):
copy = copies.pathcopies(repo[node1], repo[node2])
fm = ui.formatter('status', opts)
diff -r b2fb1403994e -r 953040f303b1 mercurial/help/config.txt
--- a/mercurial/help/config.txt Mon Apr 06 17:16:55 2015 -0500
+++ b/mercurial/help/config.txt Tue Mar 24 21:25:57 2015 +0100
@@ -1432,6 +1432,9 @@
backslash character (``\``)).
Default is False.
+``statuscopies``
+ Display copies in the status command.
+
``ssh``
command to use for SSH connections. Default is ``ssh``.
diff -r b2fb1403994e -r 953040f303b1 mercurial/ui.py
--- a/mercurial/ui.py Mon Apr 06 17:16:55 2015 -0500
+++ b/mercurial/ui.py Tue Mar 24 21:25:57 2015 +0100
@@ -158,7 +158,7 @@
if self.plain():
for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
- 'logtemplate', 'style',
+ 'logtemplate', 'statuscopies', 'style',
'traceback', 'verbose'):
if k in cfg['ui']:
del cfg['ui'][k]
diff -r b2fb1403994e -r 953040f303b1 tests/test-status.t
--- a/tests/test-status.t Mon Apr 06 17:16:55 2015 -0500
+++ b/tests/test-status.t Tue Mar 24 21:25:57 2015 +0100
@@ -438,6 +438,15 @@
b
R b
+using ui.statuscopies setting
+ $ hg st --config ui.statuscopies=true
+ M a
+ b
+ R b
+ $ hg st --config ui.statuscopies=false
+ M a
+ R b
+
Other "bug" highlight, the revision status does not report the copy information.
This is buggy behavior.
More information about the Mercurial-devel
mailing list