changeset 15907:51fc43253a52

changeset_printer: display changeset phase on debug level Backward compatibility make it hard to display it on higher level
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 17 Jan 2012 20:23:23 +0100
parents aad565319fa3
children 60cb4f381a78
files mercurial/cmdutil.py mercurial/templates/map-cmdline.default tests/test-graft.t tests/test-newbranch.t tests/test-phases.t
diffstat 5 files changed, 114 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Jan 17 20:43:41 2012 +0100
+++ b/mercurial/cmdutil.py	Tue Jan 17 20:23:23 2012 +0100
@@ -672,6 +672,9 @@
         for tag in self.repo.nodetags(changenode):
             self.ui.write(_("tag:         %s\n") % tag,
                           label='log.tag')
+        if self.ui.debugflag and ctx.phase():
+            self.ui.write(_("phase:       %s\n") % _(ctx.phasestr()),
+                          label='log.phase')
         for parent in parents:
             self.ui.write(_("parent:      %d:%s\n") % parent,
                           label='log.parent')
--- a/mercurial/templates/map-cmdline.default	Tue Jan 17 20:43:41 2012 +0100
+++ b/mercurial/templates/map-cmdline.default	Tue Jan 17 20:23:23 2012 +0100
@@ -1,7 +1,7 @@
 changeset = 'changeset:   {rev}:{node|short}\n{branches}{bookmarks}{tags}{parents}user:        {author}\ndate:        {date|date}\nsummary:     {desc|firstline}\n\n'
 changeset_quiet = '{rev}:{node|short}\n'
 changeset_verbose = 'changeset:   {rev}:{node|short}\n{branches}{bookmarks}{tags}{parents}user:        {author}\ndate:        {date|date}\n{files}{file_copies_switch}description:\n{desc|strip}\n\n\n'
-changeset_debug = 'changeset:   {rev}:{node}\n{branches}{bookmarks}{tags}{parents}{manifest}user:        {author}\ndate:        {date|date}\n{file_mods}{file_adds}{file_dels}{file_copies_switch}{extras}description:\n{desc|strip}\n\n\n'
+changeset_debug = 'changeset:   {rev}:{node}\n{branches}{bookmarks}{tags}phase:       {phase}\n{parents}{manifest}user:        {author}\ndate:        {date|date}\n{file_mods}{file_adds}{file_dels}{file_copies_switch}{extras}description:\n{desc|strip}\n\n\n'
 start_files = 'files:      '
 file = ' {file}'
 end_files = '\n'
--- a/tests/test-graft.t	Tue Jan 17 20:43:41 2012 +0100
+++ b/tests/test-graft.t	Tue Jan 17 20:23:23 2012 +0100
@@ -72,6 +72,7 @@
   $ hg log --debug -r tip
   changeset:   7:d2e44c99fd3f31c176ea4efb9eca9f6306c81756
   tag:         tip
+  phase:       draft
   parent:      0:68795b066622ca79a25816a662041d8f78f3cd9e
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    7:5d59766436fd8fbcd38e7bebef0f6eaf3eebe637
@@ -222,6 +223,7 @@
   $ hg log --debug -r tip
   changeset:   13:39bb1d13572759bd1e6fc874fed1b12ece047a18
   tag:         tip
+  phase:       draft
   parent:      12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    13:0780e055d8f4cd12eadd5a2719481648f336f7a9
--- a/tests/test-newbranch.t	Tue Jan 17 20:43:41 2012 +0100
+++ b/tests/test-newbranch.t	Tue Jan 17 20:23:23 2012 +0100
@@ -130,6 +130,7 @@
   changeset:   4:adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6
   branch:      foo
   tag:         tip
+  phase:       draft
   parent:      1:6c0e42da283a56b5edc5b4fadb491365ec7f5fa8
   parent:      -1:0000000000000000000000000000000000000000
   manifest:    1:8c342a37dfba0b3d3ce073562a00d8a813c54ffe
--- a/tests/test-phases.t	Tue Jan 17 20:43:41 2012 +0100
+++ b/tests/test-phases.t	Tue Jan 17 20:23:23 2012 +0100
@@ -190,6 +190,113 @@
   5 2 H
   7 2 merge B' and E
 
+test that phase are displayed in log at debug level
+
+  $ hg log --debug
+  changeset:   7:17a481b3bccb796c0521ae97903d81c52bfee4af
+  tag:         tip
+  phase:       secret
+  parent:      6:cf9fe039dfd67e829edf6522a45de057b5c86519
+  parent:      4:a603bfb5a83e312131cebcd05353c217d4d21dde
+  manifest:    7:5e724ffacba267b2ab726c91fc8b650710deaaa8
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      C D E
+  extra:       branch=default
+  description:
+  merge B' and E
+  
+  
+  changeset:   6:cf9fe039dfd67e829edf6522a45de057b5c86519
+  phase:       draft
+  parent:      1:27547f69f25460a52fff66ad004e58da7ad3fb56
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      B'
+  extra:       branch=default
+  description:
+  B'
+  
+  
+  changeset:   5:a030c6be5127abc010fcbff1851536552e6951a8
+  phase:       secret
+  parent:      4:a603bfb5a83e312131cebcd05353c217d4d21dde
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      H
+  extra:       branch=default
+  description:
+  H
+  
+  
+  changeset:   4:a603bfb5a83e312131cebcd05353c217d4d21dde
+  phase:       secret
+  parent:      3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      E
+  extra:       branch=default
+  description:
+  E
+  
+  
+  changeset:   3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
+  phase:       draft
+  parent:      2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      D
+  extra:       branch=default
+  description:
+  D
+  
+  
+  changeset:   2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
+  phase:       draft
+  parent:      1:27547f69f25460a52fff66ad004e58da7ad3fb56
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    2:66a5a01817fdf5239c273802b5b7618d051c89e4
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      C
+  extra:       branch=default
+  description:
+  C
+  
+  
+  changeset:   1:27547f69f25460a52fff66ad004e58da7ad3fb56
+  parent:      0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      B
+  extra:       branch=default
+  description:
+  B
+  
+  
+  changeset:   0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
+  parent:      -1:0000000000000000000000000000000000000000
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files+:      A
+  extra:       branch=default
+  description:
+  A
+  
+  
+
 Test phase command
 ===================