# HG changeset patch # User Marcin Kuzminski # Date 1325109746 -7200 # Node ID 9de452afbe0117aacdae4f2baf9fe57db43a03a8 # Parent a8c66e870bd007e9f9f9a554959f74febade4f38 small change for post update hook that displays repository size diff -r a8c66e870bd0 -r 9de452afbe01 rhodecode/lib/hooks.py --- a/rhodecode/lib/hooks.py Thu Dec 29 00:01:05 2011 +0200 +++ b/rhodecode/lib/hooks.py Thu Dec 29 00:02:26 2011 +0200 @@ -41,8 +41,6 @@ :param hooktype: """ - if hooktype != 'changegroup': - return False size_hg, size_root = 0, 0 for path, dirs, files in os.walk(repo.root): if path.find('.hg') != -1: @@ -61,8 +59,15 @@ size_hg_f = h.format_byte_size(size_hg) size_root_f = h.format_byte_size(size_root) size_total_f = h.format_byte_size(size_root + size_hg) - sys.stdout.write('Repository size .hg:%s repo:%s total:%s\n' \ - % (size_hg_f, size_root_f, size_total_f)) + + last_cs = repo[len(repo) - 1] + + msg = ('Repository size .hg:%s repo:%s total:%s\n' + 'Last revision is now r%s:%s\n') % ( + size_hg_f, size_root_f, size_total_f, last_cs.rev(), last_cs.hex()[:12] + ) + + sys.stdout.write(msg) def log_pull_action(ui, repo, **kwargs):