comparison mercurial/hook.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 b3e8d8e4a40d
children 8fa87bce4929
comparison
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
28 stringutil, 28 stringutil,
29 ) 29 )
30 30
31 31
32 def pythonhook(ui, repo, htype, hname, funcname, args, throw): 32 def pythonhook(ui, repo, htype, hname, funcname, args, throw):
33 '''call python hook. hook is callable object, looked up as 33 """call python hook. hook is callable object, looked up as
34 name in python module. if callable returns "true", hook 34 name in python module. if callable returns "true", hook
35 fails, else passes. if hook raises exception, treated as 35 fails, else passes. if hook raises exception, treated as
36 hook failure. exception propagates if throw is "true". 36 hook failure. exception propagates if throw is "true".
37 37
38 reason for "true" meaning "hook failed" is so that 38 reason for "true" meaning "hook failed" is so that
39 unmodified commands (e.g. mercurial.commands.update) can 39 unmodified commands (e.g. mercurial.commands.update) can
40 be run as hooks without wrappers to convert return values.''' 40 be run as hooks without wrappers to convert return values."""
41 41
42 if callable(funcname): 42 if callable(funcname):
43 obj = funcname 43 obj = funcname
44 funcname = pycompat.sysbytes(obj.__module__ + "." + obj.__name__) 44 funcname = pycompat.sysbytes(obj.__module__ + "." + obj.__name__)
45 else: 45 else: