Patchwork [4,of,6] blackbox: log incoming changes via ui.log()

mail settings
Submitter Durham Goode
Date Feb. 10, 2013, 11:07 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/920/
State Superseded
Commit b2b4ddc55caad31898a328ba1c26d10b84f5d73e
Headers show


Durham Goode - Feb. 10, 2013, 11:07 a.m.
# HG changeset patch
# User Durham Goode <>
# Date 1360429488 28800
# Node ID ee0ffe8ee86585a9842c841f7c389b037f118282
# Parent  eae69575df6cc5e429bfd6affbd957b6f3670fa4
blackbox: log incoming changes via ui.log()

Logs incoming changes to a repo to ui.log(). Includes the number of changes
and the hashes of the heads after the new changes.

Example log line:
2013/02/09 08:35:19 durham> 1 incoming changes - new heads: cb9a9f314b8b

Currently the blackbox logs the unix user that is performing the push/pull.
It would be nice to log the http authorized user as well so it works with
hgweb, but that's outside the scope of this commit.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -2408,6 +2408,11 @@ 
                     for n in added:
                         self.hook("incoming", node=hex(n), source=srctype,
+                    heads = self.heads()
+                    self.ui.log("incoming",
+                        "%s incoming changes - new heads: %s" %
+                        (len(added), ', '.join([hex(c[:6]) for c in heads])))