Changeset - cf1fbc9fed89
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-03-05 19:42:08
marcin@python-works.com
Added get_hook_location method for easier hook extraction
2 files changed with 16 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -306,6 +306,15 @@ class GitRepository(BaseRepository):
 
            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)
rhodecode/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -422,6 +422,12 @@ class MercurialRepository(BaseRepository
 
            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 @@ class MercurialRepository(BaseRepository
 
        """
 
        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``.
 

	
0 comments (0 inline, 0 general)