Bug 4347 - colored hg log uses wrong phase to color parent(s)
Summary: colored hg log uses wrong phase to color parent(s)
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.1
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2014-08-23 05:59 UTC by Anton Shestakov
Modified: 2014-09-04 13:48 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Shestakov 2014-08-23 05:59 UTC
Mercurial version: 3.1+34-510cafe72004

# Steps to reproduce:

hg init /tmp/test-log-phase-colors/ && cd /tmp/test-log-phase-colors/
echo 'a' > foo && hg ci -A -m 'a'
echo 'b' >> foo && hg ci -m 'b'
hg up 0 && echo 'c' >> foo && hg ci --secret -m 'c'
hg log --config color.changeset.secret=red

# What is happening:

The final hg log command explicitly shows parent (which is in draft phase) for tip changeset (which is in secret phase) in red, as if the parent is also a secret changeset, which it isn't.

The bug is not visible unless user set a distinct color.changeset.secret color (by default it is none, afaict). If there are two parents (secret commit is a merge) the bug affects both lines.

# What should be happening:

Parent should be colored appropriately, since it is not in secret phase.

# Code pointers

http://selenic.com/hg/file/90cf454edd70/mercurial/cmdutil.py#l910

The code in question assigns phase label based on the currently drawn changeset instead of the specific parent.
Comment 1 Matt Mackall 2014-08-24 12:30 UTC
(click annotate -> blame Sean)

Marking this easy. This might be a good opportunity to submit your first Mercurial patch:

http://mercurial.selenic.com/wiki/ContributingChanges
Comment 2 Matt Mackall 2014-08-24 13:30 UTC
Looks like Sean already fixed it yesterday and forgot to use the INPROGRESS status.
Comment 3 HG Bot 2014-08-27 12:45 UTC
Fixed by http://selenic.com/repo/hg/rev/f6371cc62d2a
Sean Farley <sean.michael.farley@gmail.com>
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.

(please test the fix)
Comment 4 Anton Shestakov 2014-08-27 12:58 UTC
Yes, it looks all fixed. Thanks!