Patchwork log-style: add a log style that is default+phase (issues3436)

login
register
mail settings
Submitter Iulian Stana
Date April 18, 2013, 7:59 p.m.
Message ID <ed12e3f8ebf5159b0800.1366315199@doppler>
Download mbox | patch
Permalink /patch/1439/
State Changes Requested, archived
Headers show

Comments

Iulian Stana - April 18, 2013, 7:59 p.m.
# HG changeset patch
# User Iulian Stana <julian.stana@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
Matt Mackall - April 18, 2013, 10:45 p.m.
On Thu, 2013-04-18 at 22:59 +0300, Iulian Stana wrote:

> +  $ 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

I see a problem?

Patch

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