Mercurial > hg
changeset 22339:9680da73cfe0
obsmarker: record the number of new markers in the transaction
This lets hooks be notified about new markers in the repository.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 25 Aug 2014 18:26:56 +0200 |
parents | 8fcd56095d3b |
children | 394a17de6a2d |
files | mercurial/obsolete.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/obsolete.py Mon Aug 25 18:10:08 2014 +0200 +++ b/mercurial/obsolete.py Mon Aug 25 18:26:56 2014 +0200 @@ -400,6 +400,9 @@ self._load(new) # new marker *may* have changed several set. invalidate the cache. self.caches.clear() + # records the number of new markers for the transaction hooks + previous = int(transaction.hookargs.get('new_obsmarkers', '0')) + transaction.hookargs['new_obsmarkers'] = str(previous + len(new)) return len(new) def mergemarkers(self, transaction, data):