[Bug 4929] New: Mercurial command output is scrambled when piped into program or redirected to a file

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Nov 2 21:54:16 UTC 2015


https://bz.mercurial-scm.org/show_bug.cgi?id=4929

            Bug ID: 4929
           Summary: Mercurial command output is scrambled when piped into
                    program or redirected to a file
           Product: Mercurial
           Version: 3.5.2
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: dave.piche174 at gmail.com
                CC: mercurial-devel at selenic.com

Overview
========

I ran the command "hg update -v | less" in a bare repository that contains
~14000 changesets and ~5000 files. I can reproduce the problem with the command
"hg update -v > hg_update.log".

I'm running Mercurial 3.5.2 with Python 2.7.10 on a Fedora 22 64-bit box.

I was able to reproduce the problem with Mercurial versions 2.6.2 and 3.6.
Mercurial was installed using the command "pip".


Actual & Expected Results
=========================

Here is what I get when hg update output is piped or redirected to a file:

  getting some_directory/some_file1.txt
  getting some_directory/some_file2.txt
  getting some_directory/some_file3.txt
  getting some_directory/some_filresolving manifests
                                 ^^^^^^^^^^^^^^^^^^^

"resolving manifests" appears at a couple of places in the output. It doesn't
happen if I sync only a small number of changesets at a time.

I'm expecting this instead:

    resolving manifests
    getting some_directory/some_file1.txt
    getting some_directory/some_file2.txt
    getting some_directory/some_file3.txt
    getting some_directory/some_file4.txt


Workaround
==========

Set the environment variable PYTHONUNBUFFERED. The output will be the same on
the terminal, in the file and in less.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list