diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -535,3 +535,14 @@ class changelog(revlog.revlog): just to access this is costly.""" extra = self.read(rev)[5] return encoding.tolocal(extra.get("branch")), 'close' in extra + + def _addrevision(self, node, rawtext, transaction, *args, **kwargs): + # overlay over the standard revlog._addrevision to track the new + # revision on the transaction. + rev = len(self) + node = super(changelog, self)._addrevision(node, rawtext, transaction, + *args, **kwargs) + revs = transaction.changes.get('revs') + if revs is not None: + revs.add(rev) + return node diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1072,6 +1072,7 @@ class localrepository(object): self.store.createmode, validator=validate, releasefn=releasefn) + tr.changes['revs'] = set() tr.hookargs['txnid'] = txnid # note: writing the fncache only during finalize mean that the file is