comparison 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
comparison
equal deleted inserted replaced
18676:1506eb487ddd 18677:539210ed2069
2398 2398
2399 for n in added: 2399 for n in added:
2400 self.hook("incoming", node=hex(n), source=srctype, 2400 self.hook("incoming", node=hex(n), source=srctype,
2401 url=url) 2401 url=url)
2402 2402
2403 heads = self.heads() 2403 newheads = [h for h in self.heads() if h not in oldheads]
2404 self.ui.log("incoming", 2404 self.ui.log("incoming",
2405 _("%s incoming changes - new heads: %s\n"), 2405 _("%s incoming changes - new heads: %s\n"),
2406 len(added), 2406 len(added),
2407 ', '.join([hex(c[:6]) for c in heads])) 2407 ', '.join([hex(c[:6]) for c in newheads]))
2408 self._afterlock(runhooks) 2408 self._afterlock(runhooks)
2409 2409
2410 finally: 2410 finally:
2411 tr.release() 2411 tr.release()
2412 # never return 0 here: 2412 # never return 0 here: