diff --git a/hgext3rd/perftweaks.py b/hgext3rd/perftweaks.py --- a/hgext3rd/perftweaks.py +++ b/hgext3rd/perftweaks.py @@ -41,6 +41,7 @@ wrapfunction(dispatch, 'runcommand', _trackdirstatesizes) wrapfunction(dispatch, 'runcommand', _tracksparseprofiles) + wrapfunction(merge, 'update', _trackupdatesize) # noderev cache creation # The node rev cache is a cache of rev numbers that we are likely to do a @@ -267,3 +268,12 @@ lui.log('sparse_profiles', '', active_profiles=','.join(sorted(profiles))) return res + +def _trackupdatesize(orig, repo, node, branchmerge, *args, **kwargs): + if not branchmerge: + revs = repo.revs('(%s %% .) + (. %% %s)', node, node) + repo.ui.log('update_size', '', update_commitcount=len(revs)) + + stats = orig(repo, node, branchmerge, *args, **kwargs) + repo.ui.log('update_size', '', update_filecount=sum(stats)) + return stats