Mercurial > hgsubversion
comparison tests/test_svn_pre_commit_hooks.py @ 1106:5cb6c95e0283 stable
Merge default and stable so I can do stable releases again.
| author | Augie Fackler <raf@durin42.com> |
|---|---|
| date | Tue, 11 Feb 2014 12:48:49 -0500 |
| parents | d741f536f23a |
| children | cff81f35b31e |
comparison
equal
deleted
inserted
replaced
| 1020:b5b1fce26f1f | 1106:5cb6c95e0283 |
|---|---|
| 1 import os | |
| 2 import sys | |
| 3 import test_util | |
| 4 import unittest | |
| 5 | |
| 6 from mercurial import hg | |
| 7 from mercurial import commands | |
| 8 from mercurial import util | |
| 9 | |
| 10 | |
| 11 class TestSvnPreCommitHooks(test_util.TestBase): | |
| 12 def setUp(self): | |
| 13 super(TestSvnPreCommitHooks, self).setUp() | |
| 14 self.repo_path = self.load_and_fetch('single_rev.svndump')[1] | |
| 15 # creating pre-commit hook that doesn't allow any commit | |
| 16 hook_file_name = os.path.join( | |
| 17 self.repo_path, 'hooks', 'pre-commit' | |
| 18 ) | |
| 19 hook_file = open(hook_file_name, 'w') | |
| 20 hook_file.write( | |
| 21 '#!/bin/sh\n' | |
| 22 'echo "Commits are not allowed" >&2; exit 1;\n' | |
| 23 ) | |
| 24 hook_file.close() | |
| 25 os.chmod(hook_file_name, 0755) | |
| 26 | |
| 27 def test_push_with_pre_commit_hooks(self): | |
| 28 changes = [('narf/a', 'narf/a', 'ohai',), | |
| 29 ] | |
| 30 self.commitchanges(changes) | |
| 31 self.assertRaises(util.Abort, self.pushrevisions) |
