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

[PATCH][merge-tracking]WC of subtree whose ancestor have already merged the given changeset should ignore the merge.

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-10-17 22:00:02 CEST

Hi All,
Find the attached patch/log.

With regards
Kamesh Jayachandran

[[[

'Merge' on a subtree working copy should elide for the mergeinfo
through 'ra' layers.

* subversion/libsvn_client/diff.c
  (get_wc_target_merge_info):
   Get the elided 'mergeinfo' for repos relative path of wc.
   Merge the resultant 'mergeinfo' for each path(currently only one)
   to local wc mergeinfo.

Patch by: Kamesh Jayachandran <kamesh@collab.net>
]]]

Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c (revision 21996)
+++ subversion/libsvn_client/diff.c (working copy)
@@ -1816,8 +1816,10 @@
                          apr_pool_t *pool)
 {
   apr_hash_t *repos_mergeinfo;
+ apr_hash_index_t *hi;
   apr_array_header_t *mergeinfo_paths = apr_array_make(pool, 1,
                                                        sizeof(target_wcpath));
+ const char *wc_repos_rel_path;
   svn_revnum_t target_rev;
 
   SVN_ERR(svn_wc_entry(entry, target_wcpath, adm_access, FALSE, pool));
@@ -1826,6 +1828,7 @@
                              _("'%s' is not under version control"),
                              svn_path_local_style(target_wcpath, pool));
 
+ wc_repos_rel_path = ((*entry)->url) + strlen((*entry)->repos);
   /* ### FIXME: dionisos sez: "We can have schedule 'normal' files
      ### with a copied parameter of TRUE and a revision number of
      ### INVALID_REVNUM. Copied directories cause this behaviour on
@@ -1843,7 +1846,7 @@
 
     default:
       target_rev = (*entry)->revision;
- /* ### TODO: Add target_wcpath to mergeinfo_paths. */
+ APR_ARRAY_PUSH(mergeinfo_paths, const char *) = wc_repos_rel_path;
       break;
     }
   SVN_ERR(svn_ra_get_merge_info(ra_session, &repos_mergeinfo, mergeinfo_paths,
@@ -1851,12 +1854,28 @@
   SVN_ERR(parse_merge_info(target_mergeinfo, *entry, target_wcpath,
                            adm_access, ctx, pool));
   if (repos_mergeinfo != NULL)
- /* ### FIXME: Pre-existing WC-local changes may've reverted some
- ### of the merge info on WC_TARGET. How should we combine
- ### these sets of merge info (e.g. give precedence to the WC if
- ### it has merge info set)? */
- SVN_ERR(svn_mergeinfo_merge(target_mergeinfo, repos_mergeinfo,
- *target_mergeinfo, pool));
+ {
+ const char *mergeinfo_path_name;
+ apr_hash_t *mergeinfo_for_path;
+ for (hi = apr_hash_first(pool, repos_mergeinfo);
+ hi; hi = apr_hash_next(hi))
+ {
+ const void *key;
+ void *val;
+
+ apr_hash_this(hi, &key, NULL, &val);
+
+ mergeinfo_path_name = key;
+ mergeinfo_for_path = val;
+ /* ### FIXME: Pre-existing WC-local changes may've reverted some
+ ### of the merge info on WC_TARGET. How should we combine
+ ### these sets of merge info (e.g. give precedence to the WC if
+ ### it has merge info set)? */
+ SVN_ERR(svn_mergeinfo_merge(target_mergeinfo, mergeinfo_for_path,
+ *target_mergeinfo, pool));
+ }
+ }
+
   return SVN_NO_ERROR;
 }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 17 21:59:27 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.