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

📄 merge.c

📁 subversion-1.4.3-1.tar.gz 配置svn的源码
💻 C
📖 第 1 页 / 共 2 页
字号:
          if (! xtmp_left)            {              SVN_ERR(svn_wc_create_tmp_file2                      (NULL, &xtmp_left,                       adm_path, svn_io_file_del_none, pool));              SVN_ERR(svn_io_copy_file(left, xtmp_left, TRUE, pool));              xtmp_left = svn_path_is_child(adm_path, xtmp_left, pool);            }          xtmp_right = svn_path_is_child(adm_path, right, pool);          if (! xtmp_right)            {              SVN_ERR(svn_wc_create_tmp_file2                      (NULL, &xtmp_right,                       adm_path, svn_io_file_del_none, pool));              SVN_ERR(svn_io_copy_file(right, xtmp_right, TRUE, pool));              xtmp_right = svn_path_is_child(adm_path, xtmp_right, pool);            }          /* NOTE: Callers must ensure that the svn:eol-style and             svn:keywords property values are correct in the currently             installed props.  With 'svn merge', it's no big deal.  But             when 'svn up' calls this routine, it needs to make sure that             this routine is using the newest property values that may             have been received *during* the update.  Since this routine             will be run from within a log-command, install_file()             needs to make sure that a previous log-command to 'install             latest props' has already executed first.  Ben and I just             checked, and that is indeed the order in which the log items             are written, so everything should be fine.  Really.  */          /* Create LEFT and RIGHT backup files, in expanded form.             We use merge_target's current properties to do the translation. */          /* Derive the basenames of the 3 backup files. */          left_base = svn_path_is_child(adm_path, left_copy, pool);          right_base = svn_path_is_child(adm_path, right_copy, pool);          SVN_ERR(svn_wc__loggy_translated_file(log_accum,                                                adm_access,                                                left_base, xtmp_left,                                                log_merge_target, pool));          SVN_ERR(svn_wc__loggy_translated_file(log_accum,                                                adm_access,                                                right_base, xtmp_right,                                                log_merge_target, pool));          /* Back up MERGE_TARGET verbatim (it's already in expanded form.) */          /*###FIXME: the new translation properties are not necessarily            the same as the ones used to construct the current file...*/          SVN_ERR(svn_io_copy_file(merge_target,                                   target_copy, TRUE, pool));          tmp_entry.conflict_old = left_base;          tmp_entry.conflict_new = right_base;          tmp_entry.conflict_wrk = target_base;          /* Mark merge_target's entry as "Conflicted", and start tracking             the backup files in the entry as well. */          SVN_ERR(svn_wc__loggy_entry_modify                  (log_accum, adm_access,                   log_merge_target, &tmp_entry,                   SVN_WC__ENTRY_MODIFY_CONFLICT_OLD                   | SVN_WC__ENTRY_MODIFY_CONFLICT_NEW                   | SVN_WC__ENTRY_MODIFY_CONFLICT_WRK,                   pool));          *merge_outcome = svn_wc_merge_conflict;        }      else if (contains_conflicts && dry_run)        {          *merge_outcome = svn_wc_merge_conflict;        } /* end of conflict handling */      else        {          svn_boolean_t same;          SVN_ERR(svn_io_files_contents_same_p(&same, result_target,                                               merge_target, pool));          *merge_outcome = same ? svn_wc_merge_unchanged : svn_wc_merge_merged;        }      if (*merge_outcome != svn_wc_merge_unchanged && ! dry_run)        {          /* replace MERGE_TARGET with the new merged file, expanding. */          const char *log_result_target =            svn_path_is_child(adm_path, result_target, pool);          SVN_ERR(svn_wc__loggy_copy(log_accum, NULL,                                     adm_access,                                     svn_wc__copy_translate,                                     log_result_target,                                     svn_path_is_child(adm_path,                                                       merge_target, pool),                                     FALSE, pool));        }    } /* end of merging for text files */  else if (! dry_run) /* merging procedure for binary files */    {      /* ### when making the binary-file backups, should we be honoring         keywords and eol stuff?   */      const char *left_copy, *right_copy;      const char *parentt, *left_base, *right_base;      svn_wc_entry_t tmp_entry;      /* reserve names for backups of left and right fulltexts */      SVN_ERR(svn_io_open_unique_file2(NULL,                                       &left_copy,                                       merge_target,                                       left_label,                                       svn_io_file_del_none,                                       pool));      SVN_ERR(svn_io_open_unique_file2(NULL,                                       &right_copy,                                       merge_target,                                       right_label,                                       svn_io_file_del_none,                                       pool));      /* create the backup files */      SVN_ERR(svn_io_copy_file(left,                               left_copy, TRUE, pool));      SVN_ERR(svn_io_copy_file(right,                               right_copy, TRUE, pool));      /* Derive the basenames of the backup files. */      svn_path_split(left_copy, &parentt, &left_base, pool);      svn_path_split(right_copy, &parentt, &right_base, pool);      tmp_entry.conflict_old = left_base;      tmp_entry.conflict_new = right_base;      tmp_entry.conflict_wrk = NULL;      /* Mark merge_target's entry as "Conflicted", and start tracking         the backup files in the entry as well. */      SVN_ERR(svn_wc__loggy_entry_modify              (log_accum,               adm_access, log_merge_target,               &tmp_entry,               SVN_WC__ENTRY_MODIFY_CONFLICT_OLD               | SVN_WC__ENTRY_MODIFY_CONFLICT_NEW               | SVN_WC__ENTRY_MODIFY_CONFLICT_WRK,               pool));      *merge_outcome = svn_wc_merge_conflict; /* a conflict happened */    } /* end of binary conflict handling */  else    *merge_outcome = svn_wc_merge_conflict; /* dry_run for binary files. */  /* Merging is complete.  Regardless of text or binariness, we might     need to tweak the executable bit on the new working file.  */  if (! dry_run)    {      SVN_ERR(svn_wc__loggy_maybe_set_executable(log_accum,                                                 adm_access, log_merge_target,                                                 pool));      SVN_ERR(svn_wc__loggy_maybe_set_readonly(log_accum,                                                adm_access, log_merge_target,                                                pool));    }  return SVN_NO_ERROR;}svn_error_t *svn_wc_merge2(enum svn_wc_merge_outcome_t *merge_outcome,              const char *left,              const char *right,              const char *merge_target,              svn_wc_adm_access_t *adm_access,              const char *left_label,              const char *right_label,              const char *target_label,              svn_boolean_t dry_run,              const char *diff3_cmd,              const apr_array_header_t *merge_options,              apr_pool_t *pool){  svn_stringbuf_t *log_accum = svn_stringbuf_create("", pool);  SVN_ERR(svn_wc__merge_internal(&log_accum, merge_outcome,                                 left, right, merge_target,                                 adm_access,                                 left_label, right_label, target_label,                                 dry_run,                                 diff3_cmd,                                 merge_options,                                 pool));  /* Write our accumulation of log entries into a log file */  SVN_ERR(svn_wc__write_log(adm_access, 0, log_accum, pool));  SVN_ERR(svn_wc__run_log(adm_access, NULL, pool));  return SVN_NO_ERROR;}svn_error_t *svn_wc_merge(const char *left,             const char *right,             const char *merge_target,             svn_wc_adm_access_t *adm_access,             const char *left_label,             const char *right_label,             const char *target_label,             svn_boolean_t dry_run,             enum svn_wc_merge_outcome_t *merge_outcome,             const char *diff3_cmd,             apr_pool_t *pool){  return svn_wc_merge2(merge_outcome,                       left, right, merge_target, adm_access,                       left_label, right_label, target_label,                       dry_run, diff3_cmd, NULL, pool);}

⌨️ 快捷键说明

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