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

Re: [Svnmerge] [PATCH] Fix for bidirectional merging corner cases

From: David James <djames_at_collab.net>
Date: 2006-06-12 23:29:02 CEST

On 5/13/06, Raman Gupta <rocketraman@fastmail.fm> wrote:
> * contrib/client-side/svnmerge.py
> (analyze_revs): If old_revs is not initialized in the loop that checks revisions
> in which the merge props changed, initialize it. This prevents the first revision
> from being considered reflected even if it is not.

Nice catch, Raman! Could you convert your 'template.sh' test into a
regular test that will run in svnmerge_test.py? If not, don't worry --
I'll get to it.

> Index: svnmerge.py
> [...]
> old_revs = None
> for rev in merge_metadata.changed_revs():
> new_revs = merge_metadata.get(rev).get(target_dir)
> + if old_revs is None:
> + old_revs = get_revlist_prop(url, opts["prop"], rev-1).get(target_dir)
> if new_revs != old_revs:
> reflected_revs.append("%s" % rev)
> old_revs = new_revs

Nice fix! I am sorry that it took me so long to respond to your patch.

There's a small problem, though: What if 'url' was just created in
rev, and therefore does not exist in rev-1? In this case,
get_revlist_prop will throw a LaunchException, and we will need to
deal with this.

I fixed your patch to deal with this problem. I also fixed a similar
bug in the VersionedProperty class and committed your first patch in
r20064.

> Here is a log message/patch for the base + 1 problem (yes, all the tests pass):
>
> Small optimization in obtaining the revisions to be checked for merging. The last
> merged revision is included in analyze_head_revs, but later excluded by the
> algorithm anyway, resulting in some unnecessary work.
>
> * contrib/client-side/svnmerge.py
> (analyze_head_revs): Don't include the last merged revision in the list of
> revisions to be checked for merging.
>
> Patch by: Raman Gupta <rocketraman@fastmail.fm>
> Review by: ?
>
> Index: svnmerge.py
> [...]
> base = 1
> r = opts["merged-revs"].normalized()
> if r and r[0][0] == 1:
> - base = r[0][1]
> + base = r[0][1] + 1

Looks good. I committed your optimization in r20065.

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jun 12 23:29:36 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.