def setUp(self): dumpfile = open(os.path.join(os.path.split(__file__)[0], 'svnrepos.dump')) svn_fs._import_svn() core.apr_initialize() pool = core.svn_pool_create(None) dumpstream = None try: if os.path.exists(REPOS_PATH): print 'trouble ahead with db/rep-cache.db... see #8278' r = repos.svn_repos_create(REPOS_PATH, '', '', None, None, pool) if hasattr(repos, 'svn_repos_load_fs2'): repos.svn_repos_load_fs2(r, dumpfile, StringIO(), repos.svn_repos_load_uuid_default, '', 0, 0, None, pool) else: dumpstream = core.svn_stream_from_aprfile(dumpfile, pool) repos.svn_repos_load_fs(r, dumpstream, None, repos.svn_repos_load_uuid_default, '', None, None, pool) finally: if dumpstream: core.svn_stream_close(dumpstream) core.svn_pool_destroy(pool) core.apr_terminate()
def setUp(self): dumpfile = open( os.path.join(os.path.split(__file__)[0], 'svnrepos.dump')) svn_fs._import_svn() core.apr_initialize() pool = core.svn_pool_create(None) dumpstream = None try: if os.path.exists(REPOS_PATH): print 'trouble ahead with db/rep-cache.db... see #8278' r = repos.svn_repos_create(REPOS_PATH, '', '', None, None, pool) if hasattr(repos, 'svn_repos_load_fs2'): repos.svn_repos_load_fs2(r, dumpfile, StringIO(), repos.svn_repos_load_uuid_default, '', 0, 0, None, pool) else: dumpstream = core.svn_stream_from_aprfile(dumpfile, pool) repos.svn_repos_load_fs(r, dumpstream, None, repos.svn_repos_load_uuid_default, '', None, None, pool) finally: if dumpstream: core.svn_stream_close(dumpstream) core.svn_pool_destroy(pool) core.apr_terminate()
def setupClass(cls): svn_fs._import_svn() core.apr_initialize() pool = core.svn_pool_create(None) dumpstream = None cls.repos_path = tempfile.mkdtemp(prefix='svn-tmp') shutil.rmtree(cls.repos_path) dumpfile = open(os.path.join(os.path.split(__file__)[0], 'svn.dump')) try: r = repos.svn_repos_create(cls.repos_path, '', '', None, None, pool) if hasattr(repos, 'svn_repos_load_fs2'): repos.svn_repos_load_fs2(r, dumpfile, StringIO(), repos.svn_repos_load_uuid_default, '', 0, 0, None, pool) else: dumpstream = core.svn_stream_from_aprfile(dumpfile, pool) repos.svn_repos_load_fs(r, dumpstream, None, repos.svn_repos_load_uuid_default, '', None, None, pool) finally: if dumpstream: core.svn_stream_close(dumpstream) core.svn_pool_destroy(pool) core.apr_terminate()