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

login
register
mail settings
Submitter Iulian Stana
Date April 19, 2013, 9:58 a.m.
Message ID <dd87ba4bfe4071a8fbde.1366365509@doppler>
Download mbox | patch
Permalink /patch/1452/
State Changes Requested, archived
Headers show

Comments

Iulian Stana - April 19, 2013, 9:58 a.m.
# HG changeset patch
# User Iulian Stana <julian.stana@gmail.com>
# Date 1366315017 -10800
#      Thu Apr 18 22:56:57 2013 +0300
# Node ID dd87ba4bfe4071a8fbdebaa89e2636e30d43b625
# 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
Mads Kiilerich - April 19, 2013, 5:40 p.m.
On 04/19/2013 11:58 AM, Iulian Stana wrote:
> # HG changeset patch
> # User Iulian Stana <julian.stana@gmail.com>
> # Date 1366315017 -10800
> #      Thu Apr 18 22:56:57 2013 +0300
> # Node ID dd87ba4bfe4071a8fbdebaa89e2636e30d43b625
> # 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

I think it would be nice and helpful for reviewers if the description 
addressed a couple of questions:

* Why do we need this new style - in what way is it different from or 
similar to existing styles?
* Why do this need a new style - couldn't it be folded into an existing 
style?

The list of available styles is "documented" in 
mercurial/help/templates.txt - I assume this patch should add the new 
style there too.

(Adding the other missing style could be a subject for another patch.)

(It would be very nice to have a brief description of what the different 
styles are good for and in which way they are different. That could 
perhaps be a subject for a later patch.)

/Mads


>
> diff -r 4d5818e25c6d -r dd87ba4bfe40 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}\n{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 dd87ba4bfe40 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,22 @@
>   
>     $ 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:       draft
> +  user:        test
> +  date:        Thu Jan 01 00:00:05 1970 +0000
> +  summary:     e
> +
> +
> +
>   
>   -f, but no args
>   
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Matt Mackall - April 22, 2013, 8:13 p.m.
On Fri, 2013-04-19 at 12:58 +0300, Iulian Stana wrote:
> # HG changeset patch
> # User Iulian Stana <julian.stana@gmail.com>
> # Date 1366315017 -10800
> #      Thu Apr 18 22:56:57 2013 +0300
> # Node ID dd87ba4bfe4071a8fbdebaa89e2636e30d43b625
> # Parent  4d5818e25c6da500f3d2d67ffce47ea9662aa166
> log-style: add a log style that is default+phase (issues3436)

Extra 's' in 'issue'.

This field tells our BTS robot to mark the bug for testing, and it is
extremely unforgiving of human imperfection.

Patch

diff -r 4d5818e25c6d -r dd87ba4bfe40 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}\n{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 dd87ba4bfe40 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,22 @@ 
 
   $ 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:       draft
+  user:        test
+  date:        Thu Jan 01 00:00:05 1970 +0000
+  summary:     e
+  
+
+
 
 -f, but no args