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

Approach to solve issue 2897 (Reflective merges solved cleanly without loosing local changes part of merge+commit)

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2007-12-05 17:23:41 CET

Hi All,
I have the following idea to solve issue 2897.

Terminologies:
reflective_rev - commit rev post to merge.
reflected_range - set of merged ranges part of a commit.
non_reflected_change - adhoc local changes that are separate from a
merge forming a port of a same reflective commit.
~ - diff of LHS with RHS.

Sample Dataset for illustration purposes:
- /trunk - trunk (It has only one file test.c)
- /fb - feature branch copy of trunk, copied at r30.
- test.c is 10000 lines.
- /fb is going to modify only within top 1000 lines of test.c
- /trunk is going to modify only within bottom 1000 lines of test.c
- So no chance of conflicts back and forth merges.

SVN operations under consideration:
/fb/test.c has some direct changes in r50, r60
/fb/test.c merged r30:r60 with one local change to test.c at line 5000
committed at r61(*reflective rev*)
/fb/test.c has some direct changes in r70, r80

Expected behaviour
Merge /fb to /trunk working copy Should merge r50, r60, *line5000 change
*only* in r61*, r70, r80.

To merge *line5000 change in r61* (non_reflected_change)
I propose to implement 'non_reflected_file_changed' a
svn_wc_diff_callbacks2_t callback.

non_reflected_merge_file_changed(svn_wc_adm_access_t *adm_access,
                                                        
svn_wc_notify_state_t *content_state,
                                                        
svn_wc_notify_state_t *prop_state,
                                                        const char *mine,
                                                        const char *older,
                                                       const char *yours,
                                                       svn_revnum_t
older_rev,
                                                       svn_revnum_t
yours_rev,
                                                       const char
*mimetype1,
                                                       const char
*mimetype2,
                                                       const
apr_array_header_t *prop_changes,
                                                       apr_hash_t
*original_props,
                                                       void *baton)
{
* get reflected_merged_rev_start, reflected_merged_rev_end (The revs
from trunk that got merged to feature branch)
* /fb/test.c@older_rev call this X
* merge (/trunk/test.c@reflected_merged_rev_start ~
/trunk/test.c@reflected_merged_rev_end) on to X
* merge (X ~ /fb/test.c@yours_rev) on to target (This should apply only
the non-reflected portions of change) i.e 'adhoc change in line 5000 as
a part of commit r61'.
}

Complexities:
* It would work well as long as only one rev range is part of the
commit, it would be more complex if we have adhoc set of revisions
merged as a part of a commit.
* It would be very difficult to take care of the cases where your
subtree of merge target has its own reflection history.

With regards
Kamesh Jayachandran

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 5 17:23:15 2007

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