##// END OF EJS Templates
packaging: move version derivation to run_wix_packaging()...
packaging: move version derivation to run_wix_packaging() With the previous commit moving signing inline, we no longer need to compute the version string in build_installer() and can instead move this logic to run_wix_packaging(). This makes the logic in build_installer() simpler, which makes it easier to implement alternate building mechanisms. Differential Revision: https://phab.mercurial-scm.org/D8476

File last commit:

r43346:2372284d default
r45273:a5740490 stable
Show More
python-hook-examples.py
27 lines | 633 B | text/x-python | PythonLexer
/ contrib / python-hook-examples.py
Alexander Solovyov
diffstat hook example
r7917 '''
Benoit Boissinot
Change wording in example hook
r7918 Examples of useful python hooks for Mercurial.
Alexander Solovyov
diffstat hook example
r7917 '''
Pulkit Goyal
contrib: python-hook-examples use absolute_import
r28562 from __future__ import absolute_import
from mercurial import (
patch,
util,
)
Alexander Solovyov
diffstat hook example
r7917
Augie Fackler
formatting: blacken the codebase...
r43346
Alexander Solovyov
diffstat hook example
r7917 def diffstat(ui, repo, **kwargs):
Benoit Boissinot
Change wording in example hook
r7918 '''Example usage:
Alexander Solovyov
diffstat hook example
r7917
[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']
Matt Mackall
misc: replace .parents()[0] with p1()
r13878 first = repo[node].p1().node()
Alexander Solovyov
diffstat hook example
r7917 if 'url' in kwargs:
Martin von Zweigbergk
repo: don't look up context for tip node if it's not needed...
r39931 last = repo.changelog.tip()
Alexander Solovyov
diffstat hook example
r7917 else:
last = node
diff = patch.diff(repo, first, last)
ui.write(patch.diffstat(util.iterlines(diff)))