diff mercurial/localrepo.py @ 18677:539210ed2069

blackbox: only show new heads on incoming The blackbox was logging every head after every incoming group. Now we only log the heads that have changed. Added a test. Moved the hooks test to the bottom of the file since the hooks interfer with the tests after it.
author Durham Goode <durham@fb.com>
date Wed, 13 Feb 2013 11:07:01 -0800
parents b2b4ddc55caa
children 4f485bd68f1d
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Feb 13 10:54:52 2013 -0800
+++ b/mercurial/localrepo.py	Wed Feb 13 11:07:01 2013 -0800
@@ -2400,11 +2400,11 @@
                         self.hook("incoming", node=hex(n), source=srctype,
                                   url=url)
 
-                    heads = self.heads()
+                    newheads = [h for h in self.heads() if h not in oldheads]
                     self.ui.log("incoming",
                                 _("%s incoming changes - new heads: %s\n"),
                                 len(added),
-                                ', '.join([hex(c[:6]) for c in heads]))
+                                ', '.join([hex(c[:6]) for c in newheads]))
                 self._afterlock(runhooks)
 
         finally: