Go to file
Mike Frysinger 4aa4b211c6 RepoHook: set __file__ when running the hook
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
2016-03-05 21:52:31 +00:00
docs Fix typos for manifest dtd 2015-12-11 00:05:54 +00:00
hooks Update the commit-msg hook to the version from Gerrit 2.8.2 2014-07-15 11:30:06 -07:00
subcmds Better error display on forall 2016-02-18 01:29:54 +00:00
tests Fix gitc-init behavior 2015-10-07 15:43:22 -07:00
.gitattributes Protect line endings in shell scripts 2013-02-11 22:13:39 +01:00
.gitignore Add repoc to the .gitignore file 2013-03-08 01:18:08 +00:00
.project Set correct name in PyDev and Eclipse project config 2013-04-19 09:35:43 +09:00
.pydevproject Set correct name in PyDev and Eclipse project config 2013-04-19 09:35:43 +09:00
.pylintrc Remove deprecated include-ids setting from pylint config 2015-04-07 11:10:17 +09:00
color.py Pylint and PEP8 fixes for color.py 2015-03-28 21:12:27 +00:00
command.py Add GitcClientCommand class for GITC-specific commands 2015-09-29 13:46:34 -07:00
COPYING Initial Contribution 2008-10-21 07:00:00 -07:00
editor.py Change print statements to work in python3 2012-11-13 17:33:56 -08:00
error.py error: fix typos 2015-06-04 00:21:16 +00:00
git_command.py Add rpc: to default protocol whitelist 2016-02-26 18:53:54 -08:00
git_config.py Support smart-sync through persistent-http[s] 2015-08-19 10:22:11 -07:00
git_refs.py Fix some python3 encoding issues 2013-11-21 06:03:22 +00:00
git_ssh Don't allow git fetch to start ControlMaster 2010-10-29 08:15:14 -07:00
gitc_utils.py Fix gitc-init behavior 2015-10-07 15:43:22 -07:00
main.py Add GitcClientCommand class for GITC-specific commands 2015-09-29 13:46:34 -07:00
manifest_xml.py GITC: Always update the gitc manifest from the repo manifest 2015-09-09 20:50:40 -07:00
pager.py Change print statements to work in python3 2012-11-13 17:33:56 -08:00
progress.py Support units in progress messages 2011-09-19 14:52:57 -07:00
project.py RepoHook: set __file__ when running the hook 2016-03-05 21:52:31 +00:00
pyversion.py Move Python version checking to a separate module 2013-05-23 07:28:53 +00:00
repo repo: Cleaned up pylint/pep8 violations 2016-02-15 10:29:02 -07:00
SUBMITTING_PATCHES SUBMITTING_PATCHES: Expand instructions 2016-02-17 02:45:08 +00:00
trace.py Change print statements to work in python3 2012-11-13 17:33:56 -08:00
wrapper.py Add wrapper module 2014-01-30 15:17:09 -08:00