Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > Re: [RFC] Paths API (svn_dirent_uri.h) - improvements

subversion
Discussion topic

Back to topic list

Re: [RFC] Paths API (svn_dirent_uri.h) - improvements

Author stsp
Full name Stefan Sperling
Date 2009-11-11 11:48:19 PST
Message On Wed, Nov 11, 2009 at 08:37:37PM +0100, Branko Cibej wrote:
> Stefan Sperling wrote:
> > You get a patch someone created on Windows, so it contains paths using
> > backslashes as separators, and you want 'svn patch' to apply it to
> > a working copy you have on a unix machine.
> >
>
> Does it work with plain "patch"? No, it does not.

Good point. I forgot to check whether unix patch supports this
before committing r40399.

> You have to manually
> tweak the patch before you can apply it. Exempli gratia:

> Not saying that this is an argument against "svn patch" accepting such
> files, but the purpose of the svn_path_(internal|local)_style functions
> is to deal with local user input, not with cross-OS data migration
> issues. Moreover, just blindly converting backslashes to slashes is
> *ambiguous* and therefore wrong on Unix. (Going the other way is not
> ambiguous on Windows.)

Yeah, a comment I added to the code says:

  /* Contrary to what one might expect, svn_dirent_internal_style() does not
   * replace backslashes with slashes on UNIX. But it's quite possible that
   * a patch generated on Windows uses backslashes as path separators.
   * To apply such patches on UNIX, we need to normalise separators to '/'.
   * Do a global search-replace if the path from the patch file contains
   * only backslashes but no forward slashes. This may not be suitable in all
   * situations, e.g. backslashes might be part of a filename with no leading
   * directory components. But let's optimise for seamless interoperability
   * between platforms rather than for people using weird filenames. */

So I did misunderstand the dirent API.
The question now is whether we want to keep this hack or get rid of it?
Given that patch does not support this, it's not part of my initial
set of 'svn patch' requirements, which is to implement a big enough
subset UNIX patch functionality to be generally useful, but not add
any unnecessary bells and whistles yet. (By the way, Julian, since you
asked for spec, this last sentence is probably the first 'svn patch'
spec I've ever written ;)

Stefan

« Previous message in topic | 9 of 24 | Next message in topic »

Messages

Show all messages in topic

[RFC] Paths API (svn_dirent_uri.h) - improvements Julian Foad <julian dot foad at wandisco dot com> Julian Foad <julian dot foad at wandisco dot com> 2009-11-11 04:25:58 PST
     Re: [RFC] Paths API (svn_dirent_uri.h) - improvements stsp Stefan Sperling 2009-11-11 05:08:20 PST
         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements Julian Foad <julian dot foad at wandisco dot com> Julian Foad <julian dot foad at wandisco dot com> 2009-11-11 05:15:17 PST
             Re: [RFC] Paths API (svn_dirent_uri.h) - improvements stsp Stefan Sperling 2009-11-11 06:02:48 PST
                 Re: [RFC] Paths API (svn_dirent_uri.h) - improvements Julian Foad <julian dot foad at wandisco dot com> Julian Foad <julian dot foad at wandisco dot com> 2009-11-11 06:34:19 PST
                     Re: [RFC] Paths API (svn_dirent_uri.h) - improvements brane Branko Cibej 2009-11-11 08:46:25 PST
                         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements stsp Stefan Sperling 2009-11-11 09:02:07 PST
                             Re: [RFC] Paths API (svn_dirent_uri.h) - improvements brane Branko Cibej 2009-11-11 11:37:42 PST
                                 Re: [RFC] Paths API (svn_dirent_uri.h) - improvements stsp Stefan Sperling 2009-11-11 11:48:19 PST
         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements brane Branko Cibej 2009-11-11 05:29:37 PST
     Re: [RFC] Paths API (svn_dirent_uri.h) - improvements brane Branko Cibej 2009-11-11 05:25:23 PST
         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements Julian Foad <julian dot foad at wandisco dot com> Julian Foad <julian dot foad at wandisco dot com> 2009-11-11 05:33:54 PST
             RE: [RFC] Paths API (svn_dirent_uri.h) - improvements rhuijben Bert Huijben 2009-11-11 05:51:49 PST
     Re: [RFC] Paths API (svn_dirent_uri.h) - improvements gstein Greg Stein 2009-11-11 12:37:01 PST
         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements brane Branko Cibej 2009-11-11 13:26:52 PST
             Re: [RFC] Paths API (svn_dirent_uri.h) - improvements gstein Greg Stein 2009-11-11 14:07:54 PST
                 Re: [RFC] Paths API (svn_dirent_uri.h) - improvements gstein Greg Stein 2009-11-11 14:09:31 PST
                     Re: [RFC] Paths API (svn_dirent_uri.h) - improvements brane Branko Cibej 2009-11-11 14:26:27 PST
                         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements gstein Greg Stein 2009-11-11 14:32:46 PST
         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements Julian Foad <julian dot foad at wandisco dot com> Julian Foad <julian dot foad at wandisco dot com> 2009-11-12 06:57:33 PST
             Re: [RFC] Paths API (svn_dirent_uri.h) - improvements gstein Greg Stein 2009-11-12 09:02:47 PST
     Re: [RFC] Paths API (svn_dirent_uri.h) - improvements rdonch Roman Donchenko 2009-11-11 12:59:36 PST
         Re: [RFC] Paths API (svn_dirent_uri.h) - improvements stsp Stefan Sperling 2009-11-11 13:10:47 PST
     Re: [RFC] Paths API (svn_dirent_uri.h) - improvements rdonch Roman Donchenko 2009-11-11 16:44:20 PST
Messages per page: