⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adm_crawler.c

📁 subversion-1.4.3-1.tar.gz 配置svn的源码
💻 C
📖 第 1 页 / 共 3 页
字号:
                                       apr_pool_t *pool){  struct wrap_report_baton *wrb = report_baton;  return wrb->reporter->finish_report(wrb->baton, pool);}static svn_error_t *wrap_abort_report(void *report_baton,                                      apr_pool_t *pool){  struct wrap_report_baton *wrb = report_baton;  return wrb->reporter->abort_report(wrb->baton, pool);}static const svn_ra_reporter2_t wrap_reporter = {  wrap_set_path,  wrap_delete_path,  wrap_link_path,  wrap_finish_report,  wrap_abort_report};svn_error_t *svn_wc_crawl_revisions(const char *path,                       svn_wc_adm_access_t *adm_access,                       const svn_ra_reporter_t *reporter,                       void *report_baton,                       svn_boolean_t restore_files,                       svn_boolean_t recurse,                       svn_boolean_t use_commit_times,                       svn_wc_notify_func_t notify_func,                       void *notify_baton,                       svn_wc_traversal_info_t *traversal_info,                       apr_pool_t *pool){  struct wrap_report_baton wrb;  svn_wc__compat_notify_baton_t nb;    wrb.reporter = reporter;  wrb.baton = report_baton;  nb.func = notify_func;  nb.baton = notify_baton;  return svn_wc_crawl_revisions2(path, adm_access, &wrap_reporter, &wrb,                                 restore_files, recurse, use_commit_times,                                 svn_wc__compat_call_notify_func, &nb,                                 traversal_info,                                 pool);}svn_error_t *svn_wc_transmit_text_deltas2(const char **tempfile,                             unsigned char digest[],                             const char *path,                             svn_wc_adm_access_t *adm_access,                             svn_boolean_t fulltext,                             const svn_delta_editor_t *editor,                             void *file_baton,                             apr_pool_t *pool){  const char *tmpf, *tmp_base;  svn_txdelta_window_handler_t handler;  void *wh_baton;  svn_txdelta_stream_t *txdelta_stream;  apr_file_t *localfile = NULL;  apr_file_t *basefile = NULL;  const char *entry_digest_hex = NULL;  const char *base_digest_hex = NULL;  const unsigned char *base_digest;  const unsigned char *local_digest;  svn_stream_t *base_stream;  svn_stream_t *local_stream;  apr_time_t wf_time;  svn_error_t *err, *err2;    /* Get timestamp of working file, to check for modifications during     commit. */  SVN_ERR(svn_io_file_affected_time(&wf_time, path, pool));  /* Make an untranslated copy of the working file in the     administrative tmp area because a) we want this to work even if     someone changes the working file while we're generating the     txdelta, b) we need to detranslate eol and keywords anyway, and     c) after the commit, we're going to copy the tmp file to become     the new text base anyway. */  SVN_ERR(svn_wc_translated_file2(&tmpf, path, path,                                  adm_access,                                  SVN_WC_TRANSLATE_TO_NF,                                  pool));  /* If the translation didn't create a new file then we need an explicit     copy, if it did create a new file we need to rename it. */  tmp_base = svn_wc__text_base_path(path, TRUE, pool);  if (tmpf == path)    SVN_ERR(svn_io_copy_file(tmpf, tmp_base, FALSE, pool));  else    SVN_ERR(svn_io_file_rename(tmpf, tmp_base, pool));  /* Set timestamp of tmp_base to that of the working file.  It will     be used after the commit, when installing the new text base, to     detect modifications of the working file that happens during the     commit. */  SVN_ERR(svn_io_set_file_affected_time(wf_time, tmp_base, pool));  /* If we're not sending fulltext, we'll be sending diffs against the     text-base. */  if (! fulltext)    {      /* Get the text base checksum from the entries file. */      const svn_wc_entry_t *ent;      SVN_ERR(svn_wc_entry(&ent, path, adm_access, FALSE, pool));      if (! ent)        return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,                                 _("'%s' is not under version control"),                                 svn_path_local_style(path, pool));      entry_digest_hex = ent->checksum;      SVN_ERR(svn_wc__open_text_base(&basefile, path, APR_READ, pool));    }  base_stream = svn_stream_from_aprfile2(basefile, TRUE, pool);  /* If we have an entry with a checksum, tack on a checksumming     stream, so we can check that it actually matches. */  if (entry_digest_hex)    base_stream = svn_stream_checksummed(base_stream, &base_digest, NULL,                                         TRUE, pool);  /* Tell the editor that we're about to apply a textdelta to the     file baton; the editor returns to us a window consumer routine     and baton.  */  SVN_ERR(editor->apply_textdelta          (file_baton,           entry_digest_hex, pool, &handler, &wh_baton));  /* Alert the caller that we have created a temporary file that might     need to be cleaned up. */  if (tempfile)    *tempfile = tmp_base;  /* Open a filehandle for tmp text-base. */  SVN_ERR_W(svn_io_file_open(&localfile, tmp_base,                             APR_READ, APR_OS_DEFAULT, pool),            _("Error opening local file"));  local_stream = svn_stream_from_aprfile2(localfile, FALSE, pool);  /* Create a text-delta stream object that pulls data out of the two     files. */  svn_txdelta(&txdelta_stream, base_stream, local_stream, pool);    /* Pull windows from the delta stream and feed to the consumer.     We don't handle a possible error right away, since it might be     caused by a corrupt textbase, in which case we prefer a checksum     error being returned over some obscure error from the repository. */  err = svn_txdelta_send_txstream(txdelta_stream, handler, wh_baton, pool);  /* Close the base stream so the MD5 sum gets calculated. */  err2 = svn_stream_close(base_stream);  if (err2 && err)    {      svn_error_clear(err2);      return err;    }  else if (err2)    return err2;      /* And since we might want to remove the temporary local file below,     make sure it is closed. */  err2 = svn_stream_close(local_stream);  if (err2 && err)    {      svn_error_clear(err2);      return err;    }  else if (err2)    return err2;    /* Make sure the old text base still matches its checksum.     Otherwise we could have sent corrupt data and never know it.     For backwards compatibility, no checksum means assume a match. */  if (entry_digest_hex)    {      base_digest_hex = svn_md5_digest_to_cstring_display(base_digest, pool);      if (strcmp(entry_digest_hex, base_digest_hex) != 0)        {          /* There is an entry checksum, but it does not match             the actual text base checksum.  Extreme badness. */          /* Deliberately ignore error; the error about the             checksum mismatch is more important to return.             And wrapping the above error into the checksum             error would be weird, as they're unrelated.             The function is documented to remove the temporary file             for *this* particular error. Well... */          svn_error_clear(svn_io_remove_file(tmp_base, pool));          /* Also, ignore a possible error from the delta transmission             above, because it *might* be caused by the corrupt             textbase, and if it isn't, the user needs to rerun this             operation after repairing the textbase anyway. */          svn_error_clear(err);          if (tempfile)            *tempfile = NULL;                            return svn_error_createf            (SVN_ERR_WC_CORRUPT_TEXT_BASE, NULL,             _("Checksum mismatch for '%s'; "               "expected '%s', actual: '%s'"),             svn_path_local_style(svn_wc__text_base_path(path, FALSE, pool),                                  pool),             entry_digest_hex, base_digest_hex);        }    }  /* Now, handle that delta transmission error if any, so we can stop     thinking about it after this point. */  SVN_ERR(err);  /* Close base file, if it was opened. */  if (basefile)    SVN_ERR(svn_wc__close_text_base(basefile, path, 0, pool));  local_digest = svn_txdelta_md5_digest(txdelta_stream);  if (digest)    memcpy(digest, local_digest, APR_MD5_DIGESTSIZE);  /* Close the file baton, and get outta here. */  return editor->close_file    (file_baton, svn_md5_digest_to_cstring(local_digest, pool), pool);}svn_error_t *svn_wc_transmit_text_deltas(const char *path,                            svn_wc_adm_access_t *adm_access,                            svn_boolean_t fulltext,                            const svn_delta_editor_t *editor,                            void *file_baton,                            const char **tempfile,                            apr_pool_t *pool){  return svn_wc_transmit_text_deltas2(tempfile, NULL, path, adm_access,                                      fulltext, editor, file_baton, pool);}svn_error_t *svn_wc_transmit_prop_deltas(const char *path,                            svn_wc_adm_access_t *adm_access,                            const svn_wc_entry_t *entry,                            const svn_delta_editor_t *editor,                            void *baton,                            const char **tempfile,                            apr_pool_t *pool){  int i;  const char *props, *props_base, *props_tmp;  apr_array_header_t *propmods;  apr_hash_t *localprops = apr_hash_make(pool);  apr_hash_t *baseprops = apr_hash_make(pool);    /* Get the right access baton for the job. */  SVN_ERR(svn_wc_adm_probe_retrieve(&adm_access, adm_access, path, pool));  /* For an enough recent WC, we can have a really easy out. */  if (svn_wc__adm_wc_format(adm_access) > SVN_WC__NO_PROPCACHING_VERSION      && ! entry->has_prop_mods)    {      if (tempfile)        *tempfile = NULL;      return SVN_NO_ERROR;    }  /* First, get the prop_path from the original path */  SVN_ERR(svn_wc__prop_path(&props, path, entry->kind, FALSE, pool));    /* Get the full path of the prop-base `pristine' file */  if (entry->schedule == svn_wc_schedule_replace)    {      /* do nothing: baseprop hash should be -empty- for comparison         purposes.  if they already exist on disk, they're "leftover"         from the old file that was replaced. */      props_base = NULL;    }  else    /* the real prop-base hash */    SVN_ERR(svn_wc__prop_base_path(&props_base, path, entry->kind, FALSE,                                   pool));  /* Copy the local prop file to the administrative temp area */  SVN_ERR(svn_wc__prop_path(&props_tmp, path, entry->kind, TRUE, pool));  SVN_ERR(svn_io_copy_file(props, props_tmp, FALSE, pool));  /* Alert the caller that we have created a temporary file that might     need to be cleaned up. */  if (tempfile)    *tempfile = props_tmp;  /* Load all properties into hashes */  SVN_ERR(svn_wc__load_prop_file(props_tmp, localprops, pool));  if (props_base)    SVN_ERR(svn_wc__load_prop_file(props_base, baseprops, pool));    /* Get an array of local changes by comparing the hashes. */  SVN_ERR(svn_prop_diffs(&propmods, localprops, baseprops, pool));  /* Apply each local change to the baton */  for (i = 0; i < propmods->nelts; i++)    {      const svn_prop_t *p = &APR_ARRAY_IDX(propmods, i, svn_prop_t);      if (entry->kind == svn_node_file)        SVN_ERR(editor->change_file_prop(baton, p->name, p->value, pool));      else        SVN_ERR(editor->change_dir_prop(baton, p->name, p->value, pool));    }  return SVN_NO_ERROR;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -