##// END OF EJS Templates
contrib: comment out the 64-bit py38 dependency installation on Windows...
contrib: comment out the 64-bit py38 dependency installation on Windows Not sure what is going on here, but it appears to not install py3.8 x64 in the usual `C:\hgdev` directory. The x32 installer works fine. I'm assuming this is a bug in this version of the installer, but didn't look into it too much. Differential Revision: https://phab.mercurial-scm.org/D11274

File last commit:

r46554:89a2afe3 default
r48621:7a0d7c34 stable
Show More
python-hook-examples.py
27 lines | 633 B | text/x-python | PythonLexer
/ contrib / python-hook-examples.py
'''
Examples of useful python hooks for Mercurial.
'''
from __future__ import absolute_import
from mercurial import (
patch,
util,
)
def diffstat(ui, repo, **kwargs):
"""Example usage:
[hooks]
commit.diffstat = python:/path/to/this/file.py:diffstat
changegroup.diffstat = python:/path/to/this/file.py:diffstat
"""
if kwargs.get('parent2'):
return
node = kwargs['node']
first = repo[node].p1().node()
if 'url' in kwargs:
last = repo.changelog.tip()
else:
last = node
diff = patch.diff(repo, first, last)
ui.write(patch.diffstat(util.iterlines(diff)))