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

Re: [PATCH] svn: Attempted to get textual contents of a *non*-file node

From: Alexey Neyman <stilor_at_att.net>
Date: Wed, 7 Mar 2012 12:05:47 -0800

On Wednesday, March 07, 2012 02:07:24 am Julian Foad wrote:
> Daniel Shahaf wrote:
> > Thanks for the patch Alexey. Forwarding it to dev@.
> >
> > Alexey Neyman wrote:
> >> > > svn: Attempted to get textual contents of a *non*-file node
> >> > >
> >> > > The issue, as pointed out by email thread [1], is that the
> >> > >
> >> > > directory being merged contains a file with the same name as
> >> > >
> >> > > the directory. I.e., there is /trunk/foo directory containing
> >> > >
> >> > > /trunk/foo/foo file.
> >>
> >> I confirm it works when dir and file do not have the same name.
> >>
> >> $ svn merge -c 4 ^/trunk/foo .
> >>
> >> fails, the following
> >>
> >> $ svn merge -c 4 ^/trunk/foo $wc
> >>
> >> works. I guess, it's sort of a workaround.
>
> This all happens because of a special case that was inserted long ago.
>
> r845404: Resolve issue #785.
> ["add friendly enhancement to 'svn merge'",
> <http://subversion.tigris.org/issues/show_bug.cgi?id=785>]
>
> * merge-cmd.c (svn_cl__merge): If no target path was specified, try to
> infer it from the source path(s).
> [...]
>
> The help text is now only present in the "4. This form is called a '2-URL
> merge'" section:
>
> "If TARGET_WCPATH is omitted, a default value of '.' is assumed.
> However, in the special case where both sources refer to a file node
> with the same basename and a similarly named file is also found within
> '.', the differences will be applied to that local file."
>
> ... but the code applies more widely, and also it doesn't check that the
> sources are files, only that the target is a file.
>
> Seems we need to make the code more stringent (check sources are files) and
> fix the help text. Then the special-case code would only kick in when it
> makes sense: when the sources are files and the target is a WC directory
> containing a file of that name.

I would just point out that this special cased kicks in even if the 3rd
argument to merge is specified explicitly. One of the commands I tried
originally (and which failed, too, with the same error) was:

svn co $repourl/branches/1.0/foo $wcpath
cd $wcpath
svn merge ^/trunk/foo_at_3 ^/trunk/foo_at_4 .

Regards,
Alexey.

>
> - Julian
>
> >> Issue 4139 created. Attached is a patch that adds an XFail to the test
> >>
> >> suite for this issue.
Received on 2012-03-07 21:06:50 CET

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