Bug 1507 - color and hg export
Summary: color and hg export
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: color (show other bugs)
Version: unspecified
Hardware: All All
: normal feature
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-09 03:12 UTC by Gerhard
Modified: 2012-10-19 14:25 UTC (History)
5 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 Gerhard 2009-02-09 03:12 UTC
There are the following lines in my .hgrc:

[extensions]
color =

[color]
diff.diffline = bold
diff.extended = cyan bold
diff.file_a = red bold
diff.file_b = green bold
diff.hunk = magenta
diff.deleted = red
diff.inserted = green
diff.changed = white
diff.trailingwhitespace = bold red_background

"hg diff" is colorized then, but the documentation of the color
extension says:

   This extension modifies the status command to add color to its output
   to reflect file status, the qseries command to add color to reflect
   patch status (applied, unapplied, missing), and to diff-related commands
   to highlight additions, removals, diff headers, and trailing whitespace.

"hg export tip" is not colorized, even though it is a diff related command.

$ hg --version
Mercurial Distributed SCM (version 1.1.2)

Copyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 Bugzilla 2012-05-12 08:57 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 08:57 EDT  ---

This bug was previously known as _bug_ 1507 at http://mercurial.selenic.com/bts/issue1507

Bug Status was UNCONFIRMED but everconfirmed was true
   Setting status to CONFIRMED

Comment 2 HG Bot 2012-09-10 17:03 UTC
Fixed by http://selenic.com/repo/hg/rev/a306837f8c87
Ankur Dahiya <ankurd@fb.com>
color: enabled color support for export command (issue1507)

The export command didn't output the diffs in color, even when color support
was enabled. This patch fixes that by making the export command use the default
ui.write method, instead of directly manipulating the ui.fout file object.
Also added a test case to verify color output to test-export.t.

(please test the fix)