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

Re: cvs2svn change_path crash - Windows

From: Martin Fuchs <martin-fuchs_at_gmx.net>
Date: 2003-09-13 16:35:13 CEST

On Sat 13. September 2003 14:18, Max Bowsher wrote:

> I've examined the patch. Many comments:
>
> First, re the slash problem - what do you think of this:
> --- cvs2svn.py (revision 7052)
> +++ cvs2svn.py (working copy)
> @@ -310,13 +310,19 @@
> else:
> return ctx.trunk_base
>
> +if os.sep == '/':
> + def canonicalize_slashes(path):
> + return path
> +else:
> + def canonicalize_slashes(path):
> + path.replace(os.sep, '/')
>
> def relative_name(cvsroot, fname):
> l = len(cvsroot)
> if fname[:l] == cvsroot:
> if fname[l] == '/':
> - return fname[l+1:]
> - return fname[l:]
> + return canonicalize_slashes(fname[l+1:])
> + return canonicalize_slashes(fname[l:])
> sys.stderr.write('relative_path("%s", "%s"): fname is not a sub-path of'
> ' cvsroot\n' % (cvsroot, fname))
> sys.exit(1)

Well, it does not change the behaviour compared to my patch version, but it
makes a bit more clear, why and when to do the separator replacement. So I
agree your version.

> Second, re escape_shell_arg:
> There is a different implementation of it in gen_win.py. Why is it
> different?

I didn't know of that other implementation, as I don't know csv2svn and python
very well. I see, the version in gen_win.py uses an additional ^ escape
character. Maybe this is not really necesarry.

> Third, re co -kb:
> I think we do want keyword expansion here, so I'm not keen to use -kb.

What will change when removing the "-kb"? If we then only get <CR>/<LF> line
separators instead of <LF> it is OK to remove it.

> Fourth, re this change:
> - output = open(ctx.log_fname_base + CLEAN_REVS_SUFFIX, 'w')
> + output = open(ctx.log_fname_base + CLEAN_REVS_SUFFIX, 'wt')
>
> It isn't in the log message. What is it for?

I think it does not change anything, files are opened in text mode per default
(at least in C, I' m not sure about python). Russell?

> Fifth, in run-tests.py:
> Does anyone know *why* invoking cvs2svn as "python cvs2svn.py" makes sort
> work, when "cvs2svn.py" doesn't?

It is because Windows launches python.exe when using "python cvs2svn.py". When
only using "cvs2svn.py" it does not work, because CreateProcess() does not
look for non-standard executable file extensions. However ShellExecute()
looks in the registry for this non-standard file extensions. So it seems, the
python interpreter internally uses CreateProcess() or some derived function,
but not ShellExecute().

-- 
Martin Fuchs
martin-fuchs@gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Sep 13 15:35:59 2003

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.