[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH]implement a FIXME for handling moved paths in copyfrom_info_receiver

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2007-05-16 02:30:46 CEST

Hi All,
Find the attached patch and log.

With regards
Kamesh Jayachandran

[[[
Address FIXME marker for handling moved paths in copyfrom_info_receiver.

* subversion/libsvn_client/log.c
  (copyfrom_info_receiver):
   For rename trace further in the log.
  (svn_client__get_copy_source):
   Call svn_client_log3 with strict-node-history=FALSE, to trace
   beyond the renames.
   
Patch by: kameshj
]]]

Index: subversion/libsvn_client/log.c
===================================================================
--- subversion/libsvn_client/log.c (revision 25024)
+++ subversion/libsvn_client/log.c (working copy)
@@ -114,25 +114,35 @@
     {
       apr_hash_index_t *hi;
       char *path;
- svn_log_changed_path_t *changed_path;
-
+ svn_log_changed_path_t *target_change_detail, *src_change_detail;
       for (hi = apr_hash_first(NULL, changed_paths);
            hi;
            hi = apr_hash_next(hi))
         {
           void *val;
           apr_hash_this(hi, (void *) &path, NULL, &val);
- changed_path = val;
+ target_change_detail = val;
 
           /* Consider only the path we're interested in. */
- /* ### FIXME: Look for moved parents of target_path. */
- if (changed_path->copyfrom_path &&
- SVN_IS_VALID_REVNUM(changed_path->copyfrom_rev) &&
+ if (target_change_detail->copyfrom_path &&
+ SVN_IS_VALID_REVNUM(target_change_detail->copyfrom_rev) &&
               strcmp(path, copyfrom_info->target_path) == 0)
             {
- copyfrom_info->path = apr_pstrdup(copyfrom_info->pool,
- changed_path->copyfrom_path);
- copyfrom_info->rev = changed_path->copyfrom_rev;
+ src_change_detail = apr_hash_get(changed_paths,
+ target_change_detail->copyfrom_path,
+ APR_HASH_KEY_STRING);
+ if (src_change_detail && src_change_detail->action == 'D')
+ {
+ copyfrom_info->target_path =
+ apr_pstrdup(copyfrom_info->pool,
+ target_change_detail->copyfrom_path);
+ continue;
+ }
+
+ copyfrom_info->path =
+ apr_pstrdup(copyfrom_info->pool,
+ target_change_detail->copyfrom_path);
+ copyfrom_info->rev = target_change_detail->copyfrom_rev;
               break;
             }
         }
@@ -174,7 +184,7 @@
   /* Find the copy source. Trace back in history to find the revision
      at which this node was created (copied or added). */
   err = svn_client_log3(targets, revision, revision, &oldest_rev, 0,
- TRUE, TRUE, copyfrom_info_receiver, &copyfrom_info,
+ TRUE, FALSE, copyfrom_info_receiver, &copyfrom_info,
                         ctx, pool);
   /* ### Reuse ra_session by way of svn_ra_get_log()?
   err = svn_ra_get_log(ra_session, rel_paths, revision, 1, 0, TRUE, TRUE,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 16 02:30:45 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.