You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/08/14 16:58:39 UTC

svn commit: r1695929 - in /subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer: logic.c mergeinfo-normalizer.h util.c

Author: stefan2
Date: Fri Aug 14 14:58:39 2015
New Revision: 1695929

URL: http://svn.apache.org/r1695929
Log:
On the svn-mergeinfo-normalizer branch:
Get rid of the utils.c file

* tools/client-side/svn-mergeinfo-normalizer/logic.c
  (add_wc_info): Move code of the former svn_min__add_wc_info here.
  (svn_min__run_normalize): Update caller.

* tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
  (svn_min__add_wc_info): Remove declaration here.

* tools/client-side/svn-mergeinfo-normalizer/util.c
  Delete file.

Removed:
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/util.c
Modified:
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h

Modified: subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c?rev=1695929&r1=1695928&r2=1695929&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c (original)
+++ subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c Fri Aug 14 14:58:39 2015
@@ -1319,6 +1319,39 @@ show_obsoletes_summary(svn_min__branch_l
   return SVN_NO_ERROR;
 }
 
+/* Set the path and url members in BATON to handle the IDX-th target
+ * specified at the command line.  Allocate the paths in RESULT_POOL and
+ * use SCRATCH_POOL for temporaries. */
+static svn_error_t *
+add_wc_info(svn_min__cmd_baton_t *baton,
+            int idx,
+            apr_pool_t *result_pool,
+            apr_pool_t *scratch_pool)
+{
+  svn_min__opt_state_t *opt_state = baton->opt_state;
+  const char *target = APR_ARRAY_IDX(opt_state->targets, idx, const char *);
+  const char *truepath;
+  svn_opt_revision_t peg_revision;
+
+  if (svn_path_is_url(target))
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("'%s' is not a local path"), target);
+
+  SVN_ERR(svn_opt_parse_path(&peg_revision, &truepath, target,
+                             scratch_pool));
+  SVN_ERR(svn_dirent_get_absolute(&baton->local_abspath, truepath,
+                                  result_pool));
+
+  SVN_ERR(svn_client_get_wc_root(&baton->wc_root, baton->local_abspath,
+                                 baton->ctx, result_pool, scratch_pool));
+  SVN_ERR(svn_client_get_repos_root(&baton->repo_root, NULL,
+                                    baton->local_abspath, baton->ctx,
+                                    result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
 svn_error_t *
 svn_min__run_normalize(void *baton,
                        apr_pool_t *pool)
@@ -1337,7 +1370,7 @@ svn_min__run_normalize(void *baton,
       const char *common_path;
 
       svn_pool_clear(iterpool);
-      SVN_ERR(svn_min__add_wc_info(baton, i, iterpool, subpool));
+      SVN_ERR(add_wc_info(baton, i, iterpool, subpool));
 
       /* scan working copy */
       svn_pool_clear(subpool);
@@ -1366,7 +1399,7 @@ svn_min__run_normalize(void *baton,
           svn_ra_session_t *session;
 
           svn_pool_clear(subpool);
-          SVN_ERR(svn_min__add_wc_info(baton, i, iterpool, subpool));
+          SVN_ERR(add_wc_info(baton, i, iterpool, subpool));
           SVN_ERR(svn_client_open_ra_session2(&session, cmd_baton->repo_root,
                                               NULL, cmd_baton->ctx, iterpool,
                                               subpool));

Modified: subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h?rev=1695929&r1=1695928&r2=1695929&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h (original)
+++ subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h Fri Aug 14 14:58:39 2015
@@ -132,15 +132,6 @@ svn_min__check_cancel(void *baton);
 
 /*** Internal API linking the various modules. ***/
 
-/* Set the path and url members in BATON to handle the IDX-th target
- * specified at the command line.  Allocate the paths in RESULT_POOL and
- * use SCRATCH_POOL for temporaries. */
-svn_error_t *
-svn_min__add_wc_info(svn_min__cmd_baton_t* baton,
-                     int idx,
-                     apr_pool_t* result_pool,
-                     apr_pool_t* scratch_pool);
-
 /* Scan the working copy sub-tree specified in BATON for mergeinfo and
  * return them in *RESULT, allocated in RESULT_POOL.  The element type is
  * opaque.  Use SCRATCH_POOL for temporary allocations. */