コード例 #1
0
    def rewritePostCommitHook(self, signature, new_hook, enable):
        reposdir = options.env_path('svn_dir')
        hook = reposdir + self.name + 'hooks' + 'post-commit'

        shellscript.rewriteWithSignature(hook,
                                         signature,
                                         new_hook,
                                         enable,
                                         mode=0o755)
コード例 #2
0
ファイル: common.py プロジェクト: andy-deng/submin
def enable_hook(reposdir, hookname, targetname,
			interpreter='/usr/bin/python', args='"$@"'):
	"""Assumes no hook is already there, or if there is, that is a shell script.
	If you want to overwrite the hook with a clean submin-hook, call rewrite_hook instead."""
	target_script = options.static_path("hooks") + "git" + targetname
	new_hook = '%s %s %s\n' % (interpreter, target_script, args)
	hook = reposdir + 'hooks' + hookname

	if shellscript.hasSignature(hook, signature):
		return

	shellscript.rewriteWithSignature(hook, signature, new_hook, True, mode=0o755)
コード例 #3
0
def enable_hook(reposdir,
                hookname,
                targetname,
                interpreter='/usr/bin/python',
                args='"$@"'):
    """Assumes no hook is already there, or if there is, that is a shell script.
	If you want to overwrite the hook with a clean submin-hook, call rewrite_hook instead."""
    target_script = options.static_path("hooks") + "git" + targetname
    new_hook = '%s %s %s\n' % (interpreter, target_script, args)
    hook = reposdir + 'hooks' + hookname

    if shellscript.hasSignature(hook, signature):
        return

    shellscript.rewriteWithSignature(hook,
                                     signature,
                                     new_hook,
                                     True,
                                     mode=0o755)
コード例 #4
0
ファイル: repository.py プロジェクト: andy-deng/submin
	def rewritePostCommitHook(self, signature, new_hook, enable):
		reposdir = options.env_path('svn_dir')
		hook = reposdir + self.name + 'hooks' + 'post-commit'

		shellscript.rewriteWithSignature(hook, signature, new_hook, enable, mode=0o755)