Patchwork [3,of,6] log: do not hide the public phase in debug mode (BC)

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Oct. 5, 2014, 1:05 a.m.
Message ID <c28167265129cb945c2f.1412471152@Iris>
Download mbox | patch
Permalink /patch/6124/
State Accepted
Commit 55dcc7fb731c2cdaae06a2f130480d668e2e7e80
Headers show

Comments

Jordi Gutiérrez Hermoso - Oct. 5, 2014, 1:05 a.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1412454508 14400
#      Sat Oct 04 16:28:28 2014 -0400
# Node ID c28167265129cb945c2f0967c2a9bc89cbaa6fa9
# Parent  12236d889c04329a1e165869daacc3213a60dcc1
log: do not hide the public phase in debug mode (BC)

When 51fc43253a52 introduced phases to the `hg log --debug` output, it
also disabled outputting public phase. At the same time, it always
shows phases in the default template, `hg log --debug -T default`.
Those two should produce the same output, but they don't.

I think it makes a lot more sense to always show all phases. There's
already loss of backwards compatibility in this case when using a
newer hg on an old hg repo, since draft commits will show up in the
output of `hg log --debug`.

Finally, I just don't think that any sort of information should be
hidden with --debug. This flag should be about showing as much
information as possible.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -916,7 +916,7 @@  class changeset_printer(object):
             # i18n: column positioning for "hg log"
             self.ui.write(_("tag:         %s\n") % tag,
                           label='log.tag')
-        if self.ui.debugflag and ctx.phase():
+        if self.ui.debugflag:
             # i18n: column positioning for "hg log"
             self.ui.write(_("phase:       %s\n") % _(ctx.phasestr()),
                           label='log.phase')
diff --git a/tests/test-alias.t b/tests/test-alias.t
--- a/tests/test-alias.t
+++ b/tests/test-alias.t
@@ -208,6 +208,7 @@  properly recursive
 
   $ hg dln
   changeset:   -1:0000000000000000000000000000000000000000
+  phase:       public
   parent:      -1:0000000000000000000000000000000000000000
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    -1:0000000000000000000000000000000000000000
diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t
--- a/tests/test-globalopts.t
+++ b/tests/test-globalopts.t
@@ -234,6 +234,7 @@  Testing --debug:
   $ hg --cwd c log --debug
   changeset:   1:b6c483daf2907ce5825c0bb50f5716226281cc1a
   tag:         tip
+  phase:       public
   parent:      -1:0000000000000000000000000000000000000000
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    1:23226e7a252cacdc2d99e4fbdc3653441056de49
@@ -246,6 +247,7 @@  Testing --debug:
   
   
   changeset:   0:8580ff50825a50c8f716709acdf8de0deddcd6ab
+  phase:       public
   parent:      -1:0000000000000000000000000000000000000000
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
diff --git a/tests/test-phases.t b/tests/test-phases.t
--- a/tests/test-phases.t
+++ b/tests/test-phases.t
@@ -340,6 +340,7 @@  test that phase are displayed in log at 
   
   
   changeset:   1:27547f69f25460a52fff66ad004e58da7ad3fb56
+  phase:       public
   parent:      0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
@@ -352,6 +353,7 @@  test that phase are displayed in log at 
   
   
   changeset:   0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
+  phase:       public
   parent:      -1:0000000000000000000000000000000000000000
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83