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

Re: [PATCH] Merge deleting a file - compare its content

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 06 Aug 2008 12:29:44 +0100

On Tue, 2008-08-05 at 15:57 +0100, Julian Foad wrote:
> On Fri, 2008-07-25 at 12:52 +0100, Julian Foad wrote:
> > On Thu, 2008-07-24 at 11:57 -0400, Paul Burba wrote:
> > > Now we try the reverse merge, and as in < 1.5 the files scheduled for
> > > addition are skipped:
> > >
> > > 1.5.1>svn.exe merge -r3:2 %URL%/branches/mybranch
> > > Skipped 'newfile1'
> > > Skipped 'newfile2'
> > > Skipped 'newfile3'
> >
> > A good enhancement will be to compare the locally-added file with the
> > one that the incoming change thinks it's deleting (i.e. the merge-left
> > source), and only skip if they're different. That check is something
> > we're doing for tree conflict detection anyway, but can be done
> > independently.
> >
> > I'll have a go at a patch to make this happen. (It so happens that this
> > is what I am about to work on for tree conflicts anyway.) I haven't
> > missed any reason why we'd not want to change this, have I?
>
> Here we go.
>
> Can anyone take a look at the attached patch and comment on the places
> I've flagged with "###" and generally on whether it's going the right
> way?
>
> Much appreciated...

Here's an improved version. It now compares the properties as well as
the text content. It ignores the "svn:mergeinfo" property because that
property does not contribute to a difference in the file's current state
but only tells how the file reached its current state.

Just one test fails: merge_tests.py 77. It looks like the reverse-merge
"svn merge -r9:2 A A_COPY" is omitting r8 from the revision ranges it
thinks it needs to handle. r8 was a text mod to A/D/H/nu. Is this
because Subversion thinks, "there's no point merging r8 (a text mod)
because I can see that I would follow that with deleting the file, so it
would be a waste of effort"?

Paul or anyone, can you show me where this logic takes place in the
merge code path?

[[[
Properties on 'A_COPY/D/H/nu':
  svn:mergeinfo : /A/D/H/nu:5-8

CMD: svn ci -m "log msg"
Sending A_COPY
Sending A_COPY/B/E/beta
Sending A_COPY/D/H
Adding A_COPY/D/H/nu
Sending A_COPY/D/H/omega
Transmitting file data ...
Committed revision 9.

CMD: svn merge -r9:2 A A_COPY
--- Reverse-merging r7 through r5 into 'A_COPY/D/H':
U A_COPY/D/H/omega
Skipped 'A_COPY/D/H/nu'
--- Reverse-merging r6 through r5 into 'A_COPY':
U A_COPY/B/E/beta
]]]

The file 'nu' is skipped because the change r7-r5 wants to delete it but
its content in A/D/H/nu_at_7 does not match A_COPY/D/H/nu_at_9. (The content
of A/D/H/nu_at_8 does match. That's the "merge-left source" that we need to
provide to the "file_deleted()" method.)

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-08-06 13:30:18 CEST

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