Пример #1
0
svn_error_t *
svn_repos_load_fs(svn_repos_t *repos,
                  svn_stream_t *dumpstream,
                  svn_stream_t *feedback_stream,
                  enum svn_repos_load_uuid uuid_action,
                  const char *parent_dir,
                  svn_cancel_func_t cancel_func,
                  void *cancel_baton,
                  apr_pool_t *pool)
{
  return svn_repos_load_fs2(repos, dumpstream, feedback_stream,
                            uuid_action, parent_dir, FALSE, FALSE,
                            cancel_func, cancel_baton, pool);
}
Пример #2
0
static PyObject *repos_load_fs(PyObject *self, PyObject *args, PyObject *kwargs)
{
	const char *parent_dir = NULL;
	PyObject *dumpstream, *feedback_stream;
	unsigned char use_pre_commit_hook = 0, use_post_commit_hook = 0;
	char *kwnames[] = { "dumpstream", "feedback_stream", "uuid_action",
		                "parent_dir", "use_pre_commit_hook",
						"use_post_commit_hook", NULL };
	int uuid_action;
	apr_pool_t *temp_pool;
	RepositoryObject *reposobj = (RepositoryObject *)self;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOi|zbb", kwnames,
								&dumpstream, &feedback_stream, &uuid_action,
								&parent_dir, &use_pre_commit_hook,
								&use_post_commit_hook))
		return NULL;

	if (uuid_action != svn_repos_load_uuid_default &&
		uuid_action != svn_repos_load_uuid_ignore &&
		uuid_action != svn_repos_load_uuid_force) {
		PyErr_SetString(PyExc_RuntimeError, "Invalid UUID action");
		return NULL;
	}

	temp_pool = Pool(NULL);
	if (temp_pool == NULL)
		return NULL;
	RUN_SVN_WITH_POOL(temp_pool, svn_repos_load_fs2(reposobj->repos,
				new_py_stream(temp_pool, dumpstream),
				new_py_stream(temp_pool, feedback_stream),
				uuid_action, parent_dir, use_pre_commit_hook,
				use_post_commit_hook, py_cancel_check, NULL,
				temp_pool));
	apr_pool_destroy(temp_pool);
	Py_RETURN_NONE;
}