I don't really understand why you're trying to merge by user. Honestly it seems like you're making your life seem much more difficult. For one thing merging one users merges like this is highly likely to create conflicts, which in my opinion defeats the entire purpose of scripting the merge.
But you could use svn mergeinfo --show-revs eligible ^/branches/mybranch ^/trunk
to find the revs eligible for merging back to trunk for your branch. Then run svn log -r $REV
on each revision and ignore revisions that aren't in the proper date range or user. Then merge those commits. When 1.9 comes out mergeinfo
will have --xml
and --log
options. So you could combine the two steps into a single command and use XSLT to do the filtering for you similar to the answer I gave in: List all files which are changed b/w two revision by a user
All that said, you should just use svn merge --reintegrate ^/branches/mybranch
where your current directory is an update to date and unmodified working copy of trunk which will merge all changes from the branch. If you're using 1.8 you can leave off the --reintegrate
option since 1.8 detects if a merge is a reintegration automatically. Doing it like this would minimize conflicts.
If you have nested branches you have to merge up through all the branches to get to trunk. So if you have a branch named branch1 off trunk and branch1.1 off branch1 then you need to reintegrate to branch1 from branch1.1 before merging back from trunk.