您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ svn_pool_destroy函数代码示例

51自学网 2021-06-03 08:34:20
  C++
这篇教程C++ svn_pool_destroy函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中svn_pool_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ svn_pool_destroy函数的具体用法?C++ svn_pool_destroy怎么用?C++ svn_pool_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了svn_pool_destroy函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: start_element

//.........这里部分代码省略.........          {            const char *crev = svn_xml_get_attr_value("rev", atts);            if (crev)              rev = SVN_STR_TO_REV(crev);            else              rev = SVN_INVALID_REVNUM;            SVN_ERR(rb->editor->open_file(path, parent->baton, rev,                                          parent->file_pool,                                          &rb->file_baton));          }      }      break;    case ELEM_apply_textdelta:      if (! rb->file_baton)        return svn_error_create                 (SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,                  _("Got apply-textdelta element without preceding "                    "add-file or open-file"));      else        {          const char *checksum = svn_xml_get_attr_value("checksum", atts);          SVN_ERR(rb->editor->apply_textdelta(rb->file_baton,                                              checksum,                                              TOP_DIR(rb).file_pool,                                              &rb->whandler,                                              &rb->whandler_baton));          rb->svndiff_decoder = svn_txdelta_parse_svndiff                                  (rb->whandler, rb->whandler_baton,                                   TRUE, TOP_DIR(rb).file_pool);          rb->base64_decoder = svn_base64_decode(rb->svndiff_decoder,                                                 TOP_DIR(rb).file_pool);        }      break;    case ELEM_close_file:      if (! rb->file_baton)        return svn_error_create                  (SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,                   _("Got close-file element without preceding "                     "add-file or open-file"));      else        {          const char *checksum = svn_xml_get_attr_value("checksum", atts);          SVN_ERR(rb->editor->close_file(rb->file_baton,                                         checksum,                                         TOP_DIR(rb).file_pool));          rb->file_baton = NULL;        }      break;    case ELEM_close_directory:      if (rb->dirs->nelts == 0)        return svn_error_create                 (SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,                  _("Got close-directory element without ever opening "                    "a directory"));      else        {          dir_item_t *di = &TOP_DIR(rb);          SVN_ERR(rb->editor->close_directory(di->baton, di->pool));          svn_pool_destroy(di->pool);          apr_array_pop(rb->dirs);        }      break;    case ELEM_change_file_prop:    case ELEM_change_dir_prop:      {        const char *name = svn_xml_get_attr_value("name", atts);        if (! name)          return MISSING_ATTR(nspace, elt_name, "name");        else          {            svn_pool_clear(rb->prop_pool);            if (svn_xml_get_attr_value("del", atts))              rb->prop_accum = NULL;            else              rb->prop_accum = svn_stringbuf_create_empty(rb->prop_pool);            rb->prop_name = apr_pstrdup(rb->prop_pool, name);          }      }      break;    }  *elem = elm->id;  return SVN_NO_ERROR;}
开发者ID:dtrebbien,项目名称:subversion,代码行数:101,


示例2: svn_pool_destroy

SvnClientImpl::~SvnClientImpl(){	svn_pool_destroy(_pool);}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:4,


示例3: l_propget

static intl_propget (lua_State *L) {	const char *path = luaL_checkstring (L, 1);	const char *propname = luaL_checkstring (L, 2);	svn_opt_revision_t peg_revision;	svn_opt_revision_t revision;		peg_revision.kind = svn_opt_revision_unspecified;	if (lua_gettop (L) < 3 || lua_isnil (L, 3)) {		revision.kind = svn_opt_revision_unspecified;	} else {		revision.kind = svn_opt_revision_number;		revision.value.number = lua_tointeger (L, 3);	}		svn_boolean_t recursive = FALSE;		int itable = 4;	if (lua_gettop (L) >= itable && lua_istable (L, itable)) {				lua_getfield (L, itable, "recursive");		if (lua_isboolean (L, -1)) {			recursive = lua_toboolean (L, -1);		}	} 	apr_pool_t *pool;	svn_error_t *err;	svn_client_ctx_t *ctx;	init_function (&ctx, &pool, L);	path = svn_path_canonicalize (path, pool);		apr_hash_t *props;	const char *propname_utf8;	err = svn_utf_cstring_to_utf8 (&propname_utf8, propname, pool);	IF_ERROR_RETURN (err, pool, L);	err = svn_client_propget2 (&props, propname_utf8, path, &peg_revision, &revision, recursive, ctx, pool);	IF_ERROR_RETURN (err, pool, L);	lua_newtable (L);	const void *key;	void *val;	apr_hash_index_t *hi;	for (hi = apr_hash_first (pool, props); hi; hi = apr_hash_next (hi)) {		apr_hash_this (hi, &key, NULL, &val);		svn_string_t *s = (svn_string_t *) val;		lua_pushstring (L, s->data);		lua_setfield (L, -2, (char *) key);	}	svn_pool_destroy (pool);	return 1;}
开发者ID:krfkeith,项目名称:luasvn,代码行数:68,


示例4: add_dir_recursive

//.........这里部分代码省略.........  if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)    svn_error_clear(err);  else if (err)    return err;  SVN_ERR(svn_wc_adm_retrieve(&dir_access, adm_access, dirname, pool));  if (!no_ignore)    SVN_ERR(svn_wc_get_ignores(&ignores, ctx->config, dir_access, pool));  subpool = svn_pool_create(pool);  SVN_ERR(svn_io_dir_open(&dir, dirname, pool));  /* Read the directory entries one by one and add those things to     version control. */  while (1)    {      const char *fullpath;      svn_pool_clear(subpool);      err = svn_io_dir_read(&this_entry, flags, dir, subpool);      if (err)        {          /* Check if we're done reading the dir's entries. */          if (APR_STATUS_IS_ENOENT(err->apr_err))            {              apr_status_t apr_err;              svn_error_clear(err);              apr_err = apr_dir_close(dir);              if (apr_err)                return svn_error_wrap_apr                  (apr_err, _("Can't close directory '%s'"),                   svn_path_local_style(dirname, subpool));              break;            }          else            {              return svn_error_createf                (err->apr_err, err,                 _("Error during add of '%s'"),                 svn_path_local_style(dirname, subpool));            }        }      /* Skip entries for this dir and its parent.  */      if (this_entry.name[0] == '.'          && (this_entry.name[1] == '/0'              || (this_entry.name[1] == '.' && this_entry.name[2] == '/0')))        continue;      /* Check cancellation so you can cancel during an       * add of a directory with lots of files. */      if (ctx->cancel_func)        SVN_ERR(ctx->cancel_func(ctx->cancel_baton));      /* Skip over SVN admin directories. */      if (svn_wc_is_adm_dir(this_entry.name, subpool))        continue;      if ((!no_ignore) && svn_wc_match_ignore_list(this_entry.name,                                                   ignores, subpool))        continue;      /* Construct the full path of the entry. */      fullpath = svn_path_join(dirname, this_entry.name, subpool);      /* Recurse on directories; add files; ignore the rest. */      if (this_entry.filetype == APR_DIR && depth >= svn_depth_immediates)        {          svn_depth_t depth_below_here = depth;          if (depth == svn_depth_immediates)            depth_below_here = svn_depth_empty;          SVN_ERR(add_dir_recursive(fullpath, dir_access, depth_below_here,                                    force, no_ignore, ctx, subpool));        }      else if (this_entry.filetype != APR_UNKFILE               && this_entry.filetype != APR_DIR               && depth >= svn_depth_files)        {          err = add_file(fullpath, ctx, dir_access, subpool);          if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)            svn_error_clear(err);          else if (err)            return err;        }    }  /* Opened by svn_wc_add */  SVN_ERR(svn_wc_adm_close(dir_access));  /* Destroy the per-iteration pool. */  svn_pool_destroy(subpool);  return SVN_NO_ERROR;}
开发者ID:vocho,项目名称:openqnx,代码行数:101,


示例5: svn_cl__add

/* This implements the `svn_opt_subcommand_t' interface. */svn_error_t *svn_cl__add(apr_getopt_t *os,            void *baton,            apr_pool_t *pool){  svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;  svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;  apr_array_header_t *targets;  int i;  apr_pool_t *iterpool;  apr_array_header_t *errors = apr_array_make(pool, 0, sizeof(apr_status_t));  SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,                                                      opt_state->targets,                                                      ctx, FALSE, pool));  if (! targets->nelts)    return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);  if (opt_state->depth == svn_depth_unknown)    opt_state->depth = svn_depth_infinity;  SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));  SVN_ERR(svn_cl__check_targets_are_local_paths(targets));  iterpool = svn_pool_create(pool);  for (i = 0; i < targets->nelts; i++)    {      const char *target = APR_ARRAY_IDX(targets, i, const char *);      svn_pool_clear(iterpool);      SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));      SVN_ERR(svn_cl__try              (svn_client_add4(target,                               opt_state->depth,                               opt_state->force, opt_state->no_ignore,                               opt_state->parents, ctx, iterpool),               errors, opt_state->quiet,               SVN_ERR_ENTRY_EXISTS,               SVN_ERR_WC_PATH_NOT_FOUND,               SVN_NO_ERROR));    }  svn_pool_destroy(iterpool);  if (errors->nelts > 0)    {      svn_error_t *err;      err = svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL, NULL);      for (i = 0; i < errors->nelts; i++)        {          apr_status_t status = APR_ARRAY_IDX(errors, i, apr_status_t);          if (status == SVN_ERR_WC_PATH_NOT_FOUND)            err = svn_error_quick_wrap(err,                                       _("Could not add all targets because "                                         "some targets don't exist"));          else if (status == SVN_ERR_ENTRY_EXISTS)            err = svn_error_quick_wrap(err,                                       _("Could not add all targets because "                                         "some targets are already versioned"));        }      return svn_error_trace(err);    }  return SVN_NO_ERROR;}
开发者ID:Distrotech,项目名称:subversion,代码行数:70,


示例6: svn_fs_close_root

voidsvn_fs_close_root(svn_fs_root_t *root){  svn_pool_destroy(root->pool);}
开发者ID:ChaosJohn,项目名称:freebsd,代码行数:5,


示例7: delete_thread

static gpointer delete_thread (gpointer user_data){  struct thread_args *args = user_data;  svn_error_t *err;  apr_array_header_t *paths;  svn_client_ctx_t *ctx = args->ctx;  apr_pool_t *subpool, *pool = args->pool;  TshNotifyDialog *dialog = args->dialog;  gchar **files = args->files;  gint size, i;  gchar *error_str;#if CHECK_SVN_VERSION_S(1,6)  svn_commit_info_t *commit_info;  gchar *message;  gchar buffer[256];#endif  g_free (args);  size = files?g_strv_length(files):0;  subpool = svn_pool_create (pool);  if(size)  {    paths = apr_array_make (subpool, size, sizeof (const char *));    for (i = 0; i < size; i++)    {      APR_ARRAY_PUSH (paths, const char *) = files[i];    }  }  else  {    paths = apr_array_make (subpool, 1, sizeof (const char *));    APR_ARRAY_PUSH (paths, const char *) = ""; // current directory  }#if CHECK_SVN_VERSION_S(1,6)  if ((err = svn_client_delete3(&commit_info, paths, FALSE, FALSE, NULL, ctx, subpool)))#else /* CHECK_SVN_VERSION(1,7) */  if ((err = svn_client_delete4(paths, FALSE, FALSE, NULL, tsh_commit_func2, dialog, ctx, subpool)))#endif  {    svn_pool_destroy (subpool);    error_str = tsh_strerror(err);G_GNUC_BEGIN_IGNORE_DEPRECATIONS    gdk_threads_enter();    tsh_notify_dialog_add(dialog, _("Failed"), error_str, NULL);    tsh_notify_dialog_done (dialog);    gdk_threads_leave();G_GNUC_END_IGNORE_DEPRECATIONS    g_free(error_str);    svn_error_clear(err);    tsh_reset_cancel();    return GINT_TO_POINTER (FALSE);  }#if CHECK_SVN_VERSION_S(1,6)  if(commit_info && SVN_IS_VALID_REVNUM(commit_info->revision))  {    g_snprintf(buffer, 256, _("At revision: %ld"), commit_info->revision);    message = buffer;  }  else  {    message = _("Local delete");  }#endif  svn_pool_destroy (subpool);G_GNUC_BEGIN_IGNORE_DEPRECATIONS  gdk_threads_enter();#if CHECK_SVN_VERSION_S(1,6)  tsh_notify_dialog_add(dialog, _("Completed"), message, NULL);#endif  tsh_notify_dialog_done (dialog);  gdk_threads_leave();G_GNUC_END_IGNORE_DEPRECATIONS  tsh_reset_cancel();  return GINT_TO_POINTER (TRUE);}
开发者ID:xfce-mirror,项目名称:thunar-vcs-plugin,代码行数:89,


示例8: add_file_or_directory

/* This function is the shared guts of add_file() and add_directory(),   which see for the meanings of the parameters.  The only extra   parameter here is IS_DIR, which is TRUE when adding a directory,   and FALSE when adding a file.  */static svn_error_t *add_file_or_directory(const char *path,                      void *parent_baton,                      const char *copy_path,                      svn_revnum_t copy_revision,                      svn_boolean_t is_dir,                      apr_pool_t *pool,                      void **return_baton){  struct dir_baton *pb = parent_baton;  struct edit_baton *eb = pb->edit_baton;  apr_pool_t *subpool = svn_pool_create(pool);  svn_boolean_t was_copied = FALSE;  const char *full_path;  full_path = svn_fspath__join(eb->base_path,                               svn_relpath_canonicalize(path, pool), pool);  /* Sanity check. */  if (copy_path && (! SVN_IS_VALID_REVNUM(copy_revision)))    return svn_error_createf      (SVN_ERR_FS_GENERAL, NULL,       _("Got source path but no source revision for '%s'"), full_path);  if (copy_path)    {      const char *fs_path;      svn_fs_root_t *copy_root;      svn_node_kind_t kind;      size_t repos_url_len;      svn_repos_authz_access_t required;      /* Copy requires recursive write access to the destination path         and write access to the parent path. */      required = svn_authz_write | (is_dir ? svn_authz_recursive : 0);      SVN_ERR(check_authz(eb, full_path, eb->txn_root,                          required, subpool));      SVN_ERR(check_authz(eb, pb->path, eb->txn_root,                          svn_authz_write, subpool));      /* Check PATH in our transaction.  Make sure it does not exist         unless its parent directory was copied (in which case, the         thing might have been copied in as well), else return an         out-of-dateness error. */      SVN_ERR(svn_fs_check_path(&kind, eb->txn_root, full_path, subpool));      if ((kind != svn_node_none) && (! pb->was_copied))        return out_of_date(full_path, kind);      /* For now, require that the url come from the same repository         that this commit is operating on. */      copy_path = svn_path_uri_decode(copy_path, subpool);      repos_url_len = strlen(eb->repos_url);      if (strncmp(copy_path, eb->repos_url, repos_url_len) != 0)        return svn_error_createf          (SVN_ERR_FS_GENERAL, NULL,           _("Source url '%s' is from different repository"), copy_path);      fs_path = apr_pstrdup(subpool, copy_path + repos_url_len);      /* Now use the "fs_path" as an absolute path within the         repository to make the copy from. */      SVN_ERR(svn_fs_revision_root(&copy_root, eb->fs,                                   copy_revision, subpool));      /* Copy also requires (recursive) read access to the source */      required = svn_authz_read | (is_dir ? svn_authz_recursive : 0);      SVN_ERR(check_authz(eb, fs_path, copy_root, required, subpool));      SVN_ERR(svn_fs_copy(copy_root, fs_path,                          eb->txn_root, full_path, subpool));      was_copied = TRUE;    }  else    {      /* No ancestry given, just make a new directory or empty file.         Note that we don't perform an existence check here like the         copy-from case does -- that's because svn_fs_make_*()         already errors out if the file already exists.  Verify write         access to the full path and to the parent. */      SVN_ERR(check_authz(eb, full_path, eb->txn_root,                          svn_authz_write, subpool));      SVN_ERR(check_authz(eb, pb->path, eb->txn_root,                          svn_authz_write, subpool));      if (is_dir)        SVN_ERR(svn_fs_make_dir(eb->txn_root, full_path, subpool));      else        SVN_ERR(svn_fs_make_file(eb->txn_root, full_path, subpool));    }  /* Cleanup our temporary subpool. */  svn_pool_destroy(subpool);  /* Build a new child baton. */  if (is_dir)    {      *return_baton = make_dir_baton(eb, pb, full_path, was_copied,//.........这里部分代码省略.........
开发者ID:DJEX93,项目名称:dsploit,代码行数:101,


示例9: svn_handle_error2

voidsvn_handle_error2(svn_error_t *err,                  FILE *stream,                  svn_boolean_t fatal,                  const char *prefix){  /* In a long error chain, there may be multiple errors with the same     error code and no custom message.  We only want to print the     default message for that code once; printing it multiple times     would add no useful information.  The 'empties' array below     remembers the codes of empty errors already seen in the chain.     We could allocate it in err->pool, but there's no telling how     long err will live or how many times it will get handled.  So we     use a subpool. */  apr_pool_t *subpool;  apr_array_header_t *empties;  svn_error_t *tmp_err;  /* ### The rest of this file carefully avoids using svn_pool_*(),     preferring apr_pool_*() instead.  I can't remember why -- it may     be an artifact of r3719, or it may be for some deeper reason --     but I'm playing it safe and using apr_pool_*() here too. */  apr_pool_create(&subpool, err->pool);  empties = apr_array_make(subpool, 0, sizeof(apr_status_t));  tmp_err = err;  while (tmp_err)    {      int i;      svn_boolean_t printed_already = FALSE;      if (! tmp_err->message)        {          for (i = 0; i < empties->nelts; i++)            {              if (tmp_err->apr_err == APR_ARRAY_IDX(empties, i, apr_status_t) )                {                  printed_already = TRUE;                  break;                }            }        }      if (! printed_already)        {          print_error(tmp_err, stream, prefix);          if (! tmp_err->message)            {              APR_ARRAY_PUSH(empties, apr_status_t) = tmp_err->apr_err;            }        }      tmp_err = tmp_err->child;    }  svn_pool_destroy(subpool);  fflush(stream);  if (fatal)    {      /* Avoid abort()s in maintainer mode. */      svn_error_clear(err);      /* We exit(1) here instead of abort()ing so that atexit handlers         get called. */      exit(EXIT_FAILURE);    }}
开发者ID:andmedsantana,项目名称:TortoiseGit,代码行数:69,


示例10: svn_cl__propdel

/* This implements the `svn_opt_subcommand_t' interface. */svn_error_t *svn_cl__propdel(apr_getopt_t *os,                void *baton,                apr_pool_t *pool){  svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;  svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;  const char *pname, *pname_utf8;  apr_array_header_t *args, *targets;  int i;  /* Get the property's name (and a UTF-8 version of that name). */  SVN_ERR(svn_opt_parse_num_args(&args, os, 1, pool));  pname = APR_ARRAY_IDX(args, 0, const char *);  SVN_ERR(svn_utf_cstring_to_utf8(&pname_utf8, pname, pool));  /* No need to check svn_prop_name_is_valid for *deleting*     properties, and it may even be useful to allow, in case invalid     properties sneaked through somehow. */  SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,                                                      opt_state->targets,                                                       pool));  /* Add "." if user passed 0 file arguments */  svn_opt_push_implicit_dot_target(targets, pool);  if (opt_state->revprop)  /* operate on a revprop */    {      svn_revnum_t rev;      const char *URL;      SVN_ERR(svn_cl__revprop_prepare(&opt_state->start_revision, targets,                                      &URL, pool));      /* Let libsvn_client do the real work. */      SVN_ERR(svn_client_revprop_set(pname_utf8, NULL,                                     URL, &(opt_state->start_revision),                                     &rev, FALSE, ctx, pool));      if (! opt_state->quiet)        {          SVN_ERR(svn_cmdline_printf(pool,                                     _("property '%s' deleted from"                                       " repository revision %ld/n"),                                     pname_utf8, rev));        }    }  else if (opt_state->start_revision.kind != svn_opt_revision_unspecified)    {      return svn_error_createf        (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,         _("Cannot specify revision for deleting versioned property '%s'"),         pname);    }  else  /* operate on a normal, versioned property (not a revprop) */    {      apr_pool_t *subpool = svn_pool_create(pool);      if (opt_state->depth == svn_depth_unknown)        opt_state->depth = svn_depth_empty;      /* For each target, remove the property PNAME. */      for (i = 0; i < targets->nelts; i++)        {          const char *target = APR_ARRAY_IDX(targets, i, const char *);          svn_commit_info_t *commit_info;          svn_boolean_t success;          svn_pool_clear(subpool);          SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));          /* Pass FALSE for 'skip_checks' because it doesn't matter here,             and opt_state->force doesn't apply to this command anyway. */          SVN_ERR(svn_cl__try(svn_client_propset3                              (&commit_info, pname_utf8,                               NULL, target,                               opt_state->depth,                               FALSE, SVN_INVALID_REVNUM,                               opt_state->changelists, NULL,                                ctx, subpool),                              &success, opt_state->quiet,                              SVN_ERR_UNVERSIONED_RESOURCE,                              SVN_ERR_ENTRY_NOT_FOUND,                              SVN_NO_ERROR));          if (success && (! opt_state->quiet))            {              SVN_ERR(svn_cmdline_printf                      (subpool,                       SVN_DEPTH_IS_RECURSIVE(opt_state->depth)                       ? _("property '%s' deleted (recursively) from '%s'./n")                       : _("property '%s' deleted from '%s'./n"),                       pname_utf8, svn_path_local_style(target, subpool)));            }        }      svn_pool_destroy(subpool);    }  return SVN_NO_ERROR;//.........这里部分代码省略.........
开发者ID:niallo,项目名称:mwbuild,代码行数:101,


示例11: crop_children

//.........这里部分代码省略.........      svn_wc__db_status_t child_status;      svn_wc__db_kind_t kind;      svn_depth_t child_depth;      svn_pool_clear(iterpool);      /* Get the next node */      child_abspath = svn_dirent_join(local_abspath, child_name, iterpool);      SVN_ERR(svn_wc__db_read_info(&child_status, &kind, NULL, NULL, NULL,                                   NULL,NULL, NULL, NULL, &child_depth,                                   NULL, NULL, NULL, NULL, NULL, NULL,                                   NULL, NULL, NULL, NULL, NULL, NULL,                                   NULL, NULL, NULL, NULL, NULL,                                   db, child_abspath, iterpool, iterpool));      if (child_status == svn_wc__db_status_server_excluded ||          child_status == svn_wc__db_status_excluded ||          child_status == svn_wc__db_status_not_present)        {          svn_depth_t remove_below = (kind == svn_wc__db_kind_dir)                                            ? svn_depth_immediates                                            : svn_depth_files;          if (new_depth < remove_below)            SVN_ERR(svn_wc__db_op_remove_node(db, local_abspath,                                              SVN_INVALID_REVNUM,                                              svn_wc__db_kind_unknown,                                              iterpool));          continue;        }      else if (kind == svn_wc__db_kind_file)        {          /* We currently crop on a directory basis. So don't worry about             svn_depth_exclude here. And even we permit excluding a single             file in the future, svn_wc_remove_from_revision_control() can             also handle it. We only need to skip the notification in that             case. */          if (new_depth == svn_depth_empty)            IGNORE_LOCAL_MOD(              svn_wc__internal_remove_from_revision_control(                                                   db,                                                   child_abspath,                                                   TRUE, /* destroy */                                                   FALSE, /* instant error */                                                   cancel_func, cancel_baton,                                                   iterpool));          else            continue;        }      else if (kind == svn_wc__db_kind_dir)        {          if (new_depth < svn_depth_immediates)            {              IGNORE_LOCAL_MOD(                svn_wc__internal_remove_from_revision_control(                                                     db,                                                     child_abspath,                                                     TRUE, /* destroy */                                                     FALSE, /* instant error */                                                     cancel_func,                                                     cancel_baton,                                                     iterpool));            }          else            {              SVN_ERR(crop_children(db,                                    child_abspath,                                    child_depth,                                    svn_depth_empty,                                    notify_func,                                    notify_baton,                                    cancel_func,                                    cancel_baton,                                    iterpool));              continue;            }        }      else        {          return svn_error_createf            (SVN_ERR_NODE_UNKNOWN_KIND, NULL, _("Unknown node kind for '%s'"),             svn_dirent_local_style(child_abspath, iterpool));        }      if (notify_func)        {          svn_wc_notify_t *notify;          notify = svn_wc_create_notify(child_abspath,                                        svn_wc_notify_delete,                                        iterpool);          (*notify_func)(notify_baton, notify, iterpool);        }    }  svn_pool_destroy(iterpool);  return SVN_NO_ERROR;}
开发者ID:AsherBond,项目名称:MondocosmOS-Dependencies,代码行数:101,


示例12: svn_cl__null_blame

//.........这里部分代码省略.........  int i;  svn_boolean_t end_revision_unspecified = FALSE;  svn_boolean_t seen_nonexistent_target = FALSE;  SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,                                                      opt_state->targets,                                                      ctx, FALSE, pool));  /* Blame needs a file on which to operate. */  if (! targets->nelts)    return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);  if (opt_state->end_revision.kind == svn_opt_revision_unspecified)    {      if (opt_state->start_revision.kind != svn_opt_revision_unspecified)        {          /* In the case that -rX was specified, we actually want to set the             range to be -r1:X. */          opt_state->end_revision = opt_state->start_revision;          opt_state->start_revision.kind = svn_opt_revision_number;          opt_state->start_revision.value.number = 1;        }      else        end_revision_unspecified = TRUE;    }  if (opt_state->start_revision.kind == svn_opt_revision_unspecified)    {      opt_state->start_revision.kind = svn_opt_revision_number;      opt_state->start_revision.value.number = 1;    }  /* The final conclusion from issue #2431 is that blame info     is client output (unlike 'svn cat' which plainly cats the file),     so the EOL style should be the platform local one.  */  iterpool = svn_pool_create(pool);  for (i = 0; i < targets->nelts; i++)    {      svn_error_t *err;      const char *target = APR_ARRAY_IDX(targets, i, const char *);      const char *parsed_path;      svn_opt_revision_t peg_revision;      svn_pool_clear(iterpool);      SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));      /* Check for a peg revision. */      SVN_ERR(svn_opt_parse_path(&peg_revision, &parsed_path, target,                                 iterpool));      if (end_revision_unspecified)        {          if (peg_revision.kind != svn_opt_revision_unspecified)            opt_state->end_revision = peg_revision;          else if (svn_path_is_url(target))            opt_state->end_revision.kind = svn_opt_revision_head;          else            opt_state->end_revision.kind = svn_opt_revision_working;        }      err = bench_null_blame(parsed_path,                             &peg_revision,                             &opt_state->start_revision,                             &opt_state->end_revision,                             opt_state->use_merge_history,                             opt_state->quiet,                             ctx,                             iterpool);      if (err)        {          if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||                   err->apr_err == SVN_ERR_ENTRY_NOT_FOUND ||                   err->apr_err == SVN_ERR_FS_NOT_FILE ||                   err->apr_err == SVN_ERR_FS_NOT_FOUND)            {              svn_handle_warning2(stderr, err, "svn: ");              svn_error_clear(err);              err = NULL;              seen_nonexistent_target = TRUE;            }          else            {              return svn_error_trace(err);            }        }    }  svn_pool_destroy(iterpool);  if (seen_nonexistent_target)    return svn_error_create(      SVN_ERR_ILLEGAL_TARGET, NULL,      _("Could not perform blame on all targets because some "        "targets don't exist"));  else    return SVN_NO_ERROR;}
开发者ID:2asoft,项目名称:freebsd,代码行数:101,


示例13: end_element

static svn_error_t *end_element(void *baton, int state, const char *nspace, const char *elt_name){  replay_baton_t *rb = baton;  const svn_ra_neon__xml_elm_t *elm    = svn_ra_neon__lookup_xml_elem(editor_report_elements, nspace, elt_name);  if (! elm)    return SVN_NO_ERROR;  switch (elm->id)    {    case ELEM_editor_report:      if (rb->dirs->nelts)        svn_pool_destroy(APR_ARRAY_IDX(rb->dirs, 0, dir_item_t).pool);      return SVN_NO_ERROR;      break;    case ELEM_apply_textdelta:      SVN_ERR(svn_stream_close(rb->base64_decoder));      rb->whandler = NULL;      rb->whandler_baton = NULL;      rb->svndiff_decoder = NULL;      rb->base64_decoder = NULL;      break;    case ELEM_change_file_prop:    case ELEM_change_dir_prop:      {        const svn_string_t *decoded_value;        if (rb->prop_accum)          {            const svn_string_t *prop;            prop = svn_stringbuf__morph_into_string(rb->prop_accum);            decoded_value = svn_base64_decode_string(prop, rb->prop_pool);          }        else          decoded_value = NULL; /* It's a delete */        if (elm->id == ELEM_change_dir_prop)          SVN_ERR(rb->editor->change_dir_prop(TOP_DIR(rb).baton,                                              rb->prop_name,                                              decoded_value,                                              TOP_DIR(rb).pool));        else          SVN_ERR(rb->editor->change_file_prop(rb->file_baton,                                               rb->prop_name,                                               decoded_value,                                               TOP_DIR(rb).file_pool));      }      break;    default:      break;    }  return SVN_NO_ERROR;}
开发者ID:dtrebbien,项目名称:subversion,代码行数:63,


示例14: log_receiver

//.........这里部分代码省略.........  if (log_entry->subtractive_merge)    SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,                                  "<S:subtractive-merge/>"));  if (log_entry->changed_paths2)    {      apr_hash_index_t *hi;      char *path;      for (hi = apr_hash_first(pool, log_entry->changed_paths2);           hi != NULL;           hi = apr_hash_next(hi))        {          void *val;          svn_log_changed_path2_t *log_item;          const char *close_element = NULL;          svn_pool_clear(iterpool);          apr_hash_this(hi, (void *) &path, NULL, &val);          log_item = val;          /* ### todo: is there a D: namespace equivalent for             `changed-path'?  Should use it if so. */          switch (log_item->action)            {            case 'A':              if (log_item->copyfrom_path                  && SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))                SVN_ERR(dav_svn__brigade_printf                        (lrb->bb, lrb->output,                         "<S:added-path copyfrom-path=/"%s/""                         " copyfrom-rev=/"%ld/"",                         apr_xml_quote_string(iterpool,                                              log_item->copyfrom_path,                                              1), /* escape quotes */                         log_item->copyfrom_rev));              else                SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,                                              "<S:added-path"));              close_element = "S:added-path";              break;            case 'R':              if (log_item->copyfrom_path                  && SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))                SVN_ERR(dav_svn__brigade_printf                        (lrb->bb, lrb->output,                         "<S:replaced-path copyfrom-path=/"%s/""                         " copyfrom-rev=/"%ld/"",                         apr_xml_quote_string(iterpool,                                              log_item->copyfrom_path,                                              1), /* escape quotes */                         log_item->copyfrom_rev));              else                SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,                                              "<S:replaced-path"));              close_element = "S:replaced-path";              break;            case 'D':              SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,                                            "<S:deleted-path"));              close_element = "S:deleted-path";              break;            case 'M':              SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,                                            "<S:modified-path"));              close_element = "S:modified-path";              break;            default:              break;            }          /* If we need to close the element, then send the attributes             that apply to all changed items and then close the element. */          if (close_element)            SVN_ERR(dav_svn__brigade_printf                    (lrb->bb, lrb->output,                     " node-kind=/"%s/""                     " text-mods=/"%s/""                     " prop-mods=/"%s/">%s</%s>" DEBUG_CR,                     svn_node_kind_to_word(log_item->node_kind),                     svn_tristate__to_word(log_item->text_modified),                     svn_tristate__to_word(log_item->props_modified),                     apr_xml_quote_string(iterpool, path, 0),                     close_element));        }    }  svn_pool_destroy(iterpool);  SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,                                "</S:log-item>" DEBUG_CR));  return SVN_NO_ERROR;}
开发者ID:mishin,项目名称:Alien-SVN,代码行数:101,


示例15: svn_error_clear

SVNAuthData::~SVNAuthData(void){    svn_error_clear(Err);    svn_pool_destroy(m_pool);                  // free the allocated memory}
开发者ID:TortoiseGit,项目名称:tortoisesvn,代码行数:5,


示例16: svn_nls_init

svn_error_t *svn_nls_init(void){  svn_error_t *err = SVN_NO_ERROR;#ifdef ENABLE_NLS  if (getenv("SVN_LOCALE_DIR"))    {      bindtextdomain(PACKAGE_NAME, getenv("SVN_LOCALE_DIR"));    }  else    {#ifdef WIN32      WCHAR ucs2_path[MAX_PATH];      char* utf8_path;      const char* internal_path;      apr_pool_t* pool;      apr_size_t inwords, outbytes, outlength;      apr_pool_create(&pool, 0);      /* get exe name - our locale info will be in '../share/locale' */      inwords = GetModuleFileNameW(0, ucs2_path,                                   sizeof(ucs2_path) / sizeof(ucs2_path[0]));      if (! inwords)        {          /* We must be on a Win9x machine, so attempt to get an ANSI path,             and convert it to Unicode. */          CHAR ansi_path[MAX_PATH];          if (GetModuleFileNameA(0, ansi_path, sizeof(ansi_path)))            {              inwords =                MultiByteToWideChar(CP_ACP, 0, ansi_path, -1, ucs2_path,                                    sizeof(ucs2_path) / sizeof(ucs2_path[0]));              if (! inwords)                {                err =                  svn_error_createf(APR_EINVAL, NULL,                                    _("Can't convert string to UCS-2: '%s'"),                                    ansi_path);                }            }          else            {              err = svn_error_create(APR_EINVAL, NULL,                                     _("Can't get module file name"));            }        }      if (! err)        {          outbytes = outlength = 3 * (inwords + 1);          utf8_path = apr_palloc(pool, outlength);          outbytes = WideCharToMultiByte(CP_UTF8, 0, ucs2_path, inwords,                                         utf8_path, outbytes, NULL, NULL);          if (outbytes == 0)            {              err = svn_error_wrap_apr(apr_get_os_error(),                                       _("Can't convert module path "                                         "to UTF-8 from UCS-2: '%s'"),                                       ucs2_path);            }          else            {              utf8_path[outlength - outbytes] = '/0';              internal_path = svn_dirent_internal_style(utf8_path, pool);              /* get base path name */              internal_path = svn_dirent_dirname(internal_path, pool);              internal_path = svn_dirent_join(internal_path,                                              SVN_LOCALE_RELATIVE_PATH,                                              pool);              bindtextdomain(PACKAGE_NAME, internal_path);            }        }      svn_pool_destroy(pool);    }#else /* ! WIN32 */      bindtextdomain(PACKAGE_NAME, SVN_LOCALE_DIR);    }
开发者ID:Alkzndr,项目名称:freebsd,代码行数:81,


示例17: hotcopy_io_copy_dir_recursively

//.........这里部分代码省略.........  /* The 'dst_path' is simply dst_parent/dst_basename */  dst_path = svn_dirent_join(dst_parent, dst_basename, pool);  /* Sanity checks:  SRC and DST_PARENT are directories, and     DST_BASENAME doesn't already exist in DST_PARENT. */  SVN_ERR(svn_io_check_path(src, &kind, subpool));  if (kind != svn_node_dir)    return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,                             _("Source '%s' is not a directory"),                             svn_dirent_local_style(src, pool));  SVN_ERR(svn_io_check_path(dst_parent, &kind, subpool));  if (kind != svn_node_dir)    return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,                             _("Destination '%s' is not a directory"),                             svn_dirent_local_style(dst_parent, pool));  SVN_ERR(svn_io_check_path(dst_path, &kind, subpool));  /* Create the new directory. */  /* ### TODO: copy permissions (needs apr_file_attrs_get()) */  SVN_ERR(svn_io_make_dir_recursively(dst_path, pool));  /* Loop over the dirents in SRC.  ('.' and '..' are auto-excluded) */  SVN_ERR(svn_io_dir_open(&this_dir, src, subpool));  for (status = apr_dir_read(&this_entry, flags, this_dir);       status == APR_SUCCESS;       status = apr_dir_read(&this_entry, flags, this_dir))    {      if ((this_entry.name[0] == '.')          && ((this_entry.name[1] == '/0')              || ((this_entry.name[1] == '.')                  && (this_entry.name[2] == '/0'))))        {          continue;        }      else        {          const char *entryname_utf8;          if (cancel_func)            SVN_ERR(cancel_func(cancel_baton));          SVN_ERR(entry_name_to_utf8(&entryname_utf8, this_entry.name,                                     src, subpool));          if (this_entry.filetype == APR_REG) /* regular file */            {              SVN_ERR(hotcopy_io_dir_file_copy(skipped_p, src, dst_path,                                               entryname_utf8, subpool));            }          else if (this_entry.filetype == APR_LNK) /* symlink */            {              const char *src_target = svn_dirent_join(src, entryname_utf8,                                                       subpool);              const char *dst_target = svn_dirent_join(dst_path,                                                       entryname_utf8,                                                       subpool);              SVN_ERR(svn_io_copy_link(src_target, dst_target,                                       subpool));            }          else if (this_entry.filetype == APR_DIR) /* recurse */            {              const char *src_target;              /* Prevent infinite recursion by filtering off our                 newly created destination path. */              if (strcmp(src, dst_parent) == 0                  && strcmp(entryname_utf8, dst_basename) == 0)                continue;              src_target = svn_dirent_join(src, entryname_utf8, subpool);              SVN_ERR(hotcopy_io_copy_dir_recursively(skipped_p,                                                      src_target,                                                      dst_path,                                                      entryname_utf8,                                                      copy_perms,                                                      cancel_func,                                                      cancel_baton,                                                      subpool));            }          /* ### support other APR node types someday?? */        }    }  if (! (APR_STATUS_IS_ENOENT(status)))    return svn_error_wrap_apr(status, _("Can't read directory '%s'"),                              svn_dirent_local_style(src, pool));  status = apr_dir_close(this_dir);  if (status)    return svn_error_wrap_apr(status, _("Error closing directory '%s'"),                              svn_dirent_local_style(src, pool));  /* Free any memory used by recursion */  svn_pool_destroy(subpool);  return SVN_NO_ERROR;}
开发者ID:2asoft,项目名称:freebsd,代码行数:101,


示例18: renumber_mergeinfo_revs

//.........这里部分代码省略.........  SVN_ERR(svn_mergeinfo_parse(&mergeinfo, initial_val->data, subpool));  /* Issue #3020     http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16     Remove mergeinfo older than the oldest revision in the dump stream     and adjust its revisions by the difference between the head rev of     the target repository and the current dump stream rev. */  if (rb->pb->oldest_old_rev > 1)    {      SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(        &predates_stream_mergeinfo, mergeinfo,        rb->pb->oldest_old_rev - 1, 0,        TRUE, subpool, subpool));      SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(        &mergeinfo, mergeinfo,        rb->pb->oldest_old_rev - 1, 0,        FALSE, subpool, subpool));      SVN_ERR(svn_mergeinfo__adjust_mergeinfo_rangelists(        &predates_stream_mergeinfo, predates_stream_mergeinfo,        -rb->rev_offset, subpool, subpool));    }  else    {      predates_stream_mergeinfo = NULL;    }  for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))    {      const char *merge_source;      svn_rangelist_t *rangelist;      struct parse_baton *pb = rb->pb;      int i;      const void *key;      void *val;      apr_hash_this(hi, &key, NULL, &val);      merge_source = key;      rangelist = val;      /* Possibly renumber revisions in merge source's rangelist. */      for (i = 0; i < rangelist->nelts; i++)        {          svn_revnum_t rev_from_map;          svn_merge_range_t *range = APR_ARRAY_IDX(rangelist, i,                                                   svn_merge_range_t *);          rev_from_map = get_revision_mapping(pb->rev_map, range->start);          if (SVN_IS_VALID_REVNUM(rev_from_map))            {              range->start = rev_from_map;            }          else if (range->start == pb->oldest_old_rev - 1)            {              /* Since the start revision of svn_merge_range_t are not                 inclusive there is one possible valid start revision that                 won't be found in the PB->REV_MAP mapping of load stream                 revsions to loaded revisions: The revision immediately                 preceeding the oldest revision from the load stream.                 This is a valid revision for mergeinfo, but not a valid                 copy from revision (which PB->REV_MAP also maps for) so it                 will never be in the mapping.                 If that is what we have here, then find the mapping for the                 oldest rev from the load stream and subtract 1 to get the                 renumbered, non-inclusive, start revision. */              rev_from_map = get_revision_mapping(pb->rev_map,                                                  pb->oldest_old_rev);              if (SVN_IS_VALID_REVNUM(rev_from_map))                range->start = rev_from_map - 1;            }          else            {              /* If we can't remap the start revision then don't even bother                 trying to remap the end revision.  It's possible we might                 actually succeed at the latter, which can result in invalid                 mergeinfo with a start rev > end rev.  If that gets into the                 repository then a world of bustage breaks loose anytime that                 bogus mergeinfo is parsed.  See                 http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16.                 */              continue;            }          rev_from_map = get_revision_mapping(pb->rev_map, range->end);          if (SVN_IS_VALID_REVNUM(rev_from_map))            range->end = rev_from_map;        }      svn_hash_sets(final_mergeinfo, merge_source, rangelist);    }  if (predates_stream_mergeinfo)      SVN_ERR(svn_mergeinfo_merge2(final_mergeinfo, predates_stream_mergeinfo,                                   subpool, subpool));  SVN_ERR(svn_mergeinfo__canonicalize_ranges(final_mergeinfo, subpool));  SVN_ERR(svn_mergeinfo_to_string(final_val, final_mergeinfo, pool));  svn_pool_destroy(subpool);  return SVN_NO_ERROR;}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:101,


示例19: hotcopy_copy_packed_shard

/* Copy a packed shard containing revision REV, and which contains * MAX_FILES_PER_DIR revisions, from SRC_FS to DST_FS. * Update *DST_MIN_UNPACKED_REV in case the shard is new in DST_FS. * Do not re-copy data which already exists in DST_FS. * Set *SKIPPED_P to FALSE only if at least one part of the shard * was copied, do not change the value in *SKIPPED_P otherwise. * SKIPPED_P may be NULL if not required. * Use SCRATCH_POOL for temporary allocations. */static svn_error_t *hotcopy_copy_packed_shard(svn_boolean_t *skipped_p,                          svn_revnum_t *dst_min_unpacked_rev,                          svn_fs_t *src_fs,                          svn_fs_t *dst_fs,                          svn_revnum_t rev,                          int max_files_per_dir,                          apr_pool_t *scratch_pool){  const char *src_subdir;  const char *dst_subdir;  const char *packed_shard;  const char *src_subdir_packed_shard;  svn_revnum_t revprop_rev;  apr_pool_t *iterpool;  fs_fs_data_t *src_ffd = src_fs->fsap_data;  /* Copy the packed shard. */  src_subdir = svn_dirent_join(src_fs->path, PATH_REVS_DIR, scratch_pool);  dst_subdir = svn_dirent_join(dst_fs->path, PATH_REVS_DIR, scratch_pool);  packed_shard = apr_psprintf(scratch_pool, "%ld" PATH_EXT_PACKED_SHARD,                              rev / max_files_per_dir);  src_subdir_packed_shard = svn_dirent_join(src_subdir, packed_shard,                                            scratch_pool);  SVN_ERR(hotcopy_io_copy_dir_recursively(skipped_p, src_subdir_packed_shard,                                          dst_subdir, packed_shard,                                          TRUE /* copy_perms */,                                          NULL /* cancel_func */, NULL,                                          scratch_pool));  /* Copy revprops belonging to revisions in this pack. */  src_subdir = svn_dirent_join(src_fs->path, PATH_REVPROPS_DIR, scratch_pool);  dst_subdir = svn_dirent_join(dst_fs->path, PATH_REVPROPS_DIR, scratch_pool);  if (   src_ffd->format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT      || src_ffd->min_unpacked_rev < rev + max_files_per_dir)    {      /* copy unpacked revprops rev by rev */      iterpool = svn_pool_create(scratch_pool);      for (revprop_rev = rev;           revprop_rev < rev + max_files_per_dir;           revprop_rev++)        {          svn_pool_clear(iterpool);          SVN_ERR(hotcopy_copy_shard_file(skipped_p, src_subdir, dst_subdir,                                          revprop_rev, max_files_per_dir,                                          iterpool));        }      svn_pool_destroy(iterpool);    }  else    {      /* revprop for revision 0 will never be packed */      if (rev == 0)        SVN_ERR(hotcopy_copy_shard_file(skipped_p, src_subdir, dst_subdir,                                        0, max_files_per_dir,                                        scratch_pool));      /* packed revprops folder */      packed_shard = apr_psprintf(scratch_pool, "%ld" PATH_EXT_PACKED_SHARD,                                  rev / max_files_per_dir);      src_subdir_packed_shard = svn_dirent_join(src_subdir, packed_shard,                                                scratch_pool);      SVN_ERR(hotcopy_io_copy_dir_recursively(skipped_p,                                              src_subdir_packed_shard,                                              dst_subdir, packed_shard,                                              TRUE /* copy_perms */,                                              NULL /* cancel_func */, NULL,                                              scratch_pool));    }  /* If necessary, update the min-unpacked rev file in the hotcopy. */  if (*dst_min_unpacked_rev < rev + max_files_per_dir)    {      *dst_min_unpacked_rev = rev + max_files_per_dir;      SVN_ERR(svn_fs_fs__write_min_unpacked_rev(dst_fs,                                                *dst_min_unpacked_rev,                                                scratch_pool));    }  return SVN_NO_ERROR;}
开发者ID:2asoft,项目名称:freebsd,代码行数:91,


示例20: apply_window

/* Apply WINDOW to the streams given by APPL.  */static svn_error_t *apply_window(svn_txdelta_window_t *window, void *baton){  struct apply_baton *ab = (struct apply_baton *) baton;  apr_size_t len;  svn_error_t *err;  if (window == NULL)    {      /* We're done; just clean up.  */      if (ab->result_digest)        apr_md5_final(ab->result_digest, &(ab->md5_context));      err = svn_stream_close(ab->target);      svn_pool_destroy(ab->pool);      return err;    }  /* Make sure the source view didn't slide backwards.  */  SVN_ERR_ASSERT(window->sview_len == 0                 || (window->sview_offset >= ab->sbuf_offset                     && (window->sview_offset + window->sview_len                         >= ab->sbuf_offset + ab->sbuf_len)));  /* Make sure there's enough room in the target buffer.  */  SVN_ERR(size_buffer(&ab->tbuf, &ab->tbuf_size, window->tview_len, ab->pool));  /* Prepare the source buffer for reading from the input stream.  */  if (window->sview_offset != ab->sbuf_offset      || window->sview_len > ab->sbuf_size)    {      char *old_sbuf = ab->sbuf;      /* Make sure there's enough room.  */      SVN_ERR(size_buffer(&ab->sbuf, &ab->sbuf_size, window->sview_len,              ab->pool));      /* If the existing view overlaps with the new view, copy the       * overlap to the beginning of the new buffer.  */      if (ab->sbuf_offset + ab->sbuf_len > window->sview_offset)        {          apr_size_t start =            (apr_size_t)(window->sview_offset - ab->sbuf_offset);          memmove(ab->sbuf, old_sbuf + start, ab->sbuf_len - start);          ab->sbuf_len -= start;        }      else        ab->sbuf_len = 0;      ab->sbuf_offset = window->sview_offset;    }  /* Read the remainder of the source view into the buffer.  */  if (ab->sbuf_len < window->sview_len)    {      len = window->sview_len - ab->sbuf_len;      err = svn_stream_read(ab->source, ab->sbuf + ab->sbuf_len, &len);      if (err == SVN_NO_ERROR && len != window->sview_len - ab->sbuf_len)        err = svn_error_create(SVN_ERR_INCOMPLETE_DATA, NULL,                               "Delta source ended unexpectedly");      if (err != SVN_NO_ERROR)        return err;      ab->sbuf_len = window->sview_len;    }  /* Apply the window instructions to the source view to generate     the target view.  */  len = window->tview_len;  svn_txdelta_apply_instructions(window, ab->sbuf, ab->tbuf, &len);  SVN_ERR_ASSERT(len == window->tview_len);  /* Write out the output. */  /* ### We've also considered just adding two (optionally null)     arguments to svn_stream_create(): read_checksum and     write_checksum.  Then instead of every caller updating an md5     context when it calls svn_stream_write() or svn_stream_read(),     streams would do it automatically, and verify the checksum in     svn_stream_closed().  But this might be overkill for issue #689;     so for now we just update the context here. */  if (ab->result_digest)    apr_md5_update(&(ab->md5_context), ab->tbuf, len);  return svn_stream_write(ab->target, ab->tbuf, &len);}
开发者ID:aosm,项目名称:subversion,代码行数:86,


示例21: hotcopy_revisions

//.........这里部分代码省略.........        {          SVN_ERR(svn_fs_fs__write_current(dst_fs, pack_end_rev, 0, 0,                                           iterpool));        }      /* When notifying about packed shards, make things simpler by either       * reporting a full revision range, i.e [pack start, pack end] or       * reporting nothing. There is one case when this approach might not       * be exact (incremental hotcopy with a pack replacing last unpacked       * revisions), but generally this is good enough. */      if (notify_func && !skipped)        notify_func(notify_baton, rev, pack_end_rev, iterpool);      /* Remove revision files which are now packed. */      if (incremental)        {          SVN_ERR(hotcopy_remove_rev_files(dst_fs, rev,                                           rev + max_files_per_dir,                                           max_files_per_dir, iterpool));          if (dst_ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)            SVN_ERR(hotcopy_remove_revprop_files(dst_fs, rev,                                                 rev + max_files_per_dir,                                                 max_files_per_dir,                                                 iterpool));        }      /* Now that all revisions have moved into the pack, the original       * rev dir can be removed. */      SVN_ERR(remove_folder(svn_fs_fs__path_rev_shard(dst_fs, rev, iterpool),                            cancel_func, cancel_baton, iterpool));      if (rev > 0 && dst_ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)        SVN_ERR(remove_folder(svn_fs_fs__path_revprops_shard(dst_fs, rev,                                                             iterpool),                              cancel_func, cancel_baton, iterpool));    }  if (cancel_func)    SVN_ERR(cancel_func(cancel_baton));  SVN_ERR_ASSERT(rev == src_min_unpacked_rev);  SVN_ERR_ASSERT(src_min_unpacked_rev == dst_min_unpacked_rev);  /* Now, copy pairs of non-packed revisions and revprop files.   * If necessary, update 'current' after copying all files from a shard. */  for (; rev <= src_youngest; rev++)    {      svn_boolean_t skipped = TRUE;      svn_pool_clear(iterpool);      if (cancel_func)        SVN_ERR(cancel_func(cancel_baton));      /* Copying non-packed revisions is racy in case the source repository is       * being packed concurrently with this hotcopy operation. The race can       * happen with FS formats prior to SVN_FS_FS__MIN_PACK_LOCK_FORMAT that       * support packed revisions. With the pack lock, however, the race is       * impossible, because hotcopy and pack operations block each other.       *       * We assume that all revisions coming after 'min-unpacked-rev' really       * are unpacked and that's not necessarily true with concurrent packing.       * Don't try to be smart in this edge case, because handling it properly       * might require copying *everything* from the start. Just abort the       * hotcopy with an ENOENT (revision file moved to a pack, so it is no       * longer where we expect it to be). */      /* Copy the rev file. */      SVN_ERR(hotcopy_copy_shard_file(&skipped,                                      src_revs_dir, dst_revs_dir, rev,                                      max_files_per_dir,                                      iterpool));      /* Copy the revprop file. */      SVN_ERR(hotcopy_copy_shard_file(&skipped,                                      src_revprops_dir, dst_revprops_dir,                                      rev, max_files_per_dir,                                      iterpool));      /* Whenever this revision did not previously exist in the destination,       * checkpoint the progress via 'current' (do that once per full shard       * in order not to slow things down). */      if (rev > dst_youngest)        {          if (max_files_per_dir && (rev % max_files_per_dir == 0))            {              SVN_ERR(svn_fs_fs__write_current(dst_fs, rev, 0, 0,                                               iterpool));            }        }      if (notify_func && !skipped)        notify_func(notify_baton, rev, rev, iterpool);    }  svn_pool_destroy(iterpool);  /* We assume that all revisions were copied now, i.e. we didn't exit the   * above loop early. 'rev' was last incremented during exit of the loop. */  SVN_ERR_ASSERT(rev == src_youngest + 1);  return SVN_NO_ERROR;}
开发者ID:2asoft,项目名称:freebsd,代码行数:101,


示例22: mkdir_urls

static svn_error_t *mkdir_urls(svn_commit_info_t **commit_info_p,           const apr_array_header_t *urls,           svn_boolean_t make_parents,           const apr_hash_t *revprop_table,           svn_client_ctx_t *ctx,           apr_pool_t *pool){  svn_ra_session_t *ra_session = NULL;  const svn_delta_editor_t *editor;  void *edit_baton;  void *commit_baton;  const char *log_msg;  apr_array_header_t *targets;  apr_hash_t *targets_hash;  apr_hash_t *commit_revprops;  svn_error_t *err;  const char *common;  int i;  /* Find any non-existent parent directories */  if (make_parents)    {      apr_array_header_t *all_urls = apr_array_make(pool, urls->nelts,                                                    sizeof(const char *));      const char *first_url = APR_ARRAY_IDX(urls, 0, const char *);      apr_pool_t *iterpool = svn_pool_create(pool);      SVN_ERR(svn_client__open_ra_session_internal(&ra_session, first_url,                                                   NULL, NULL, NULL, FALSE,                                                   TRUE, ctx, pool));      for (i = 0; i < urls->nelts; i++)        {          const char *url = APR_ARRAY_IDX(urls, i, const char *);          svn_pool_clear(iterpool);          SVN_ERR(add_url_parents(ra_session, url, all_urls, iterpool, pool));        }      svn_pool_destroy(iterpool);      urls = all_urls;    }  /* Condense our list of mkdir targets. */  SVN_ERR(svn_path_condense_targets(&common, &targets, urls, FALSE, pool));  SVN_ERR(svn_hash_from_cstring_keys(&targets_hash, targets, pool));  SVN_ERR(svn_hash_keys(&targets, targets_hash, pool));  if (! targets->nelts)    {      const char *bname;      svn_path_split(common, &common, &bname, pool);      APR_ARRAY_PUSH(targets, const char *) = bname;    }  else    {      svn_boolean_t resplit = FALSE;      /* We can't "mkdir" the root of an editor drive, so if one of         our targets is the empty string, we need to back everything         up by a path component. */      for (i = 0; i < targets->nelts; i++)        {          const char *path = APR_ARRAY_IDX(targets, i, const char *);          if (! *path)            {              resplit = TRUE;              break;            }        }      if (resplit)        {          const char *bname;          svn_path_split(common, &common, &bname, pool);          for (i = 0; i < targets->nelts; i++)            {              const char *path = APR_ARRAY_IDX(targets, i, const char *);              path = svn_path_join(bname, path, pool);              APR_ARRAY_IDX(targets, i, const char *) = path;            }        }    }  qsort(targets->elts, targets->nelts, targets->elt_size,         svn_sort_compare_paths);  /* Create new commit items and add them to the array. */  if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))    {      svn_client_commit_item3_t *item;      const char *tmp_file;      apr_array_header_t *commit_items        = apr_array_make(pool, targets->nelts, sizeof(item));      for (i = 0; i < targets->nelts; i++)        {          const char *path = APR_ARRAY_IDX(targets, i, const char *);          SVN_ERR(svn_client_commit_item_create                  ((const svn_client_commit_item3_t **) &item, pool));//.........这里部分代码省略.........
开发者ID:vocho,项目名称:openqnx,代码行数:101,


示例23: svn_ra_local__get_dir

/* Getting a directory's entries */static svn_error_t *svn_ra_local__get_dir(svn_ra_session_t *session,                      apr_hash_t **dirents,                      svn_revnum_t *fetched_rev,                      apr_hash_t **props,                      const char *path,                      svn_revnum_t revision,                      apr_uint32_t dirent_fields,                      apr_pool_t *pool){  svn_fs_root_t *root;  svn_revnum_t youngest_rev;  apr_hash_t *entries;  apr_hash_index_t *hi;  svn_ra_local__session_baton_t *sess = session->priv;  apr_pool_t *subpool;  const char *abs_path = svn_path_join(sess->fs_path->data, path, pool);  /* Open the revision's root. */  if (! SVN_IS_VALID_REVNUM(revision))    {      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, pool));      SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev, pool));      if (fetched_rev != NULL)        *fetched_rev = youngest_rev;    }  else    SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));  if (dirents)    {      /* Get the dir's entries. */      SVN_ERR(svn_fs_dir_entries(&entries, root, abs_path, pool));      /* Loop over the fs dirents, and build a hash of general         svn_dirent_t's. */      *dirents = apr_hash_make(pool);      subpool = svn_pool_create(pool);      for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))        {          const void *key;          void *val;          apr_hash_t *prophash;          const char *datestring, *entryname, *fullpath;          svn_fs_dirent_t *fs_entry;          svn_dirent_t *entry = apr_pcalloc(pool, sizeof(*entry));          svn_pool_clear(subpool);          apr_hash_this(hi, &key, NULL, &val);          entryname = (const char *) key;          fs_entry = (svn_fs_dirent_t *) val;          fullpath = svn_path_join(abs_path, entryname, subpool);          if (dirent_fields & SVN_DIRENT_KIND)            {              /* node kind */              entry->kind = fs_entry->kind;            }          if (dirent_fields & SVN_DIRENT_SIZE)            {              /* size  */              if (entry->kind == svn_node_dir)                entry->size = 0;              else                SVN_ERR(svn_fs_file_length(&(entry->size), root,                                           fullpath, subpool));            }          if (dirent_fields & SVN_DIRENT_HAS_PROPS)            {              /* has_props? */              SVN_ERR(svn_fs_node_proplist(&prophash, root, fullpath,                                           subpool));              entry->has_props = (apr_hash_count(prophash) != 0);            }          if ((dirent_fields & SVN_DIRENT_TIME)              || (dirent_fields & SVN_DIRENT_LAST_AUTHOR)              || (dirent_fields & SVN_DIRENT_CREATED_REV))            {              /* created_rev & friends */              SVN_ERR(svn_repos_get_committed_info(&(entry->created_rev),                                                   &datestring,                                                   &(entry->last_author),                                                   root, fullpath, subpool));              if (datestring)                SVN_ERR(svn_time_from_cstring(&(entry->time), datestring,                                              pool));              if (entry->last_author)                entry->last_author = apr_pstrdup(pool, entry->last_author);            }          /* Store. */          apr_hash_set(*dirents, entryname, APR_HASH_KEY_STRING, entry);        }      svn_pool_destroy(subpool);//.........这里部分代码省略.........
开发者ID:aosm,项目名称:subversion,代码行数:101,


示例24: push_dir_info

/* Helper func for recursively fetching svn_dirent_t's from a remote   directory and pushing them at an info-receiver callback.   DEPTH is the depth starting at DIR, even though RECEIVER is never   invoked on DIR: if DEPTH is svn_depth_immediates, then invoke   RECEIVER on all children of DIR, but none of their children; if   svn_depth_files, then invoke RECEIVER on file children of DIR but   not on subdirectories; if svn_depth_infinity, recurse fully.*/static svn_error_t *push_dir_info(svn_ra_session_t *ra_session,              const char *session_URL,              const char *dir,              svn_revnum_t rev,              const char *repos_UUID,              const char *repos_root,              svn_info_receiver_t receiver,              void *receiver_baton,              svn_depth_t depth,              svn_client_ctx_t *ctx,              apr_hash_t *locks,              apr_pool_t *pool){  apr_hash_t *tmpdirents;  svn_dirent_t *the_ent;  svn_info_t *info;  apr_hash_index_t *hi;  apr_pool_t *subpool = svn_pool_create(pool);  SVN_ERR(svn_ra_get_dir2(ra_session, &tmpdirents, NULL, NULL,                          dir, rev, DIRENT_FIELDS, pool));  for (hi = apr_hash_first(pool, tmpdirents); hi; hi = apr_hash_next(hi))    {      const char *path, *URL, *fs_path;      const void *key;      svn_lock_t *lock;      void *val;      svn_pool_clear(subpool);      if (ctx->cancel_func)        SVN_ERR(ctx->cancel_func(ctx->cancel_baton));      apr_hash_this(hi, &key, NULL, &val);      the_ent = val;      path = svn_path_join(dir, key, subpool);      URL  = svn_path_url_add_component(session_URL, key, subpool);      fs_path = svn_path_is_child(repos_root, URL, subpool);      fs_path = apr_pstrcat(subpool, "/", fs_path, NULL);      fs_path = svn_path_uri_decode(fs_path, subpool);      lock = apr_hash_get(locks, fs_path, APR_HASH_KEY_STRING);      SVN_ERR(build_info_from_dirent(&info, the_ent, lock, URL, rev,                                     repos_UUID, repos_root, subpool));      if (depth >= svn_depth_immediates          || (depth == svn_depth_files && the_ent->kind == svn_node_file))        {          SVN_ERR(receiver(receiver_baton, path, info, subpool));        }      if (depth == svn_depth_infinity && the_ent->kind == svn_node_dir)        {          SVN_ERR(push_dir_info(ra_session, URL, path,                                rev, repos_UUID, repos_root,                                receiver, receiver_baton,                                depth, ctx, locks, subpool));        }    }  svn_pool_destroy(subpool);  return SVN_NO_ERROR;}
开发者ID:vocho,项目名称:openqnx,代码行数:78,


示例25: svn_ra_blame

svn_error_t *svn_ra_blame (svn_ra_plugin_t *ra_lib, void *ra_session,              const char *target,              svn_revnum_t start_revnum,              svn_revnum_t end_revnum,              svn_client_blame_receiver_t receiver,              void *receiver_baton,              apr_pool_t *pool){    struct file_rev_baton frb;    struct blame *walk;    apr_file_t *tempfile;    apr_pool_t *iterpool;    svn_stream_t *stream;    svn_error_t *err;    // SVN_INVALID_REVNUM (=head revision)    if ((end_revnum < start_revnum) && (end_revnum != SVN_INVALID_REVNUM))      return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,                              ("Start revision must precede end revision"));    frb.start_rev = start_revnum;    frb.end_rev = end_revnum;    frb.target = target;    frb.last_filename = NULL;    frb.blame = NULL;    frb.avail = NULL;    frb.mainpool = pool;  /* The callback will flip the following two pools, because it needs     information from the previous call.  Obviously, it can't rely on     the lifetime of the pool provided by get_file_revs. */    frb.lastpool = svn_pool_create (pool);    frb.currpool = svn_pool_create (pool);    // do the actual blame    err = do_blame (target, ra_lib, ra_session, &frb);    if (err) return err;    /* Report the blame to the caller. */    /* The callback has to have been called at least once. */    assert (frb.last_filename != NULL);    /* Create a pool for the iteration below. */    iterpool = svn_pool_create (pool);    /* Open the last file and get a stream. */    err = svn_io_file_open (&tempfile, frb.last_filename, APR_READ, APR_OS_DEFAULT, pool);    if (err) return err;    stream = svn_stream_from_aprfile(tempfile, pool);    /* Process each blame item. */    for (walk = frb.blame; walk; walk = walk->next)    {        apr_off_t line_no;        for (line_no = walk->start; !walk->next || line_no < walk->next->start; ++line_no)        {            svn_boolean_t eof;            svn_stringbuf_t *sb;            apr_pool_clear (iterpool);            err = svn_stream_readline (stream, &sb, "/n", &eof, iterpool);            if (err) return err;            if (!eof || sb->len)                SVN_ERR (receiver (receiver_baton, line_no, walk->rev->revision,                         walk->rev->author, walk->rev->date,                         sb->data, iterpool));            if (eof) break;        }    }    err = svn_stream_close (stream);    err = svn_io_file_close(tempfile, pool);    svn_pool_destroy(frb.lastpool);    svn_pool_destroy(frb.currpool);    svn_pool_destroy(iterpool);    return SVN_NO_ERROR;}
开发者ID:bdumitriu,项目名称:playground,代码行数:79,


示例26: test_parse_unidiff

static svn_error_t *test_parse_unidiff(apr_pool_t *pool){  svn_patch_file_t *patch_file;  svn_boolean_t reverse;  svn_boolean_t ignore_whitespace;  int i;  apr_pool_t *iterpool;  reverse = FALSE;  ignore_whitespace = FALSE;  iterpool = svn_pool_create(pool);  for (i = 0; i < 2; i++)    {      svn_patch_t *patch;      svn_diff_hunk_t *hunk;      svn_pool_clear(iterpool);      SVN_ERR(create_patch_file(&patch_file, unidiff, pool));      /* We have two patches with one hunk each.       * Parse the first patch. */      SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, reverse,                                        ignore_whitespace, iterpool,                                        iterpool));      SVN_TEST_ASSERT(patch);      SVN_TEST_STRING_ASSERT(patch->old_filename, "A/C/gamma");      SVN_TEST_STRING_ASSERT(patch->new_filename, "A/C/gamma");      SVN_TEST_ASSERT(patch->hunks->nelts == 1);      hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);      SVN_ERR(check_content(hunk, ! reverse,                            "This is the file 'gamma'." NL,                            pool));      SVN_ERR(check_content(hunk, reverse,                            "This is the file 'gamma'." NL                            "some more bytes to 'gamma'" NL,                            pool));      /* Parse the second patch. */      SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, reverse,                                        ignore_whitespace, pool, pool));      SVN_TEST_ASSERT(patch);      if (reverse)        {          SVN_TEST_STRING_ASSERT(patch->new_filename, "A/D/gamma.orig");          SVN_TEST_STRING_ASSERT(patch->old_filename, "A/D/gamma");        }      else        {          SVN_TEST_STRING_ASSERT(patch->old_filename, "A/D/gamma.orig");          SVN_TEST_STRING_ASSERT(patch->new_filename, "A/D/gamma");        }      SVN_TEST_ASSERT(patch->hunks->nelts == 1);      hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);      SVN_ERR(check_content(hunk, ! reverse,                            "This is the file 'gamma'." NL                            "some less bytes to 'gamma'" NL,                            pool));      SVN_ERR(check_content(hunk, reverse,                            "This is the file 'gamma'." NL,                            pool));      reverse = !reverse;      SVN_ERR(svn_diff_close_patch_file(patch_file, pool));    }  svn_pool_destroy(iterpool);  return SVN_NO_ERROR;}
开发者ID:Distrotech,项目名称:subversion,代码行数:73,


示例27: svn_cl__blame

//.........这里部分代码省略.........    }  for (i = 0; i < targets->nelts; i++)    {      svn_error_t *err;      const char *target = APR_ARRAY_IDX(targets, i, const char *);      const char *truepath;      svn_opt_revision_t peg_revision;      svn_client_blame_receiver3_t receiver;      svn_pool_clear(subpool);      SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));      /* Check for a peg revision. */      SVN_ERR(svn_opt_parse_path(&peg_revision, &truepath, target,                                 subpool));      if (end_revision_unspecified)        {          if (peg_revision.kind != svn_opt_revision_unspecified)            opt_state->end_revision = peg_revision;          else if (svn_path_is_url(target))            opt_state->end_revision.kind = svn_opt_revision_head;          else            opt_state->end_revision.kind = svn_opt_revision_working;        }      if (opt_state->xml)        {          /* "<target ...>" */          /* We don't output this tag immediately, which avoids creating             a target element if this path is skipped. */          const char *outpath = truepath;          if (! svn_path_is_url(target))            outpath = svn_dirent_local_style(truepath, subpool);          svn_xml_make_open_tag(&bl.sbuf, pool, svn_xml_normal, "target",                                "path", outpath, NULL);          receiver = blame_receiver_xml;        }      else        receiver = blame_receiver;      err = svn_client_blame5(truepath,                              &peg_revision,                              &opt_state->start_revision,                              &opt_state->end_revision,                              diff_options,                              opt_state->force,                              opt_state->use_merge_history,                              receiver,                              &bl,                              ctx,                              subpool);      if (err)        {          if (err->apr_err == SVN_ERR_CLIENT_IS_BINARY_FILE)            {              svn_error_clear(err);              SVN_ERR(svn_cmdline_fprintf(stderr, subpool,                                          _("Skipping binary file: '%s'/n"),                                          target));            }          else if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||                   err->apr_err == SVN_ERR_FS_NOT_FILE ||                   err->apr_err == SVN_ERR_FS_NOT_FOUND)            {              svn_handle_warning2(stderr, err, "svn: ");              svn_error_clear(err);              err = NULL;              seen_nonexistent_target = TRUE;            }          else            {              return svn_error_trace(err);            }        }      else if (opt_state->xml)        {          /* "</target>" */          svn_xml_make_close_tag(&(bl.sbuf), pool, "target");          SVN_ERR(svn_cl__error_checked_fputs(bl.sbuf->data, stdout));        }      if (opt_state->xml)        svn_stringbuf_setempty(bl.sbuf);    }  svn_pool_destroy(subpool);  if (opt_state->xml && ! opt_state->incremental)    SVN_ERR(svn_cl__xml_print_footer("blame", pool));  if (seen_nonexistent_target)    return svn_error_create(      SVN_ERR_ILLEGAL_TARGET, NULL,      _("Could not perform blame on all targets because some "        "targets don't exist"));  else    return SVN_NO_ERROR;}
开发者ID:AsherBond,项目名称:MondocosmOS-Dependencies,代码行数:101,


示例28: l_proplist

static intl_proplist (lua_State *L) {	const char *path = (lua_gettop (L) < 1 || lua_isnil (L, 1)) ? "" : luaL_checkstring (L, 1);	svn_opt_revision_t peg_revision;	svn_opt_revision_t revision;		peg_revision.kind = svn_opt_revision_unspecified;	if (lua_gettop (L) < 2 || lua_isnil (L, 2)) {		revision.kind = svn_opt_revision_unspecified;	} else {		revision.kind = svn_opt_revision_number;		revision.value.number = lua_tointeger (L, 2);	}			svn_boolean_t recursive = FALSE;		int itable = 3;	if (lua_gettop (L) >= itable && lua_istable (L, itable)) {				lua_getfield (L, itable, "recursive");		if (lua_isboolean (L, -1)) {			recursive = lua_toboolean (L, -1);		}	} 	apr_pool_t *pool;	svn_error_t *err;	svn_client_ctx_t *ctx;	init_function (&ctx, &pool, L);	path = svn_path_canonicalize (path, pool);	apr_array_header_t *props;	int is_url = svn_path_is_url (path);	err = svn_client_proplist2 (&props, path, &peg_revision, &revision, recursive, ctx, pool);	IF_ERROR_RETURN (err, pool, L);	lua_newtable (L);	int i;	for (i = 0; i < props->nelts; ++i)	{		const void *key;		void *val;		svn_client_proplist_item_t *item = ((svn_client_proplist_item_t **)props->elts)[i];		const char *name_local;		if (is_url) {			name_local = svn_path_local_style (item->node_name->data, pool);		} else {			name_local = item->node_name->data;		}		lua_pushstring (L, name_local);		lua_newtable (L);		apr_hash_index_t *hi;		for (hi = apr_hash_first (pool, item->prop_hash); hi; hi = apr_hash_next (hi)) {			const char *pname;			svn_string_t *pval;						apr_hash_this (hi, &key, NULL, &val);			pname = key;			pval = (svn_string_t *) val;			err = svn_cmdline_cstring_from_utf8 (&pname, pname, pool);			IF_ERROR_RETURN (err, pool, L);			lua_pushstring (L, pval->data);			lua_setfield (L, -2, pname);		}		lua_settable (L, -3);	}	svn_pool_destroy (pool);	return 1;}
开发者ID:krfkeith,项目名称:luasvn,代码行数:91,



注:本文中的svn_pool_destroy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ svn_string_create函数代码示例
C++ svn_path_is_url函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。