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

login
register
mail settings
Submitter Iulian Stana
Date April 24, 2013, 8:58 p.m.
Message ID <02ee7595c388456d4079.1366837102@doppler>
Download mbox | patch
Permalink /patch/1478/
State Accepted, archived
Headers show

Comments

Iulian Stana - April 24, 2013, 8:58 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 02ee7595c388456d4079c2ba1b7972895eb76562
# Parent  974f7dab5533feaa46aec5970d40a0f94f77175e
log-style: add a log style that is default+phase (issue3436)


There is a new style called phases style.
Usage::
    hg log --style phases

Why do we need this new style - in what way is it different from or similar to
existing styles?
The new style is default + phases information. With the new phases feature the
users exhibited their desire for a new style that could help them.

Why do this need a new style - couldn't it be folded into an existing style?
The default style and the new one are about the same, the difference is the
phases tag. The users find both styles useful, this means that the both styles
must exist.
Matt Mackall - April 26, 2013, 5:33 p.m.
On Wed, 2013-04-24 at 23: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 02ee7595c388456d4079c2ba1b7972895eb76562
> # Parent  974f7dab5533feaa46aec5970d40a0f94f77175e
> log-style: add a log style that is default+phase (issue3436)

This looks good, thanks. Augie, please queue this in your GSoC queue.
Augie Fackler - April 26, 2013, 9:23 p.m.
On Fri, Apr 26, 2013 at 12:33:23PM -0500, Matt Mackall wrote:
> On Wed, 2013-04-24 at 23: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 02ee7595c388456d4079c2ba1b7972895eb76562
> > # Parent  974f7dab5533feaa46aec5970d40a0f94f77175e
> > log-style: add a log style that is default+phase (issue3436)
>
> This looks good, thanks. Augie, please queue this in your GSoC queue.


Queued.

>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/help/templates.txt b/mercurial/help/templates.txt
--- a/mercurial/help/templates.txt
+++ b/mercurial/help/templates.txt
@@ -6,8 +6,8 @@ 
 You can customize output for any "log-like" command: log,
 outgoing, incoming, tip, parents, heads and glog.
 
-Four styles are packaged with Mercurial: default (the style used
-when no explicit preference is passed), compact, changelog,
+Five styles are packaged with Mercurial: default (the style used
+when no explicit preference is passed), compact, changelog, phases
 and xml.
 Usage::
 
diff --git a/mercurial/templates/map-cmdline.default b/mercurial/templates/map-cmdline.phases
copy from mercurial/templates/map-cmdline.default
copy to mercurial/templates/map-cmdline.phases
--- a/mercurial/templates/map-cmdline.default
+++ b/mercurial/templates/map-cmdline.phases
@@ -1,4 +1,4 @@ 
-changeset = 'changeset:   {rev}:{node|short}\n{branches}{bookmarks}{tags}{parents}user:        {author}\ndate:        {date|date}\nsummary:     {desc|firstline}\n\n'
+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'
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -88,9 +88,20 @@ 
 
   $ 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