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

svnmerge.py parsing svn:mergeinfo

From: Joel N. Weber II <jw-svn-2011_at_joelweber.com>
Date: Sun, 24 Apr 2011 21:58:25 -0400

I have been exploring whether it is possible to modify svnmerge.py to
parse svn:mergeinfo instead of svnmerge-integrated. I am wondering if
anyone else has been down this path and has any insight to add as to
why the svnmerge.py shipped with Subversion still relies on
svnmerge-integrated, instead of parsing svn:mergeinfo.

The specific problem motivating this is that I am aware of a case
where one day, one person ran svnmerge.py to merge from branch A to
branch B. This merge had over a hundred files which conflicted, so it
took about four days before the conflicts were resolved and it was
checked in. After svnmerge.py had been run by this first user, but
before this first user checked in their changes, a second user came
along and checked in a change from branch C to branch B. When the
first user finally checked in their changes, the record of the branch
C to branch B merge stayed in svn:mergeinfo, but was obliterated from
svnmerge-integrated in the head revision; I suspect that svn update
knows how to correctly and automatically merge svn:mergeinfo in this
case, but not how to deal with svnmerge-integrated, and the first user
probably chose to simply overwrite svnmerge-integrated (which may
count as a user error, but manually merging an svnmerge-integrated
property certainly is not trivial).

The modifications to svnmerge.py I have been exploring are:

1) Change the definition of default_opts to set prop to svn:mergeinfo
   like this:

    "prop": "svn:mergeinfo",

2) Comment out all of the calls to set_merge_props

3) Exclude the natural history. One strategy may be to pass --stop-on-copy
   in get_created_rev when calling svn log, and to modify analyze_source_revs
   to set base to one more than the max of get_created_rev on source_url
   and ".".

It appears that for a general solution which will work with spaces in
directory names, one also needs:

4) Adjust svnmerge.py as needed for the literal spaces that can appear
   in directory names in svn:mergeinfo, as opposed to the %20 that
   appears in svnmerge-integrated (svnmerge-migrate-history.py calls
   urllib.unquote as part of the conversion process)

This leaves open the question of what should be done about svnmerge.py
init. Perhaps svnmerge.py merge should be modified so that it can
take a URL which has not previously been passed to svnmerge.py init.
Received on 2011-04-25 05:41:14 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.