mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
4aa4b211c6
A common design pattern is to use __file__ to find the location of the active python module to assist in output or loading of related assets. The current hook systems runs the pre-upload.py hook in a context w/out that set leading to runtime errors: $ repo upload --cbr . ERROR: Traceback (most recent call last): File ".../repo/project.py", line 481, in _ExecuteHook self._script_fullpath, 'exec'), context) File ".../repohooks/pre-upload.py", line 32, in <module> path = os.path.dirname(os.path.realpath(__file__)) NameError: name '__file__' is not defined Define this variable in this context so code can safely use it. Change-Id: If6331312445fa61d9351b59f83abcc1c99ae6748 |
||
---|---|---|
docs | ||
hooks | ||
subcmds | ||
tests | ||
.gitattributes | ||
.gitignore | ||
.project | ||
.pydevproject | ||
.pylintrc | ||
color.py | ||
command.py | ||
COPYING | ||
editor.py | ||
error.py | ||
git_command.py | ||
git_config.py | ||
git_refs.py | ||
git_ssh | ||
gitc_utils.py | ||
main.py | ||
manifest_xml.py | ||
pager.py | ||
progress.py | ||
project.py | ||
pyversion.py | ||
repo | ||
SUBMITTING_PATCHES | ||
trace.py | ||
wrapper.py |