From 126b542373b3b1123a68455dc85ab8290f76ac79 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Fri, 9 Mar 2012 17:21:51 -0800 Subject: [PATCH 01/11] More sane way to stitch the TestCase together with DocFileTests. Gives much better error reporting. --- gitsvnhelpers/tests/test_doctests.py | 44 +++++++++++++++------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/gitsvnhelpers/tests/test_doctests.py b/gitsvnhelpers/tests/test_doctests.py index a8c0cba..c3bfcaf 100644 --- a/gitsvnhelpers/tests/test_doctests.py +++ b/gitsvnhelpers/tests/test_doctests.py @@ -9,30 +9,34 @@ class TestDoctests(BaseTestCase): - def shell(self, cmd): - """executes the shell command and prints its output""" - code, output = popen(cmd, False, False) - for line in output: - print line + def runTest(self): + raise NotImplemented - def _test_doctest(self): - doctest.testfile("%s.txt" % self._testMethodName, - globs=dict(self=self, do=self.shell), - report=True, - optionflags=optionflags) - def test_gitify(self): - self._test_doctest() +def shell(cmd): + """executes the shell command and prints its output""" + code, output = popen(cmd, False, False) + for line in output: + print line - def test_gitify_up(self): - self._test_doctest() - def test_gitify_fetch(self): - self._test_doctest() +def setUp(test): + self = TestDoctests() + test.globs['self'] = self + self.setUp() - def test_symlink_migration(self): - self._test_doctest() - def test_svn_switch(self): - self._test_doctest() +def tearDown(test): + test.globs['self'].tearDown() + +def test_suite(): + return doctest.DocFileSuite( + 'test_gitify.txt', + 'test_gitify_up.txt', + 'test_gitify_fetch.txt', + 'test_symlink_migration.txt', + 'test_svn_switch.txt', + globs=dict(do=shell), + setUp=setUp, + optionflags=optionflags) From 7cf225438e30153c67884ab12e9d1f43b96e77f7 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Fri, 9 Mar 2012 17:34:19 -0800 Subject: [PATCH 02/11] Git output changed --- gitsvnhelpers/tests/test_gitify.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitsvnhelpers/tests/test_gitify.txt b/gitsvnhelpers/tests/test_gitify.txt index 3105d9f..8d6e43a 100644 --- a/gitsvnhelpers/tests/test_gitify.txt +++ b/gitsvnhelpers/tests/test_gitify.txt @@ -106,7 +106,7 @@ As expected, git will report the modification: >>> do('git status') # On branch local/trunk - # Changed but not updated: + # Change...: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # From 8660ffa92641b5a0c47f7d7c95e0a5678bb22e48 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Fri, 9 Mar 2012 17:55:04 -0800 Subject: [PATCH 03/11] Tests seem to expect both `do` and `self.shell` --- gitsvnhelpers/tests/test_doctests.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gitsvnhelpers/tests/test_doctests.py b/gitsvnhelpers/tests/test_doctests.py index c3bfcaf..52cbf71 100644 --- a/gitsvnhelpers/tests/test_doctests.py +++ b/gitsvnhelpers/tests/test_doctests.py @@ -12,17 +12,16 @@ class TestDoctests(BaseTestCase): def runTest(self): raise NotImplemented - -def shell(cmd): - """executes the shell command and prints its output""" - code, output = popen(cmd, False, False) - for line in output: - print line + def shell(self, cmd): + """executes the shell command and prints its output""" + code, output = popen(cmd, False, False) + for line in output: + print line def setUp(test): self = TestDoctests() - test.globs['self'] = self + test.globs.update(self=self, do=self.shell) self.setUp() @@ -37,6 +36,5 @@ def test_suite(): 'test_gitify_fetch.txt', 'test_symlink_migration.txt', 'test_svn_switch.txt', - globs=dict(do=shell), setUp=setUp, optionflags=optionflags) From 7d5f7a75c5f7b41f56b1c50d064d0fa6853b75f5 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Fri, 9 Mar 2012 17:56:24 -0800 Subject: [PATCH 04/11] Oops, forgot the test tearDown --- gitsvnhelpers/tests/test_doctests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitsvnhelpers/tests/test_doctests.py b/gitsvnhelpers/tests/test_doctests.py index 52cbf71..0b26870 100644 --- a/gitsvnhelpers/tests/test_doctests.py +++ b/gitsvnhelpers/tests/test_doctests.py @@ -36,5 +36,5 @@ def test_suite(): 'test_gitify_fetch.txt', 'test_symlink_migration.txt', 'test_svn_switch.txt', - setUp=setUp, + setUp=setUp, tearDown=tearDown, optionflags=optionflags) From 0e83051652935a3d8c4cc7516ec7f6f56dc9bc68 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Fri, 9 Mar 2012 22:10:34 -0800 Subject: [PATCH 05/11] The git "repo" in the tests directory was just an empty directory, no `.git` directory. --- gitsvnhelpers/testing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitsvnhelpers/testing.py b/gitsvnhelpers/testing.py index af0b075..22b69aa 100644 --- a/gitsvnhelpers/testing.py +++ b/gitsvnhelpers/testing.py @@ -5,6 +5,7 @@ from os.path import join, dirname from jarn.mkrelease.testing import SubversionSetup, JailSetup, GitSetup from jarn.mkrelease.process import Process +from jarn.mkrelease.tee import popen from gitsvnhelpers import config @@ -90,6 +91,7 @@ def setUp(self): self.packagedir = join(self.tempdir, 'testpackage') shutil.copytree(package, self.packagedir) os.chdir(self.packagedir) + popen('git init') except: self.cleanUp() raise From a0a7da8ffdbf80204efc694a61efa5b6e5eea200 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Fri, 9 Mar 2012 22:11:08 -0800 Subject: [PATCH 06/11] Git output starts with `#` comment lines so only check the last line. --- gitsvnhelpers/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitsvnhelpers/utils.py b/gitsvnhelpers/utils.py index 7df015c..f2e7ca3 100644 --- a/gitsvnhelpers/utils.py +++ b/gitsvnhelpers/utils.py @@ -126,7 +126,7 @@ def local_changes(): """ result, output = popen('git status', False, False) try: - return not output[1].startswith("nothing to commit") + return not output[-1].startswith("nothing to commit") except IndexError: return True From 8d31af0588fec3b0681d8a20379294ccb54c7ff4 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Fri, 9 Mar 2012 22:18:26 -0800 Subject: [PATCH 07/11] Not everyone has your aliases. :-) --- gitsvnhelpers/gitify.py | 2 +- gitsvnhelpers/tests/test_git.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gitsvnhelpers/gitify.py b/gitsvnhelpers/gitify.py index 173f077..199119a 100755 --- a/gitsvnhelpers/gitify.py +++ b/gitsvnhelpers/gitify.py @@ -68,7 +68,7 @@ def __call__(self): # perform all index updates in the cache to avoid conflicts os.chdir(config.GIT_CACHE + package_name) - dummy, existing_branches = popen('git b', False, False) + dummy, existing_branches = popen('git branch', False, False) existing_branches = [b.strip() for b in existing_branches] if local_branch in existing_branches: popen('git checkout -f %s' % local_branch, False, False) diff --git a/gitsvnhelpers/tests/test_git.py b/gitsvnhelpers/tests/test_git.py index b0f4edd..d8ee951 100644 --- a/gitsvnhelpers/tests/test_git.py +++ b/gitsvnhelpers/tests/test_git.py @@ -27,7 +27,7 @@ def test_dirty_index(self): popen('git add bar.txt') self.failUnless(index_is_dirty()) # Once we've actually committed the change, we're clean again: - popen('git ci -m "added bar"', False, False) + popen('git commit -m "added bar"', False, False) self.failIf(index_is_dirty()) def test_local_changes(self): @@ -42,11 +42,11 @@ def test_local_changes(self): # Once we've actually committed the change, we're clean again: popen('git add bar.txt') self.failUnless(local_changes()) - popen('git ci -m "added bar"', False, False) + popen('git commit -m "added bar"', False, False) self.failIf(local_changes()) # Modifying an existing file will have the same effect: popen('echo "modified" >> bar.txt') self.failUnless(local_changes()) popen('git add bar.txt') - popen('git ci -m "modified bar"', False, False) + popen('git commit -m "modified bar"', False, False) self.failIf(local_changes()) From 9a99cd26e2ef7666fc21afa9e68916923510680e Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Sat, 10 Mar 2012 09:54:18 -0800 Subject: [PATCH 08/11] Tolerate git output differences --- gitsvnhelpers/tests/test_gitify_up.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gitsvnhelpers/tests/test_gitify_up.txt b/gitsvnhelpers/tests/test_gitify_up.txt index 08c5d9c..854b8d7 100644 --- a/gitsvnhelpers/tests/test_gitify_up.txt +++ b/gitsvnhelpers/tests/test_gitify_up.txt @@ -68,7 +68,7 @@ Starting easy, we simply add a new file to the svn repo: >>> do('svn commit -m "Added from svn"') Adding svn.txt Transmitting file data . - Committed revision 7. + Committed revision ... Then we re-visit our gitified checkout: @@ -166,6 +166,7 @@ Subversion >>> os.chdir(svnlocal) >>> do("svn up") + Updating '.': G svn.txt Updated to revision 8. @@ -195,7 +196,6 @@ The rebase command works as expected: M svn.txt r8 = ... (refs/remotes/trunk) First, rewinding head to replay your work on top of it... - Nothing to do. Now the slate is clean: @@ -212,7 +212,7 @@ let's first check the status: >>> os.chdir(gitified) >>> do('git status') # On branch local/trunk - # Changed but not updated: + # Change...: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # @@ -231,7 +231,7 @@ except that git now calls them 'unmerged' instead of 'modified': # On branch local/trunk # Unmerged paths: # (use "git reset HEAD ..." to unstage) - # (use "git add ..." to mark resolution) + # (use "git add... to mark resolution) # # both modified: svn.txt # From 6d49cc9622b157f12d920581d46d613e5c362216 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Sat, 10 Mar 2012 09:56:22 -0800 Subject: [PATCH 09/11] Move the test repo setup into the test setup. This addresses a few problems: 1. Trying to commit a git repo in a git repo is begging trouble 2. Repo formats my change across releases, using the tools to create repos at test runtime means the repos will have the right format 3. Makes much clearer what is supposed to be in the repo --- gitsvnhelpers/testing.py | 66 +++++++++++++---- gitsvnhelpers/tests/test_gitify.txt | 39 +++++----- gitsvnhelpers/tests/testrepo.git | 1 - gitsvnhelpers/tests/testrepo.svn/README.txt | 5 -- gitsvnhelpers/tests/testrepo.svn/conf/authz | 32 -------- gitsvnhelpers/tests/testrepo.svn/conf/passwd | 8 -- .../tests/testrepo.svn/conf/svnserve.conf | 47 ------------ gitsvnhelpers/tests/testrepo.svn/db/current | 1 - gitsvnhelpers/tests/testrepo.svn/db/format | 2 - gitsvnhelpers/tests/testrepo.svn/db/fs-type | 1 - .../tests/testrepo.svn/db/revprops/0/0 | 5 -- .../tests/testrepo.svn/db/revprops/0/1 | 13 ---- .../tests/testrepo.svn/db/revprops/0/2 | 13 ---- .../tests/testrepo.svn/db/revprops/0/3 | 13 ---- .../tests/testrepo.svn/db/revprops/0/4 | 14 ---- .../tests/testrepo.svn/db/revprops/0/5 | 13 ---- .../tests/testrepo.svn/db/revprops/0/6 | 13 ---- gitsvnhelpers/tests/testrepo.svn/db/revs/0/0 | 11 --- gitsvnhelpers/tests/testrepo.svn/db/revs/0/1 | 49 ------------ gitsvnhelpers/tests/testrepo.svn/db/revs/0/2 | Bin 653 -> 0 bytes gitsvnhelpers/tests/testrepo.svn/db/revs/0/3 | Bin 805 -> 0 bytes gitsvnhelpers/tests/testrepo.svn/db/revs/0/4 | 50 ------------- gitsvnhelpers/tests/testrepo.svn/db/revs/0/5 | Bin 1820 -> 0 bytes gitsvnhelpers/tests/testrepo.svn/db/revs/0/6 | 50 ------------- .../tests/testrepo.svn/db/txn-current | 1 - .../tests/testrepo.svn/db/txn-current-lock | 0 gitsvnhelpers/tests/testrepo.svn/db/uuid | 1 - .../tests/testrepo.svn/db/write-lock | 0 gitsvnhelpers/tests/testrepo.svn/format | 1 - .../tests/testrepo.svn/hooks/post-commit.tmpl | 51 ------------- .../tests/testrepo.svn/hooks/post-lock.tmpl | 44 ----------- .../hooks/post-revprop-change.tmpl | 56 -------------- .../tests/testrepo.svn/hooks/post-unlock.tmpl | 42 ----------- .../tests/testrepo.svn/hooks/pre-commit.tmpl | 70 ------------------ .../tests/testrepo.svn/hooks/pre-lock.tmpl | 64 ---------------- .../hooks/pre-revprop-change.tmpl | 66 ----------------- .../tests/testrepo.svn/hooks/pre-unlock.tmpl | 61 --------------- .../testrepo.svn/hooks/start-commit.tmpl | 65 ---------------- .../tests/testrepo.svn/locks/db-logs.lock | 3 - .../tests/testrepo.svn/locks/db.lock | 3 - 40 files changed, 71 insertions(+), 903 deletions(-) delete mode 160000 gitsvnhelpers/tests/testrepo.git delete mode 100644 gitsvnhelpers/tests/testrepo.svn/README.txt delete mode 100644 gitsvnhelpers/tests/testrepo.svn/conf/authz delete mode 100644 gitsvnhelpers/tests/testrepo.svn/conf/passwd delete mode 100644 gitsvnhelpers/tests/testrepo.svn/conf/svnserve.conf delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/current delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/format delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/fs-type delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revprops/0/0 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revprops/0/1 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revprops/0/2 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revprops/0/3 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revprops/0/4 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revprops/0/5 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revprops/0/6 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revs/0/0 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revs/0/1 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revs/0/2 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revs/0/3 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revs/0/4 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revs/0/5 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/revs/0/6 delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/txn-current delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/txn-current-lock delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/uuid delete mode 100644 gitsvnhelpers/tests/testrepo.svn/db/write-lock delete mode 100644 gitsvnhelpers/tests/testrepo.svn/format delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/post-commit.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/post-lock.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/post-revprop-change.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/post-unlock.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/pre-commit.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/pre-lock.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/pre-revprop-change.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/pre-unlock.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/hooks/start-commit.tmpl delete mode 100644 gitsvnhelpers/tests/testrepo.svn/locks/db-logs.lock delete mode 100644 gitsvnhelpers/tests/testrepo.svn/locks/db.lock diff --git a/gitsvnhelpers/testing.py b/gitsvnhelpers/testing.py index 22b69aa..e705f48 100644 --- a/gitsvnhelpers/testing.py +++ b/gitsvnhelpers/testing.py @@ -1,18 +1,16 @@ -import shutil import sys import os import StringIO -from os.path import join, dirname +from os.path import join +import subprocess + from jarn.mkrelease.testing import SubversionSetup, JailSetup, GitSetup -from jarn.mkrelease.process import Process -from jarn.mkrelease.tee import popen from gitsvnhelpers import config class BaseTestCase(SubversionSetup): name = 'svn' - source = 'testrepo.svn' packagename = 'testpackage' def setUp(self): @@ -21,26 +19,66 @@ def setUp(self): config.GIT_CACHE = join(self.tempdir, '.gitcache/') # copy the test repo to temp, we perform all checkouts from there: try: - original_repo = join(dirname(__file__), 'tests', self.source) # the target folder needs to be the packagename, so that the # file:/// urls used throughout testing match the pacakge name # normally, the filesystem name doesn't matter, when it's being # served via http - os.mkdir("%s/repos/" % self.tempdir) + os.mkdir(join(self.tempdir, "repos")) self.repo = join(self.tempdir, 'repos', self.packagename) - shutil.copytree(original_repo, self.repo) + subprocess.check_call(["svnadmin", "create", self.repo]) + subprocess.check_call( + ["svn", "mkdir", "-m", "repo layout"] + +["file://%s/%s" % (self.repo, folder) + for folder in ('trunk', 'branches', 'tags')], + stdout=subprocess.PIPE) + + self.checkout(target="setUp") + open('README.txt', 'w').write("Package documentation\n") + subprocess.check_call(["svn", "add", "README.txt"], + stdout=subprocess.PIPE) + subprocess.check_call(["svn", "commit", "-m", "Begin docs"], + stdout=subprocess.PIPE) + + open('foo.py', 'w').write('"""fooberizing"""\n') + subprocess.check_call(["svn", "add", "foo.py"], + stdout=subprocess.PIPE) + subprocess.check_call( + ["svn", "commit", "-m", "First attempt at fooberizing"], + stdout=subprocess.PIPE) + subprocess.check_call(["svn", "copy", "-m", "Release 0.1", + "file://%s/trunk" % self.repo, + "file://%s/tags/0.1" % self.repo], + stdout=subprocess.PIPE) + + subprocess.check_call( + ["svn", "copy", "-m", "Begin work on feature bar", + "file://%s/trunk" % self.repo, + "file://%s/branches/feature-bar" % self.repo], + stdout=subprocess.PIPE) + subprocess.check_call( + ["svn", "switch", + "file://%s/branches/feature-bar" % self.repo], + stdout=subprocess.PIPE) + open('README.txt', 'a').write("Now supports bar\n") + open('foo.py', 'a').write('import bar\n') + open('bar.py', 'w').write('"""barberizing"""\n') + subprocess.check_call(["svn", "add", "bar.py"], + stdout=subprocess.PIPE) + subprocess.check_call( + ["svn", "commit", "-m", "Implement bar feature"], + stdout=subprocess.PIPE) except: self.cleanUp() raise def checkout(self, path='trunk', target=None): - process = Process(quiet=True) if target is None: self.checkoutdir = join(self.tempdir, self.packagename) else: self.checkoutdir = join(self.tempdir, target, self.packagename) - process.system('svn checkout file://%s/%s %s' % (self.repo, - path, self.checkoutdir)) + args = ['svn', 'checkout', 'file://%s/%s' % (self.repo, path), + '%s' % self.checkoutdir] + subprocess.check_call(args, stdout=subprocess.PIPE) os.chdir(self.checkoutdir) @@ -82,16 +120,14 @@ def cleanUp(self): class GitTestCase(GitSetup): """ a test class that operates on a git repository """ - source = 'testrepo.git' def setUp(self): JailSetup.setUp(self) try: - package = join(dirname(__file__), 'tests', self.source) self.packagedir = join(self.tempdir, 'testpackage') - shutil.copytree(package, self.packagedir) + os.mkdir(self.packagedir) os.chdir(self.packagedir) - popen('git init') + subprocess.check_call(['git', 'init'], stdout=subprocess.PIPE) except: self.cleanUp() raise diff --git a/gitsvnhelpers/tests/test_gitify.txt b/gitsvnhelpers/tests/test_gitify.txt index 8d6e43a..d491d31 100644 --- a/gitsvnhelpers/tests/test_gitify.txt +++ b/gitsvnhelpers/tests/test_gitify.txt @@ -142,25 +142,26 @@ Let's make another git commit before pushing our changes to svn: Now we can push our commits to svn using the ``gitify push`` command: >>> gitify(args=['push']) - Committing to file:///...testpackage/trunk ... - M README.txt - Committed r7 - M README.txt - r7 = ... (refs/remotes/trunk) - No changes between current HEAD and refs/remotes/trunk - Resetting to the latest refs/remotes/trunk - Unstaged changes after reset: - M foo.py - M foo.py - Committed r8 - M foo.py - r8 = ... (refs/remotes/trunk) - No changes between current HEAD and refs/remotes/trunk - Resetting to the latest refs/remotes/trunk - G foo.py - G README.txt - Updated to revision 8. - Pushed local changes to svn. + Committing to file:///...testpackage/trunk ... + M README.txt + Committed r7 + M README.txt + r7 = ... (refs/remotes/trunk) + No changes between current HEAD and refs/remotes/trunk + Resetting to the latest refs/remotes/trunk + Unstaged changes after reset: + M foo.py + M foo.py + Committed r8 + M foo.py + r8 = ... (refs/remotes/trunk) + No changes between current HEAD and refs/remotes/trunk + Resetting to the latest refs/remotes/trunk + Updating '.': + G foo.py + G README.txt + Updated to revision 8. + Pushed local changes to svn. Now git and svn are 'in sync' IOW they both agree that there are no uncommitted local changes: diff --git a/gitsvnhelpers/tests/testrepo.git b/gitsvnhelpers/tests/testrepo.git deleted file mode 160000 index 1522269..0000000 --- a/gitsvnhelpers/tests/testrepo.git +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 15222693eacf069fb98b9391697c317c5aad16a5 diff --git a/gitsvnhelpers/tests/testrepo.svn/README.txt b/gitsvnhelpers/tests/testrepo.svn/README.txt deleted file mode 100644 index 3bf5a57..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -This is a Subversion repository; use the 'svnadmin' tool to examine -it. Do not add, delete, or modify files here unless you know how -to avoid corrupting the repository. - -Visit http://subversion.tigris.org/ for more information. diff --git a/gitsvnhelpers/tests/testrepo.svn/conf/authz b/gitsvnhelpers/tests/testrepo.svn/conf/authz deleted file mode 100644 index 0b9a410..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/conf/authz +++ /dev/null @@ -1,32 +0,0 @@ -### This file is an example authorization file for svnserve. -### Its format is identical to that of mod_authz_svn authorization -### files. -### As shown below each section defines authorizations for the path and -### (optional) repository specified by the section name. -### The authorizations follow. An authorization line can refer to: -### - a single user, -### - a group of users defined in a special [groups] section, -### - an alias defined in a special [aliases] section, -### - all authenticated users, using the '$authenticated' token, -### - only anonymous users, using the '$anonymous' token, -### - anyone, using the '*' wildcard. -### -### A match can be inverted by prefixing the rule with '~'. Rules can -### grant read ('r') access, read-write ('rw') access, or no access -### (''). - -[aliases] -# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average - -[groups] -# harry_and_sally = harry,sally -# harry_sally_and_joe = harry,sally,&joe - -# [/foo/bar] -# harry = rw -# &joe = r -# * = - -# [repository:/baz/fuz] -# @harry_and_sally = rw -# * = r diff --git a/gitsvnhelpers/tests/testrepo.svn/conf/passwd b/gitsvnhelpers/tests/testrepo.svn/conf/passwd deleted file mode 100644 index ecaa08d..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/conf/passwd +++ /dev/null @@ -1,8 +0,0 @@ -### This file is an example password file for svnserve. -### Its format is similar to that of svnserve.conf. As shown in the -### example below it contains one section labelled [users]. -### The name and password for each user follow, one account per line. - -[users] -# harry = harryssecret -# sally = sallyssecret diff --git a/gitsvnhelpers/tests/testrepo.svn/conf/svnserve.conf b/gitsvnhelpers/tests/testrepo.svn/conf/svnserve.conf deleted file mode 100644 index e62a01e..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/conf/svnserve.conf +++ /dev/null @@ -1,47 +0,0 @@ -### This file controls the configuration of the svnserve daemon, if you -### use it to allow access to this repository. (If you only allow -### access through http: and/or file: URLs, then this file is -### irrelevant.) - -### Visit http://subversion.tigris.org/ for more information. - -[general] -### These options control access to the repository for unauthenticated -### and authenticated users. Valid values are "write", "read", -### and "none". The sample settings below are the defaults. -# anon-access = read -# auth-access = write -### The password-db option controls the location of the password -### database file. Unless you specify a path starting with a /, -### the file's location is relative to the directory containing -### this configuration file. -### If SASL is enabled (see below), this file will NOT be used. -### Uncomment the line below to use the default password file. -# password-db = passwd -### The authz-db option controls the location of the authorization -### rules for path-based access control. Unless you specify a path -### starting with a /, the file's location is relative to the the -### directory containing this file. If you don't specify an -### authz-db, no path-based access control is done. -### Uncomment the line below to use the default authorization file. -# authz-db = authz -### This option specifies the authentication realm of the repository. -### If two repositories have the same authentication realm, they should -### have the same password database, and vice versa. The default realm -### is repository's uuid. -# realm = My First Repository - -[sasl] -### This option specifies whether you want to use the Cyrus SASL -### library for authentication. Default is false. -### This section will be ignored if svnserve is not built with Cyrus -### SASL support; to check, run 'svnserve --version' and look for a line -### reading 'Cyrus SASL authentication is available.' -# use-sasl = true -### These options specify the desired strength of the security layer -### that you want SASL to provide. 0 means no encryption, 1 means -### integrity-checking only, values larger than 1 are correlated -### to the effective key length for encryption (e.g. 128 means 128-bit -### encryption). The values below are the defaults. -# min-encryption = 0 -# max-encryption = 256 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/current b/gitsvnhelpers/tests/testrepo.svn/db/current deleted file mode 100644 index 1e8b314..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/current +++ /dev/null @@ -1 +0,0 @@ -6 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/format b/gitsvnhelpers/tests/testrepo.svn/db/format deleted file mode 100644 index ef83e21..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/format +++ /dev/null @@ -1,2 +0,0 @@ -3 -layout sharded 1000 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/fs-type b/gitsvnhelpers/tests/testrepo.svn/db/fs-type deleted file mode 100644 index 4fdd953..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/fs-type +++ /dev/null @@ -1 +0,0 @@ -fsfs diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/0 b/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/0 deleted file mode 100644 index 4769670..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/0 +++ /dev/null @@ -1,5 +0,0 @@ -K 8 -svn:date -V 27 -2009-07-13T20:56:39.461866Z -END diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/1 b/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/1 deleted file mode 100644 index 9745c18..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/1 +++ /dev/null @@ -1,13 +0,0 @@ -K 10 -svn:author -V 7 -tomster -K 8 -svn:date -V 27 -2009-07-13T20:58:32.955822Z -K 7 -svn:log -V 14 -Added skeleton -END diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/2 b/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/2 deleted file mode 100644 index 37598db..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/2 +++ /dev/null @@ -1,13 +0,0 @@ -K 10 -svn:author -V 7 -tomster -K 8 -svn:date -V 27 -2009-07-13T21:00:07.427415Z -K 7 -svn:log -V 19 -added documentation -END diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/3 b/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/3 deleted file mode 100644 index 8673252..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/3 +++ /dev/null @@ -1,13 +0,0 @@ -K 10 -svn:author -V 7 -tomster -K 8 -svn:date -V 27 -2009-07-13T21:03:07.462521Z -K 7 -svn:log -V 28 -First attempt at fooberizing -END diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/4 b/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/4 deleted file mode 100644 index 910d22c..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/4 +++ /dev/null @@ -1,14 +0,0 @@ -K 10 -svn:author -V 7 -tomster -K 8 -svn:date -V 27 -2009-07-13T21:06:14.397333Z -K 7 -svn:log -V 42 -Creating a branch for the new bar feature - -END diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/5 b/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/5 deleted file mode 100644 index 1ac426c..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/5 +++ /dev/null @@ -1,13 +0,0 @@ -K 10 -svn:author -V 7 -tomster -K 8 -svn:date -V 27 -2009-07-13T21:09:04.304540Z -K 7 -svn:log -V 17 -We now can barify -END diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/6 b/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/6 deleted file mode 100644 index b06cd38..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revprops/0/6 +++ /dev/null @@ -1,13 +0,0 @@ -K 10 -svn:author -V 7 -tomster -K 8 -svn:date -V 27 -2009-08-06T08:06:33.365709Z -K 7 -svn:log -V 13 -releasing 0.1 -END diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/0 b/gitsvnhelpers/tests/testrepo.svn/db/revs/0/0 deleted file mode 100644 index 10f5c45..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/0 +++ /dev/null @@ -1,11 +0,0 @@ -PLAIN -END -ENDREP -id: 0.0.r0/17 -type: dir -count: 0 -text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e -cpath: / - - -17 107 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/1 b/gitsvnhelpers/tests/testrepo.svn/db/revs/0/1 deleted file mode 100644 index 3bd83b2..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/1 +++ /dev/null @@ -1,49 +0,0 @@ -id: 2-1.0.r1/0 -type: dir -count: 0 -cpath: /trunk -copyroot: 0 / - -id: 0-1.0.r1/63 -type: dir -count: 0 -cpath: /branches -copyroot: 0 / - -id: 1-1.0.r1/130 -type: dir -count: 0 -cpath: /tags -copyroot: 0 / - -PLAIN -K 8 -branches -V 15 -dir 0-1.0.r1/63 -K 4 -tags -V 16 -dir 1-1.0.r1/130 -K 5 -trunk -V 14 -dir 2-1.0.r1/0 -END -ENDREP -id: 0.0.r1/306 -type: dir -pred: 0.0.r0/17 -count: 1 -text: 1 194 99 99 f518773917d40d257c04097c223eb7d3 -cpath: / -copyroot: 0 / - -_2.0.t0-0 add false false /trunk - -_0.0.t0-0 add false false /branches - -_1.0.t0-0 add false false /tags - - -306 431 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/2 b/gitsvnhelpers/tests/testrepo.svn/db/revs/0/2 deleted file mode 100644 index e4d8222af393b256fbf54cae34c6a659892c057e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 653 zcmZ{i%TB{E5JiFItYPmTpqUvz(sWm;Ss6(c4!5(Rca*o4?Y+>eNYfcPQ18| zeU5J?_0|0t?jEMcM@Oe8XUCtX_p|w0q|tWER}s6n#q$8_>EyP)fw>0S7?j&e0K_v>sc?4<6W(TaAp)y>N)V@V7(Xo@9F5pn(KlULson5$DSVIEWkSG#& z4@ZTO$xcDEPkn0oly)geOmV``jpVO4`46>U+PE#M8-zv%%o;<%`F`^WW*{$GgSs*ZJG?+0XB1uY%3G z4f4tc#@=JIb*tLK85&#Ey0SM@+_-Wa!*Do+vaTo17C@U4?^I=9znKF1Xxhp;9Db=c zxKj59b7L&}uMqs+$$AYCr5(o3lH6v>!R$fV@~l@i>x zF;gt7TLVSCvChlj%!6M!5~PA74P(??g*wuSPBK!axJD|Wd*AzFoi7%I!e{x-T@`#n zbVzt&+ygy@Vq?04;!(1P(p3vhYdrB@WC3I1fXR-SEFl=lZsf6wW96X*i3&r6D)J)d zBIbgVP{${j{-*!(#gMnk7Av#v-~@Odo~^e>1IayG2u|Jfs_a#IP$?%~7SNY*SDNnh zUvMYjWQQ$T{10|7`Eo|=0L_okf`+~kw4X{ANhyk=6htyXN)|`C$(58bVI&EYV|P!9 cv+f1Q#tfC#=uI0e)$Q7x`~v{*4kIDq4@+L!Gynhq diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/4 b/gitsvnhelpers/tests/testrepo.svn/db/revs/0/4 deleted file mode 100644 index dbb70a0..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/4 +++ /dev/null @@ -1,50 +0,0 @@ -id: 2-1.0-4.r4/0 -type: dir -pred: 2-1.0.r3/379 -count: 3 -text: 3 290 76 76 b8a88a153507ce05acbcb35835304d8d -cpath: /branches/feature-bar -copyfrom: 3 /trunk - -PLAIN -K 11 -feature-bar -V 16 -dir 2-1.0-4.r4/0 -END -ENDREP -id: 0-1.0.r4/211 -type: dir -pred: 0-1.0.r1/63 -count: 1 -text: 4 155 43 43 42afb0ce55fca5e12ee82001043d4225 -cpath: /branches -copyroot: 0 / - -PLAIN -K 8 -branches -V 16 -dir 0-1.0.r4/211 -K 4 -tags -V 16 -dir 1-1.0.r1/130 -K 5 -trunk -V 16 -dir 2-1.0.r3/379 -END -ENDREP -id: 0.0.r4/463 -type: dir -pred: 0.0.r3/628 -count: 4 -text: 4 348 102 102 dc1b366ffce335f53a99a7c523abecd1 -cpath: / -copyroot: 0 / - -2-1._0.t3-3 add false false /branches/feature-bar -3 /trunk - -463 591 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/5 b/gitsvnhelpers/tests/testrepo.svn/db/revs/0/5 deleted file mode 100644 index 32393f67bf507e3be07c7fa619fb9ff3b18dad17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1820 zcmb7EU60#D6kR|9X(V_+{Q-B=hXq06`Sv){KCCwBg0`%xQWfzO&1YkE*Nz;gG)SN> z{2re8gNz+Jc$;cjtQpzT9p5?U+;i`2{`AEeFu*_rLqEQ}`snEP(e3$XlTVLcAN}=B zK8E~ez8PacZ$7qGg3P?pA5`L7;y;dU2q zkJ0d+-33RtUw-lX=YP*n-pyyHe?B>Xa{9+_kB^hhx=Ku5B))h9t8Kk33-lO#VM`am zPhnGsu|lKK2t^!|)fOS=1KjAm`0DE^8c_ea+`v-5i5R^vI{w~GMhKxiz+zG88^2h< z=_#Bn;&Xy}h`E~r9@}wEFn@NTW*Sa3Ix^uZG4L; zqU1m_0hSt`Sxc}|Qdwf0mLgy)l_45y=8#?KdO3w;r=wpdov`CbE{Q@m1Z}z6R%ID8 z^A8`4gjz_nhb&mcatJxbClyV&I7F-jC=MwBDlFkTbtzLqGwq#KDfJ8+oKcPmxgYWK z`PuA;`J{eZKOD8_QKy6rQFp51y{bfI(ecssTmnuR!a~m+4ooI5(q{EZZBhTQR9Z_lRKhcg6wTMJadO)bEd28@XQ^*#bz10k&a0( z62Vw@D!IJs+_;bP1oyS&d)-tjfsnM_MpH~>;Krri7;A+wMp`Q+W!TYF-K*O}YPuJU zpn;W9%QOOpJyemjRNiBX8>UUyk?6Jqo?VnDv@znY>tb_uT}Ox_5WNvsU^7uqnEDJPvz4`>dkVMq|_X(-fpWi8PY) z;E8p@3O6Y7`>gw^SMxE4n>cX879w~LL0_-^hlfu;rO+bcixac`S3CFLKlbyx@1g&7 P>!2GEB2liWK9%SnX-@~H diff --git a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/6 b/gitsvnhelpers/tests/testrepo.svn/db/revs/0/6 deleted file mode 100644 index 0ec7e5b..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/revs/0/6 +++ /dev/null @@ -1,50 +0,0 @@ -id: 2-1.0-6.r6/0 -type: dir -pred: 2-1.0.r3/379 -count: 3 -text: 3 290 76 76 b8a88a153507ce05acbcb35835304d8d -cpath: /tags/0.1 -copyfrom: 5 /trunk - -PLAIN -K 3 -0.1 -V 16 -dir 2-1.0-6.r6/0 -END -ENDREP -id: 1-1.0.r6/190 -type: dir -pred: 1-1.0.r1/130 -count: 1 -text: 6 143 34 34 22f053462a77c5a03b476cbfd05c2ce4 -cpath: /tags -copyroot: 0 / - -PLAIN -K 8 -branches -V 17 -dir 0-1.0.r5/1240 -K 4 -tags -V 16 -dir 1-1.0.r6/190 -K 5 -trunk -V 16 -dir 2-1.0.r3/379 -END -ENDREP -id: 0.0.r6/440 -type: dir -pred: 0.0.r5/1496 -count: 6 -text: 6 324 103 103 0c66fdf3bec1ee8c5636d7dbcfe50865 -cpath: / -copyroot: 0 / - -2-1._0.t5-5 add false false /tags/0.1 -5 /trunk - -440 569 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/txn-current b/gitsvnhelpers/tests/testrepo.svn/db/txn-current deleted file mode 100644 index 1e8b314..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/txn-current +++ /dev/null @@ -1 +0,0 @@ -6 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/txn-current-lock b/gitsvnhelpers/tests/testrepo.svn/db/txn-current-lock deleted file mode 100644 index e69de29..0000000 diff --git a/gitsvnhelpers/tests/testrepo.svn/db/uuid b/gitsvnhelpers/tests/testrepo.svn/db/uuid deleted file mode 100644 index 92f8ccb..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/db/uuid +++ /dev/null @@ -1 +0,0 @@ -a0614927-e084-44b0-b406-a817ffebb7fa diff --git a/gitsvnhelpers/tests/testrepo.svn/db/write-lock b/gitsvnhelpers/tests/testrepo.svn/db/write-lock deleted file mode 100644 index e69de29..0000000 diff --git a/gitsvnhelpers/tests/testrepo.svn/format b/gitsvnhelpers/tests/testrepo.svn/format deleted file mode 100644 index 7ed6ff8..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/format +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/post-commit.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/post-commit.tmpl deleted file mode 100644 index b8345c6..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/post-commit.tmpl +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -# POST-COMMIT HOOK -# -# The post-commit hook is invoked after a commit. Subversion runs -# this hook by invoking a program (script, executable, binary, etc.) -# named 'post-commit' (for which this file is a template) with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] REV (the number of the revision just committed) -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# Because the commit has already completed and cannot be undone, -# the exit code of the hook program is ignored. The hook program -# can use the 'svnlook' utility to help it examine the -# newly-committed tree. -# -# On a Unix system, the normal procedure is to have 'post-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-commit.bat' or 'post-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and -# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ - - -REPOS="$1" -REV="$2" - -commit-email.pl "$REPOS" "$REV" commit-watchers@example.org -log-commit.py --repository "$REPOS" --revision "$REV" diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/post-lock.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/post-lock.tmpl deleted file mode 100644 index c779f11..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/post-lock.tmpl +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -# POST-LOCK HOOK -# -# The post-lock hook is run after a path is locked. Subversion runs -# this hook by invoking a program (script, executable, binary, etc.) -# named 'post-lock' (for which this file is a template) with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] USER (the user who created the lock) -# -# The paths that were just locked are passed to the hook via STDIN (as -# of Subversion 1.2, only one path is passed per invocation, but the -# plan is to pass all locked paths at once, so the hook program -# should be written accordingly). -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# Because the lock has already been created and cannot be undone, -# the exit code of the hook program is ignored. The hook program -# can use the 'svnlook' utility to help it examine the -# newly-created lock. -# -# On a Unix system, the normal procedure is to have 'post-lock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-lock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-lock.bat' or 'post-lock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -USER="$2" - -# Send email to interested parties, let them know a lock was created: -mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/post-revprop-change.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/post-revprop-change.tmpl deleted file mode 100644 index e3b34b5..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/post-revprop-change.tmpl +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -# POST-REVPROP-CHANGE HOOK -# -# The post-revprop-change hook is invoked after a revision property -# has been added, modified or deleted. Subversion runs this hook by -# invoking a program (script, executable, binary, etc.) named -# 'post-revprop-change' (for which this file is a template), with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] REV (the revision that was tweaked) -# [3] USER (the username of the person tweaking the property) -# [4] PROPNAME (the property that was changed) -# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted) -# -# [STDIN] PROPVAL ** the old property value is passed via STDIN. -# -# Because the propchange has already completed and cannot be undone, -# the exit code of the hook program is ignored. The hook program -# can use the 'svnlook' utility to help it examine the -# new property value. -# -# On a Unix system, the normal procedure is to have 'post-revprop-change' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-revprop-change' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-revprop-change.bat' or 'post-revprop-change.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and -# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ - - -REPOS="$1" -REV="$2" -USER="$3" -PROPNAME="$4" -ACTION="$5" - -commit-email.pl --revprop-change "$REPOS" "$REV" "$USER" "$PROPNAME" watchers@example.org diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/post-unlock.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/post-unlock.tmpl deleted file mode 100644 index ae95c4b..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/post-unlock.tmpl +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -# POST-UNLOCK HOOK -# -# The post-unlock hook runs after a path is unlocked. Subversion runs -# this hook by invoking a program (script, executable, binary, etc.) -# named 'post-unlock' (for which this file is a template) with the -# following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] USER (the user who destroyed the lock) -# -# The paths that were just unlocked are passed to the hook via STDIN -# (as of Subversion 1.2, only one path is passed per invocation, but -# the plan is to pass all unlocked paths at once, so the hook program -# should be written accordingly). -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# Because the lock has already been destroyed and cannot be undone, -# the exit code of the hook program is ignored. -# -# On a Unix system, the normal procedure is to have 'post-unlock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'post-unlock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'post-unlock.bat' or 'post-unlock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -USER="$2" - -# Send email to interested parties, let them know a lock was removed: -mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-commit.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/pre-commit.tmpl deleted file mode 100644 index 7444c51..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-commit.tmpl +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -# PRE-COMMIT HOOK -# -# The pre-commit hook is invoked before a Subversion txn is -# committed. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-commit' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] TXN-NAME (the name of the txn about to be committed) -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the txn is committed; but -# if it exits with failure (non-zero), the txn is aborted, no commit -# takes place, and STDERR is returned to the client. The hook -# program can use the 'svnlook' utility to help it examine the txn. -# -# On a Unix system, the normal procedure is to have 'pre-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT *** -# *** FOR REVISION PROPERTIES (like svn:log or svn:author). *** -# -# This is why we recommend using the read-only 'svnlook' utility. -# In the future, Subversion may enforce the rule that pre-commit -# hooks should not modify the versioned data in txns, or else come -# up with a mechanism to make it safe to do so (by informing the -# committing client of the changes). However, right now neither -# mechanism is implemented, so hook writers just have to be careful. -# -# Note that 'pre-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-commit.bat' or 'pre-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and -# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ - - -REPOS="$1" -TXN="$2" - -# Make sure that the log message contains some text. -SVNLOOK=/opt/local/bin/svnlook -$SVNLOOK log -t "$TXN" "$REPOS" | \ - grep "[a-zA-Z0-9]" > /dev/null || exit 1 - -# Check that the author of this commit has the rights to perform -# the commit on the files and directories being modified. -commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1 - -# All checks passed, so allow the commit. -exit 0 diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-lock.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/pre-lock.tmpl deleted file mode 100644 index 020d172..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-lock.tmpl +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -# PRE-LOCK HOOK -# -# The pre-lock hook is invoked before an exclusive lock is -# created. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-lock' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] PATH (the path in the repository about to be locked) -# [3] USER (the user creating the lock) -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the lock is created; but -# if it exits with failure (non-zero), the lock action is aborted -# and STDERR is returned to the client. - -# On a Unix system, the normal procedure is to have 'pre-lock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-lock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-lock.bat' or 'pre-lock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -PATH="$2" -USER="$3" - -# If a lock exists and is owned by a different person, don't allow it -# to be stolen (e.g., with 'svn lock --force ...'). - -# (Maybe this script could send email to the lock owner?) -SVNLOOK=/opt/local/bin/svnlook -GREP=/bin/grep -SED=/bin/sed - -LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ - $GREP '^Owner: ' | $SED 's/Owner: //'` - -# If we get no result from svnlook, there's no lock, allow the lock to -# happen: -if [ "$LOCK_OWNER" = "" ]; then - exit 0 -fi - -# If the person locking matches the lock's owner, allow the lock to -# happen: -if [ "$LOCK_OWNER" = "$USER" ]; then - exit 0 -fi - -# Otherwise, we've got an owner mismatch, so return failure: -echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2 -exit 1 diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-revprop-change.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/pre-revprop-change.tmpl deleted file mode 100644 index 2f2de98..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-revprop-change.tmpl +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -# PRE-REVPROP-CHANGE HOOK -# -# The pre-revprop-change hook is invoked before a revision property -# is added, modified or deleted. Subversion runs this hook by invoking -# a program (script, executable, binary, etc.) named 'pre-revprop-change' -# (for which this file is a template), with the following ordered -# arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] REVISION (the revision being tweaked) -# [3] USER (the username of the person tweaking the property) -# [4] PROPNAME (the property being set on the revision) -# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted) -# -# [STDIN] PROPVAL ** the new property value is passed via STDIN. -# -# If the hook program exits with success, the propchange happens; but -# if it exits with failure (non-zero), the propchange doesn't happen. -# The hook program can use the 'svnlook' utility to examine the -# existing value of the revision property. -# -# WARNING: unlike other hooks, this hook MUST exist for revision -# properties to be changed. If the hook does not exist, Subversion -# will behave as if the hook were present, but failed. The reason -# for this is that revision properties are UNVERSIONED, meaning that -# a successful propchange is destructive; the old value is gone -# forever. We recommend the hook back up the old value somewhere. -# -# On a Unix system, the normal procedure is to have 'pre-revprop-change' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-revprop-change' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-revprop-change.bat' or 'pre-revprop-change.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and -# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ - - -REPOS="$1" -REV="$2" -USER="$3" -PROPNAME="$4" -ACTION="$5" - -if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi - -echo "Changing revision properties other than svn:log is prohibited" >&2 -exit 1 diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-unlock.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/pre-unlock.tmpl deleted file mode 100644 index 4d17b78..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/pre-unlock.tmpl +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -# PRE-UNLOCK HOOK -# -# The pre-unlock hook is invoked before an exclusive lock is -# destroyed. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-unlock' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] PATH (the path in the repository about to be unlocked) -# [3] USER (the user destroying the lock) -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# If the hook program exits with success, the lock is destroyed; but -# if it exits with failure (non-zero), the unlock action is aborted -# and STDERR is returned to the client. - -# On a Unix system, the normal procedure is to have 'pre-unlock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-unlock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-unlock.bat' or 'pre-unlock.exe', -# but the basic idea is the same. -# -# Here is an example hook script, for a Unix /bin/sh interpreter: - -REPOS="$1" -PATH="$2" -USER="$3" - -# If a lock is owned by a different person, don't allow it be broken. -# (Maybe this script could send email to the lock owner?) - -SVNLOOK=/opt/local/bin/svnlook -GREP=/bin/grep -SED=/bin/sed - -LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ - $GREP '^Owner: ' | $SED 's/Owner: //'` - -# If we get no result from svnlook, there's no lock, return success: -if [ "$LOCK_OWNER" = "" ]; then - exit 0 -fi - -# If the person unlocking matches the lock's owner, return success: -if [ "$LOCK_OWNER" = "$USER" ]; then - exit 0 -fi - -# Otherwise, we've got an owner mismatch, so return failure: -echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2 -exit 1 diff --git a/gitsvnhelpers/tests/testrepo.svn/hooks/start-commit.tmpl b/gitsvnhelpers/tests/testrepo.svn/hooks/start-commit.tmpl deleted file mode 100644 index 7597f58..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/hooks/start-commit.tmpl +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -# START-COMMIT HOOK -# -# The start-commit hook is invoked before a Subversion txn is created -# in the process of doing a commit. Subversion runs this hook -# by invoking a program (script, executable, binary, etc.) named -# 'start-commit' (for which this file is a template) -# with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] USER (the authenticated user attempting to commit) -# [3] CAPABILITIES (a colon-separated list of capabilities reported -# by the client; see note below) -# -# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5 -# clients will typically report at least the "mergeinfo" capability. -# If there are other capabilities, then the list is colon-separated, -# e.g.: "mergeinfo:some-other-capability" (the order is undefined). -# -# The list is self-reported by the client. Therefore, you should not -# make security assumptions based on the capabilities list, nor should -# you assume that clients reliably report every capability they have. -# -# The working directory for this hook program's invocation is undefined, -# so the program should set one explicitly if it cares. -# -# If the hook program exits with success, the commit continues; but -# if it exits with failure (non-zero), the commit is stopped before -# a Subversion txn is created, and STDERR is returned to the client. -# -# On a Unix system, the normal procedure is to have 'start-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'start-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'start-commit.bat' or 'start-commit.exe', -# but the basic idea is the same. -# -# The hook program typically does not inherit the environment of -# its parent process. For example, a common problem is for the -# PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and -# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ - - -REPOS="$1" -USER="$2" - -commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1 -special-auth-check.py --user "$USER" --auth-level 3 || exit 1 - -# All checks passed, so allow the commit. -exit 0 diff --git a/gitsvnhelpers/tests/testrepo.svn/locks/db-logs.lock b/gitsvnhelpers/tests/testrepo.svn/locks/db-logs.lock deleted file mode 100644 index 20dd636..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/locks/db-logs.lock +++ /dev/null @@ -1,3 +0,0 @@ -This file is not used by Subversion 1.3.x or later. -However, its existence is required for compatibility with -Subversion 1.2.x or earlier. diff --git a/gitsvnhelpers/tests/testrepo.svn/locks/db.lock b/gitsvnhelpers/tests/testrepo.svn/locks/db.lock deleted file mode 100644 index 20dd636..0000000 --- a/gitsvnhelpers/tests/testrepo.svn/locks/db.lock +++ /dev/null @@ -1,3 +0,0 @@ -This file is not used by Subversion 1.3.x or later. -However, its existence is required for compatibility with -Subversion 1.2.x or earlier. From 2a52be124364388d3c6d7f0ed4e02ab743c895b5 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Sat, 10 Mar 2012 10:09:14 -0800 Subject: [PATCH 10/11] Prettify github page --- README.txt => README.rst | 0 setup.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename README.txt => README.rst (100%) diff --git a/README.txt b/README.rst similarity index 100% rename from README.txt rename to README.rst diff --git a/setup.py b/setup.py index 0332342..43efa81 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ version=version, description="Command-line tools to make git-svn simple", long_description = ( - open('README.txt').read() + open('README.rst').read() + '\n' + 'Change history\n' '**************\n' From 8c1cd7f8d4fe4cfa8453b4b77b1cec946943f34c Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Sat, 10 Mar 2012 11:23:20 -0800 Subject: [PATCH 11/11] Fix svn switch handling. Since the svn switch can leave things in an indeterminate state from git's perspective including more than just file changes but added and removed files and directories, we need to use "git checkout -f branch" to successfully change to the new branch. Also, the existing branches parsing was missing the current branch because it wasn't stripping the "*". --- HISTORY.txt | 4 ++++ gitsvnhelpers/gitify.py | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/HISTORY.txt b/HISTORY.txt index dfca9b8..2ba6a7b 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,6 +1,10 @@ 0.9 - Unreleased ---------------- +* Fix the handling when switching to a svn branch that git already has + a local branch for. + [rossp] + 0.8 - 2010-03-10 ---------------- diff --git a/gitsvnhelpers/gitify.py b/gitsvnhelpers/gitify.py index 199119a..18610b7 100755 --- a/gitsvnhelpers/gitify.py +++ b/gitsvnhelpers/gitify.py @@ -69,7 +69,7 @@ def __call__(self): os.chdir(config.GIT_CACHE + package_name) dummy, existing_branches = popen('git branch', False, False) - existing_branches = [b.strip() for b in existing_branches] + existing_branches = [b.strip('* ') for b in existing_branches] if local_branch in existing_branches: popen('git checkout -f %s' % local_branch, False, False) else: @@ -83,10 +83,13 @@ def __call__(self): # if the working copy is on another branch, switch: if local_branch != git_branch(): if local_branch in existing_branches: - popen('git checkout %s' % local_branch) + popen('git checkout -f %s' % local_branch) else: popen('git checkout -b %s' % local_branch) + assert git_branch() == local_branch, ( + "Changing branches failed, is on %r but should be on %r" + % (git_branch(), local_branch)) print "Git branch '%s' is now following svn branch '%s':" % ( local_branch, remote_branch) popen('svn status')