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

Perl script for intelligent merge (comment)

From: Horst Schünemann <Horst.Schuenemann_at_t-online.de>
Date: 2004-03-06 09:53:06 CET

Hi Calvin,
the extra benefit of the imerge.pl scriptis , that it remembers the diffs
that were already merged. Have a look at the sample in my previous or first
mail.

1. I first branch from trunk to branch
2. Make a bugfix in trunk and crs in branch
3. Merge the bugfix diffs from trunk to branch
4. Make another bugfix in trunk and another cr in branch
5. Merge from branch to trunk

Using svn merge, the user has to remember at step 5, that in step 3, the
first bugfix of trunk was copied into branch. svn has no information, that
the bugfix was copied to branch and in step 5 it will be copied back again
into trunk. The result are 2 copies of the bugfix or at least a conflict in
trunk after step 5. The imerge.pl script generates the comamnds the user has
to call to do all required merges and to store information about the diffs
that were merged in the log. At the next merge it can use this information
to find out which diffs are already included in the destination. imerge.pl
does no merge itself. The only svn commands it calls are an update at the
beginning and some logs to get the history including the info about merged
diffs. The user has to call the commands; imerge.pl simply dumps them. In
real life, the situation can be much more complex if you don't branch and
merge the complete repository tree. May be you branch and merge only
subdirectories or even files. Then the algorithmn in the script has to be
applied the each item instead of the whole tree. In my case (planning to
substitute vss by svn) i will see it as my dicipline to branch and merge
always the complete tree. In step 3 i cd to my workdir and svn switch to
branch. Then i call "perl imerge.pl URL.../trunk URL.../branch ." and do
what the output tells me. In step 5 i cd to my workdir and svn switch to
trunk. Then i call "perl imerge.pl URL.../branch URL.../trunk ." and do
what the output tells me. That's all for me todo. imerge.pl generates a svn
log call, that contains the diffs, that were merged as a message. This
message is used next time to calculate the diffs that have to be merged.

Hope this makes it all a little clearer

Horst

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Mar 6 09:56:54 2004

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