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

Re: Escape filename for conflict merge

From: James McCoy <jamessan_at_jamessan.com>
Date: Thu, 26 Dec 2019 23:17:20 -0500

On Wed, Dec 11, 2019 at 03:12:56PM +0000, Julian Foad wrote:
> Stefan Sperling wrote:
> > My first question would be: Could anyone could test this on Windows?
> > (Assuming you've been testing on Debian, as usual.)

Yes, any testing from folks with Windows systems would be welcome. This
recipe is what I used to replicate the issue on Linux.

$ svnadmin create testrepo
$ svn co file://$(pwd)/testrepo wc
$ cd wc
$ svn mkdir trunk
$ touch "trunk/foo bar"
$ svn add trunk/*
$ svn ci -m1
$ svn mkdir branches
$ svn cp trunk branches/x
$ svn ci -m2
$ printf 'foo\n' > "trunk/foo bar"
$ svn ci -m3
$ printf 'bar\n' > "branches/x/foo bar"
$ svn ci -m4
$ svn up
$ cd trunk
$ svn merge ^/branches/x
.. select "(e) Edit file"

> My next question would be: What about all the other places we call out to
> the shell? Do we already have some places that escape filenames even on
> Windows (even if perfect escaping isn't possible there)? Is this place
> inconsistent and could be fixed by making it work the same as everywhere
> else, for example, or are they all broken, or what?

This place is intentionaly inconsistent, which I tried to highlight with
the new comments in my patch. We specifically intend for these paths to
go through the shell so that $SVN_EDITOR can be a command with
arguments, expanded by the shell. That's also why my patch only adjusts
the handling of the filename arguments.

Going back in time, maybe it would have been better to not allow this
accomodation and require users to create a script that hides those
details, and use that for $SVN_EDITOR. However, that's not the choice
that was made.

Cheers,

-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB
Received on 2019-12-27 05:17:29 CET

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.