[PATCH] log-style: add a log style that is default+phase (issues3436)

Iulian Stana julian.stana at gmail.com
Thu Apr 18 14:59:59 CDT 2013


# HG changeset patch
# User Iulian Stana <julian.stana at gmail.com>
# Date 1366315017 -10800
#      Thu Apr 18 22:56:57 2013 +0300
# Node ID ed12e3f8ebf5159b0800fe9f507b660ed4201faa
# Parent  4d5818e25c6da500f3d2d67ffce47ea9662aa166
log-style: add a log style that is default+phase (issues3436)

There is a new file, map-cmdline.phases, that contain the template of the new
style.

In the test-log.t file there is a test that prove the working of this style

diff -r 4d5818e25c6d -r ed12e3f8ebf5 mercurial/templates/map-cmdline.phases
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/templates/map-cmdline.phases	Thu Apr 18 22:56:57 2013 +0300
@@ -0,0 +1,25 @@
+changeset = 'changeset:   {rev}:{node|short}\n{branches}{bookmarks}{tags}phase:       {phase}{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}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'
+start_file_mods = 'files:      '
+file_mod = ' {file_mod}'
+end_file_mods = '\n'
+start_file_adds = 'files+:     '
+file_add = ' {file_add}'
+end_file_adds = '\n'
+start_file_dels = 'files-:     '
+file_del = ' {file_del}'
+end_file_dels = '\n'
+start_file_copies = 'copies:     '
+file_copy = ' {name} ({source})'
+end_file_copies = '\n'
+parent = 'parent:      {rev}:{node|formatnode}\n'
+manifest = 'manifest:    {rev}:{node}\n'
+branch = 'branch:      {branch}\n'
+tag = 'tag:         {tag}\n'
+bookmark = 'bookmark:    {bookmark}\n'
+extra = 'extra:       {key}={value|stringescape}\n'
diff -r 4d5818e25c6d -r ed12e3f8ebf5 tests/test-log.t
--- a/tests/test-log.t	Thu Apr 18 22:21:38 2013 +0300
+++ b/tests/test-log.t	Thu Apr 18 22:56:57 2013 +0300
@@ -88,9 +88,21 @@
 
   $ hg log -f -l1 --style something
   abort: style 'something' not found 
-  (available styles: changelog, bisect, default, xml, compact)
+  (available styles: changelog, bisect, default, xml, phases, compact)
   [255]
 
+-f, phases style
+
+
+  $ hg log -f -l1 --style phases
+  changeset:   4:7e4639b4691b
+  tag:         tip
+  phase:       draftuser:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     e
+  
+
+
 
 -f, but no args
 


More information about the Mercurial-devel mailing list