Patchwork [5,of,5] templates-default: display p1rev/p1node with "+" suffix for workingctx

login
register
mail settings
Submitter Yuya Nishihara
Date April 7, 2015, 2:07 p.m.
Message ID <c0eabd6995032b111a67.1428415663@mimosa>
Download mbox | patch
Permalink /patch/8534/
State Changes Requested
Headers show

Comments

Yuya Nishihara - April 7, 2015, 2:07 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1426333001 -32400
#      Sat Mar 14 20:36:41 2015 +0900
# Node ID c0eabd6995032b111a677714330f95a82c0cf254
# Parent  64dbe8bab8efdde40c241b658b606ef8cee849a1
templates-default: display p1rev/p1node with "+" suffix for workingctx
Pierre-Yves David - April 7, 2015, 6:34 p.m.
On 04/07/2015 07:07 AM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1426333001 -32400
> #      Sat Mar 14 20:36:41 2015 +0900
> # Node ID c0eabd6995032b111a677714330f95a82c0cf254
> # Parent  64dbe8bab8efdde40c241b658b606ef8cee849a1
> templates-default: display p1rev/p1node with "+" suffix for workingctx

Your description is too short for me to have an idea of what is going on 
here.

I'm dropping this series I'll lets Sean and You discuss it until you 
reached a consensus on a V2.
Sean Farley - April 7, 2015, 6:38 p.m.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:

> On 04/07/2015 07:07 AM, Yuya Nishihara wrote:
>> # HG changeset patch
>> # User Yuya Nishihara <yuya@tcha.org>
>> # Date 1426333001 -32400
>> #      Sat Mar 14 20:36:41 2015 +0900
>> # Node ID c0eabd6995032b111a677714330f95a82c0cf254
>> # Parent  64dbe8bab8efdde40c241b658b606ef8cee849a1
>> templates-default: display p1rev/p1node with "+" suffix for workingctx
>
> Your description is too short for me to have an idea of what is going on 
> here.
>
> I'm dropping this series I'll lets Sean and You discuss it until you 
> reached a consensus on a V2.

Patch 4 looked safe but the rest of the series would look very different
if we change how wdir() {manifest} / {node} output.
Pierre-Yves David - April 7, 2015, 6:40 p.m.
On 04/07/2015 11:38 AM, Sean Farley wrote:
>
> Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:
>
>> On 04/07/2015 07:07 AM, Yuya Nishihara wrote:
>>> # HG changeset patch
>>> # User Yuya Nishihara <yuya@tcha.org>
>>> # Date 1426333001 -32400
>>> #      Sat Mar 14 20:36:41 2015 +0900
>>> # Node ID c0eabd6995032b111a677714330f95a82c0cf254
>>> # Parent  64dbe8bab8efdde40c241b658b606ef8cee849a1
>>> templates-default: display p1rev/p1node with "+" suffix for workingctx
>>
>> Your description is too short for me to have an idea of what is going on
>> here.
>>
>> I'm dropping this series I'll lets Sean and You discuss it until you
>> reached a consensus on a V2.
>
> Patch 4 looked safe but the rest of the series would look very different
> if we change how wdir() {manifest} / {node} output.

Patch 4 is actually pushed, I forgot to mention it in this message.

Patch

diff --git a/mercurial/templates/map-cmdline.default b/mercurial/templates/map-cmdline.default
--- a/mercurial/templates/map-cmdline.default
+++ b/mercurial/templates/map-cmdline.default
@@ -29,19 +29,22 @@  lfile_copies_switch = '{if(file_copies_s
 
 # General templates
 cset = '{label("log.changeset changeset.{phase}",
-               "changeset:   {rev}:{node|short}")}\n'
+               "changeset:   {if(node, '{rev}:{node|short}',
+                                       '{p1rev}:{p1node|short}+')}")}\n'
 
 lphase = '{label("log.phase",
                  "phase:       {phase}")}\n'
 
 fullcset = '{label("log.changeset changeset.{phase}",
-                   "changeset:   {rev}:{node}")}\n'
+                   "changeset:   {if(node, '{rev}:{node}',
+                                           '{p1rev}:{p1node}+')")}\n'
 
 parent = '{label("log.parent changeset.{phase}",
                   "parent:      {rev}:{node|formatnode}")}\n'
 
 lnode = '{label("log.node",
-                "{rev}:{node|short}")}\n'
+                "{if(node, '{rev}:{node|short}',
+                           '{p1rev}:{p1node|short}+')")}\n'
 
 manifest = '{label("ui.debug log.manifest",
                    "manifest:    {rev}:{node}")}\n'
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -128,6 +128,26 @@  Default style is like normal output:
   $ hg log --debug --style default > style.out
   $ cmp log.out style.out || diff -u log.out style.out
 
+Default style of working-directory revision should also be the same (but
+date may change while running tests):
+
+  $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
+  $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
+  $ cmp log.out style.out || diff -u log.out style.out
+
+  $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
+  $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
+  $ cmp log.out style.out || diff -u log.out style.out
+
+  $ hg log -r 'wdir()' -q > log.out
+  $ hg log -r 'wdir()' -q --style default > style.out
+  $ cmp log.out style.out || diff -u log.out style.out
+
+  $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
+  $ hg log -r 'wdir()' --debug --style default \
+  > | sed 's|^date:.*|date:|' > style.out
+  $ cmp log.out style.out || diff -u log.out style.out
+
 Default style should also preserve color information (issue2866):
 
   $ cp $HGRCPATH $HGRCPATH-bak