Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re[2]: svn completion under Cygwin

On Mon, 22 Sep 2008 16:36:55 -0700 Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:

PP> On 2008-09-23 at 00:51 +0200, Vadim Zeitlin wrote:
PP> >  But, once again, the problem with svn completion under Cygwin is not due
PP> > to CR LF trouble but to the fact that the native Win32 svn.exe outputs the
PP> > file paths with backslashes and not slashes as the completion code expects.
PP> > Let me repost my trivial patch which fixes the completion for me:
PP> Do you have IPv6 connectivity?  If so, can you please tell me what you
PP> see for the fifth line of output from:
PP>   svn ls http://svn.spodhuis.org/svn/scratch-db/trunk
PP> ?

 No, sorry, I don't, but I do have my own svn server so I just created a
repository with the files with the same names and the output of "svn ls" is
the same under Windows, i.e. it still uses slashes to indicate directories
in this case, i.e.

	% svn ls svn+ssh://my-server/test

So I decided to check how would it work when checked out locally. But this
test failed:

	% svn co svn+ssh://my-server/test
	svn.exe - Application Error
	The exception unknown software exception (0xc00000fd) occurred in
	the application at location 0x7c8302d9.

	Click on OK to terminate the program
	Click on CANCEL to debug the program
	OK   Cancel   

This is both with svn 1.4.5 and 1.5.2 (latest available Win32 binary
version) so I'll report it as a bug...

PP> So clearly \ is a valid character in a directory name for svn; I can
PP> update files inside such a directory, etc.

 Well, not under Windows :-/

PP> I suspect that we need an _svn_osfixup() filter after the svn command,
PP> where that would, for the Windows OSes (I forget the values of $OSTYPE
PP> there) apply changes.  But before that can be written, what 'foo\bar'
PP> maps to needs to be determined, so that we can reverse it.

 I agree in theory but in practice it looks rather unlikely that anybody
uses backslash in their file names...

PP> > -    _cache_svn_status[$dir]="$(_call_program files svn status -N $dir)"
PP> > +    _cache_svn_status[$dir]="$(_call_program files svn status -N $dir) | tr '\\' '/'"
PP> I'm somewhat surprised that this works, without the 'tr' being inside
PP> the $(...), but know little enough about completion.

 *blush* It indeed doesn't work, sorry, I made a mistake when cleaning up
my attempts to fix it and didn't notice that I broke it in the process
because my running shell still used the old, working, version. The correct
version is definitely

-    _cache_svn_status[$dir]="$(_call_program files svn status -N $dir)"
+    _cache_svn_status[$dir]="$(_call_program files svn status -N $dir | tr '\\' '/')"

 Thanks a lot for noticing it!

Attachment: pgp2EEKRIgZIy.pgp
Description: PGP signature

Messages sorted by: Reverse Date, Date, Thread, Author