Patchwork log: use correct phase info for parent field (issue4347)

login
register
mail settings
Submitter Sean Farley
Date Aug. 23, 2014, 10:03 p.m.
Message ID <277808d61336777372fb.1408831415@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/5565/
State Accepted
Commit f6371cc62d2ac9f719df3c0fd8631f2271c8c0b5
Headers show

Comments

Sean Farley - Aug. 23, 2014, 10:03 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1408831388 18000
#      Sat Aug 23 17:03:08 2014 -0500
# Branch stable
# Node ID 277808d61336777372fbe054708ab857bbf72fb1
# Parent  510cafe720043af3d0c11b4b70345b63b54d17b1
log: use correct phase info for parent field (issue4347)

Previously, there was a copy / paste error with using the current changeset's
phase information. We now look up the parent context explicitly.

The line was too long so it is stored into a variable first.
Pierre-Yves David - Aug. 24, 2014, 11:23 a.m.
On 08/23/2014 03:03 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley@gmail.com>
> # Date 1408831388 18000
> #      Sat Aug 23 17:03:08 2014 -0500
> # Branch stable
> # Node ID 277808d61336777372fbe054708ab857bbf72fb1
> # Parent  510cafe720043af3d0c11b4b70345b63b54d17b1
> log: use correct phase info for parent field (issue4347)
>
> Previously, there was a copy / paste error with using the current changeset's
> phase information. We now look up the parent context explicitly.

Could you add a tests so it does not regress?

> The line was too long so it is stored into a variable first.

nice, thanks!
Martin Geisler - Aug. 25, 2014, 9:01 a.m.
Sean Farley <sean.michael.farley@gmail.com> writes:

> # HG changeset patch
> # User Sean Farley <sean.michael.farley@gmail.com>
> # Date 1408831388 18000
> #      Sat Aug 23 17:03:08 2014 -0500
> # Branch stable
> # Node ID 277808d61336777372fbe054708ab857bbf72fb1
> # Parent  510cafe720043af3d0c11b4b70345b63b54d17b1
> log: use correct phase info for parent field (issue4347)
>
> Previously, there was a copy / paste error with using the current changeset's
> phase information. We now look up the parent context explicitly.
>
> The line was too long so it is stored into a variable first.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -878,12 +878,13 @@ class changeset_printer(object):
>              # i18n: column positioning for "hg log"
>              self.ui.write(_("phase:       %s\n") % _(ctx.phasestr()),
>                            label='log.phase')
>          for parent in parents:
>              # i18n: column positioning for "hg log"
> +            label = 'log.parent changeset.%s' % self.repo[parent[0]].phasestr()
>              self.ui.write(_("parent:      %d:%s\n") % parent,

I believe you need to move the i18n comment below label so that it
remains adjacent to the line with _().
Matt Mackall - Aug. 27, 2014, 10:46 a.m.
On Sat, 2014-08-23 at 17:03 -0500, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley@gmail.com>
> # Date 1408831388 18000
> #      Sat Aug 23 17:03:08 2014 -0500
> # Branch stable
> # Node ID 277808d61336777372fbe054708ab857bbf72fb1
> # Parent  510cafe720043af3d0c11b4b70345b63b54d17b1
> log: use correct phase info for parent field (issue4347)

Queued for stable (with i18n line swapped in flight). Still looking
forward to a test.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -878,12 +878,13 @@  class changeset_printer(object):
             # i18n: column positioning for "hg log"
             self.ui.write(_("phase:       %s\n") % _(ctx.phasestr()),
                           label='log.phase')
         for parent in parents:
             # i18n: column positioning for "hg log"
+            label = 'log.parent changeset.%s' % self.repo[parent[0]].phasestr()
             self.ui.write(_("parent:      %d:%s\n") % parent,
-                          label='log.parent changeset.%s' % ctx.phasestr())
+                          label=label)
 
         if self.ui.debugflag:
             mnode = ctx.manifestnode()
             # i18n: column positioning for "hg log"
             self.ui.write(_("manifest:    %d:%s\n") %