##// END OF EJS Templates
small change for post update hook that displays repository size
marcink -
r1814:9de452af beta
parent child Browse files
Show More
@@ -41,8 +41,6 b' def repo_size(ui, repo, hooktype=None, *'
41 :param hooktype:
41 :param hooktype:
42 """
42 """
43
43
44 if hooktype != 'changegroup':
45 return False
46 size_hg, size_root = 0, 0
44 size_hg, size_root = 0, 0
47 for path, dirs, files in os.walk(repo.root):
45 for path, dirs, files in os.walk(repo.root):
48 if path.find('.hg') != -1:
46 if path.find('.hg') != -1:
@@ -61,8 +59,15 b' def repo_size(ui, repo, hooktype=None, *'
61 size_hg_f = h.format_byte_size(size_hg)
59 size_hg_f = h.format_byte_size(size_hg)
62 size_root_f = h.format_byte_size(size_root)
60 size_root_f = h.format_byte_size(size_root)
63 size_total_f = h.format_byte_size(size_root + size_hg)
61 size_total_f = h.format_byte_size(size_root + size_hg)
64 sys.stdout.write('Repository size .hg:%s repo:%s total:%s\n' \
62
65 % (size_hg_f, size_root_f, size_total_f))
63 last_cs = repo[len(repo) - 1]
64
65 msg = ('Repository size .hg:%s repo:%s total:%s\n'
66 'Last revision is now r%s:%s\n') % (
67 size_hg_f, size_root_f, size_total_f, last_cs.rev(), last_cs.hex()[:12]
68 )
69
70 sys.stdout.write(msg)
66
71
67
72
68 def log_pull_action(ui, repo, **kwargs):
73 def log_pull_action(ui, repo, **kwargs):
General Comments 0
You need to be logged in to leave comments. Login now