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

RE: Re: svn commit: r25068 - in trunk/subversion: libsvn_client libsvn_fs_util libsvn_subr tests/libsvn_subr

From: Paul Burba <pburba_at_collab.net>
Date: 2007-05-29 18:34:36 CEST

 

> -----Original Message-----
> From: Daniel Rall [mailto:dlr@collab.net]
> Sent: Wednesday, May 23, 2007 1:03 PM
> To: dev@subversion.tigris.org
> Subject: Re: svn commit: r25068 - in trunk/subversion:
> libsvn_client libsvn_fs_util libsvn_subr tests/libsvn_subr
>
> On Tue, 22 May 2007, Paul Burba wrote:
>
> > Dan,
> >
> > As mentioned in IRC I added a new merge test in r25101 that
> tests some
> > practical applications of this fix, most importantly
> merging to a path
> > then reversing that merge to a subtree of the path:
> >
> > svn merge -rX:Y URL/SOURCE PATH
> > svn merge -rY:X URL/SOURCE/CHILD PATH/CHILD
> >
> > PATH/CHILD should end up with mergeinfo for SOURCE/CHILD
> with an empty
> > rev range, overriding the merge info on PATH.
> >
> > Trunk currently sets no mergeinfo on PATH/CHILD. Attached
> is a patch
> > which fixes this.
> ...
>
> Paul mentioned on IRC that he found a better approach to
> this, and is working on another patch.

Dan (and other interested merge tracking followers),

The attached patch allows empty revision range merge info to be set and
handles almost all of the elision cases for such merge info. Unlike my
previous patch it uses the existing elision code to prevent spurious
empty range merge info from being set on a path. There is still a
problem when there is no WC ancestor with merge info to elide to however
- see REMAINING PROBLEM below. Before I go further in solving that
problem though, I want to make sure no one objects to the idea of
'partial' elision that this patch allows, as well as an expansion of
what 'full' elision up till now has meant:

----------------------------------------

NEW TYPE OF 'FULL' ELISION:

If the merge info on PATH_CHILD consists *only* of paths that map to
empty revision ranges, and *none* of these paths exist in PATH_PARENT's
merge info, then PATH_CHILD's merge info elides to PATH_PARENT.

e.g.
Properties on 'A/D':
  svn:mergeinfo : /A_COPY/D:3-4
Properties on 'A/D/H':
  svn:mergeinfo : /A_COPY_2/D/H:
  svn:mergeinfo : /A_COPY_3/D/H:

The merge info on 'merge_tests-1/A/D/H' would fully elide, leaving no
merge info on 'merge_tests-1/A/D/H'.

----------------------------------------

ANOTHER NEW TYPE OF 'FULL' ELISION:

If the merge info on PATH_CHILD contains *some* paths that don't exist
in PATH_PARENT's merge info and map to empty revision ranges, then
PATH_CHILD's merge info still elides if it is otherwise equivalent to
PATH_PARNET's merge info.

e.g.
Properties on 'A/D':
  svn:mergeinfo : /A_COPY/D:3-4
Properties on 'A/D/H':
  svn:mergeinfo : /A_COPY_2/D/H:
  svn:mergeinfo : /A_COPY_3/D/H:
  svn:mergeinfo : /A_COPY/D/H:3-4

The merge info on 'merge_tests-1/A/D/H' would fully elide, leaving no
merge info.

----------------------------------------

'PARTIAL' ELISION:

If the merge info on PATH_CHILD contains *some* paths that don't exist
in PATH_PARENT's merge info and map to empty revision ranges, but the
other paths in PATH_CHILD's merge are *not* equivalent to PATH_PARENT's
merge info, then only the empty rev range paths unique to PATH_CHILD's
merge info elide.

e.g.
Properties on 'A/D':
  svn:mergeinfo : /A_COPY/D:3-4
Properties on 'A/D/H':
  svn:mergeinfo : /A_COPY_2/D/H:
  svn:mergeinfo : /A_COPY_3/D/H:
  svn:mergeinfo : /A_COPY/D/H:3-6

Only the merge info for the empty revision ranges on
'merge_tests-1/A/D/H' elides, leaving:

Properties on 'A/D':
  svn:mergeinfo : /A_COPY/D:3-4
Properties on 'A/D/H':
  svn:mergeinfo : /A_COPY/D/H:3-6

----------------------------------------

REMAINING PROBLEM:

Currently the elision code only tries to elide merge info the nearest
*working copy* ancestor with merge info. This causes a problem with
this patch when there is no WC ancestor with merge info.

e.g. A greek WC with the following changes:
r2 - Copy A to A_COPY
r3 - Text mod to A/D/H/psi

>svn st merge_tests-1

>svn pl -vR merge_tests-1
Properties on 'merge_tests-1\A_COPY':
  svn:mergeinfo : /A:1

# Merge to a target with no WC
# ancestors with merge info
>svn merge -c3 %URL%/A_COPY/D/H merge_tests-1\A\D\H
U merge_tests-1\A\D\H\psi

>svn pl -vR merge_tests-1
Properties on 'merge_tests-1\A\D\H':
  svn:mergeinfo : /A_COPY/D/H:3
Properties on 'merge_tests-1\A_COPY':
  svn:mergeinfo : /A:1

# Reverse the previous merge...
>svn merge -c-3 %URL%/A_COPY/D/H merge_tests-1\A\D\H
G merge_tests-1\A\D\H\psi

# ...which leaves spurious empty range
# merge info on the target.
>svn pl -vR merge_tests-1
Properties on 'merge_tests-1\A\D\H':
  svn:mergeinfo : /A_COPY/D/H:
Properties on 'merge_tests-1\A_COPY':
  svn:mergeinfo : /A:1

>svn st merge_tests-1
 M merge_tests-1\A\D\H

We can't simply say, "don't set empty range merge info on a target if no
WC ancestor with merge info is found". In this example it would be ok,
but if /A/D/H was a disconnected working copy then we wouldn't know if
we were overriding the merge info of some ancestor path in the
repository. This example could also be set up as a partial elision
sceario.

The solution to this problem seems straightforward: check the repository
for the nearest ancestor with merge info if one in the WC cannot be
found. svn_ra_get_mergeinfo() would need to be changed to indicate if
the merge info it obtained was set explicitly on a path or was
inherited, analogous to what merge.c:get_wc_mergeinfo() does.
svn_client__get_repos_mergeinfo() would be similarly changed and then
the elision code could use it to decide if elision occurs or not.
Question is, do we want to elide merge info to the *repos*? I don't see
any problems with this. Sound ok to you?

[[[
Support setting and elision of empty rev range merge info.

* subversion/libsvn_client/merge.c
  (separate_child_empty_revs): New helper for mergeinfo_elides(), finds
merge
  info for paths in a child hash that map to empty revision ranges and
don't
  exist and a parent hash.
  (elision_type): New enum describing the three possible states of
elision:
  'none', 'partial', or 'full'.
  (mergeinfo_elides): Implement determination of new 'partial' elision
state.
  (elide_children, svn_client__elide_mergeinfo): Upate callers of
  mergeinfo_elides(), implment partial elision of merge info.
  (update_wc_mergeinfo): Permit setting of empty revision range merge
info.

* subversion/libsvn_client/mergeinfo.h
  (svn_client__elide_mergeinfo): Expand docstring to describe partial
  elision.
]]]

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue May 29 18:35:55 2007

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.