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

Re: Directory becomes file when applying patch

From: Julian Foad <julianfoad_at_apache.org>
Date: Mon, 16 Jul 2018 16:24:52 +0100

Dmitry Pavlenko wrote:
> When I apply Git format patch that adds a directory with properties, a file is
> added instead.

Thank you for testing and finding these issues, Dmitry!

> Here I provide a reproducing script and also add a file for comparison.
>
> I think the origin of the problem in the fact that SVN patch doesn't keep
> "node kind". But a patch in "svn diff --git" format does. Here's the example
> of the patch. Notice
>
> a) "Property changes on: dir" and "Property changes on: file" lines;

That line is not distinguishing between file-kind and dir-kind, it is just telling the name of the file/dir.

> b) "new file mode 10644" for file and no such line for directory;
>
> allowing to distinguish between files and directories.

That line is the right information to use. (If we ever want a mode line for a directory, it can say "new directory ..." instead of "new file ...".)

> I don't know whether it's a known issue or not but I think it would be nice to
> infer "node kind" from that information and also (if this is not already done)
> by the following logic: if patch changes "dir" and "dir/someFile", then "dir"
> is probably a directory.

It is not useful to add "probably" logic when there is a possibility to use exact logic.

Can you please file an issue and turn your script into a regression test?

Is there any chance you may be able to work on fixing these after you finish testing? I do hope somebody will.

-- 
- Julian
Received on 2018-07-16 17:25:00 CEST

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.