# HG changeset patch # User Marcin Kuzminski # Date 1362508928 -3600 # Node ID cf1fbc9fed89475631df3236c0a6ed2b2ac2e2e1 # Parent d5ae996eed11a4df559c7f9f9e91feb5515e5887 Added get_hook_location method for easier hook extraction diff -r d5ae996eed11 -r cf1fbc9fed89 rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py Tue Mar 05 11:39:30 2013 +0100 +++ b/rhodecode/lib/vcs/backends/git/repository.py Tue Mar 05 19:42:08 2013 +0100 @@ -306,6 +306,15 @@ url = ':///'.join(('file', url)) return url + def get_hook_location(self): + """ + returns absolute path to location where hooks are stored + """ + loc = os.path.join(self.path, 'hooks') + if not self.bare: + loc = os.path.join(self.path, '.git', 'hooks') + return loc + @LazyProperty def name(self): return os.path.basename(self.path) diff -r d5ae996eed11 -r cf1fbc9fed89 rhodecode/lib/vcs/backends/hg/repository.py --- a/rhodecode/lib/vcs/backends/hg/repository.py Tue Mar 05 11:39:30 2013 +0100 +++ b/rhodecode/lib/vcs/backends/hg/repository.py Tue Mar 05 19:42:08 2013 +0100 @@ -422,6 +422,12 @@ url = "file:" + urllib.pathname2url(url) return url + def get_hook_location(self): + """ + returns absolute path to location where hooks are stored + """ + return os.path.join(self.path, '.hg', '.hgrc') + def get_changeset(self, revision=None): """ Returns ``MercurialChangeset`` object representing repository's @@ -492,7 +498,7 @@ """ return MercurialWorkdir(self) - def get_config_value(self, section, name, config_file=None): + def get_config_value(self, section, name=None, config_file=None): """ Returns configuration value for a given [``section``] and ``name``.