[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: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 7 Mar 2012 10:07:24 +0000 (GMT)

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.

- Julian

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

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