Mercurial > public > mercurial-scm > hg
comparison contrib/python-hook-examples.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 2372284d9457 |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
45941:346af7687c6f | 45942:89a2afe31e82 |
---|---|
7 util, | 7 util, |
8 ) | 8 ) |
9 | 9 |
10 | 10 |
11 def diffstat(ui, repo, **kwargs): | 11 def diffstat(ui, repo, **kwargs): |
12 '''Example usage: | 12 """Example usage: |
13 | 13 |
14 [hooks] | 14 [hooks] |
15 commit.diffstat = python:/path/to/this/file.py:diffstat | 15 commit.diffstat = python:/path/to/this/file.py:diffstat |
16 changegroup.diffstat = python:/path/to/this/file.py:diffstat | 16 changegroup.diffstat = python:/path/to/this/file.py:diffstat |
17 ''' | 17 """ |
18 if kwargs.get('parent2'): | 18 if kwargs.get('parent2'): |
19 return | 19 return |
20 node = kwargs['node'] | 20 node = kwargs['node'] |
21 first = repo[node].p1().node() | 21 first = repo[node].p1().node() |
22 if 'url' in kwargs: | 22 if 'url' in kwargs: |