[Bug 5274] New: ui.pushbuffer ineffective when a peer is created

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Jun 23 14:21:20 UTC 2016


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

            Bug ID: 5274
           Summary: ui.pushbuffer ineffective when a peer is created
           Product: Mercurial
           Version: 3.8.3
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: luc.habert at amarile.com
                CC: mercurial-devel at selenic.com

I stumbled upon this problem by calling mercurial.commands.push from within a
python hook. Here is a simplified version of my first attempt:

  def pushwhilelocked(ui, repo, **kwargs):
    ui.pushbuffer()
    return mercurial.commands.push(...)

I use ui.pushbuffer in order to not pollute hg's stdout (this hg is called by
ssh from a remote hg). However, hg's stdout still gets polluted by

  remote: adding changesets

messages, which confuse the toplevel hg.

The problem is that the push command creates a peer, which creates a new ui
from the repo.baseui; the ui passed to the hook is not used.

I can work around this issue by temporarily replacing repo.baseui.fout, but
that is quite ugly.

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


More information about the Mercurial-devel mailing list