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

[merge-tracking][patch] step 1 of recording copyfrom info on repos-repos copy

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-09-19 11:13:06 CEST

Hi,

    Please find attached, for review, a preparatory step to recording
copyfrom info in mergeinfo on repos-to-repos copy. This step sets the
given mergeinfo into the newly created target as part of the same
transaction that created it.

    The remaining steps would be
    - obtain the current mergeinfo (A) from the source path
    - obtain the copyfrom information (B) from the source path
    - merge (A) and (B) and set the value in the delta path driver's
callback baton

    Please note that this will also record copyfrom information in
mergeinfo for 'svn mv' in repos-repos case. I think this is a logical
extension. Let me know what you think.

Regards,
Madan.

Step 1 of recording copyfrom history as mergeinfo on repos to repos copy.

On the merge-tracking branch:

* subversion/libsvn_client/copy.c
  (global): Include svn_props.h.
  (path_driver_cb_baton): Added mergeinfo parameter.
  (path_driver_cb_func): Set the mergeinfo property on the target.
  (repos_to_repos_copy): Fill the mergeinfo parameter of the
   path_driver_cb_baton with NULL for now.

Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 21525)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -30,6 +30,7 @@
 #include "svn_path.h"
 #include "svn_opt.h"
 #include "svn_time.h"
+#include "svn_props.h"
 
 #include "client.h"
 
@@ -181,6 +182,7 @@
   svn_boolean_t is_move;
   svn_boolean_t resurrection;
   svn_revnum_t src_revnum;
+ svn_string_t *mergeinfo;
 };
 
 
@@ -245,6 +247,11 @@
                                              cb_baton->src_url,
                                              cb_baton->src_revnum,
                                              pool, &file_baton));
+ if (cb_baton->mergeinfo)
+ SVN_ERR(cb_baton->editor->change_file_prop(file_baton,
+ SVN_PROP_MERGE_INFO,
+ cb_baton->mergeinfo,
+ pool));
           SVN_ERR(cb_baton->editor->close_file(file_baton, NULL, pool));
         }
       else
@@ -253,6 +260,11 @@
                                                   cb_baton->src_url,
                                                   cb_baton->src_revnum,
                                                   pool, dir_baton));
+ if (cb_baton->mergeinfo)
+ SVN_ERR(cb_baton->editor->change_dir_prop(*dir_baton,
+ SVN_PROP_MERGE_INFO,
+ cb_baton->mergeinfo,
+ pool));
         }
     }
   return SVN_NO_ERROR;
@@ -446,6 +458,8 @@
   cb_baton.is_move = is_move;
   cb_baton.src_revnum = src_revnum;
   cb_baton.resurrection = resurrection;
+ /* TODO: calculate the mergeinfo to set on the target */
+ cb_baton.mergeinfo = NULL;
 
   /* Call the path-based editor driver. */
   err = svn_delta_path_driver(editor, edit_baton, youngest, paths,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 19 10:43:23 2006

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.