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

Re: cvs2svn on Windows - issue 1360

From: Russell Yanofsky <rey4_at_columbia.edu>
Date: 2003-10-22 04:01:55 CEST

Max Bowsher wrote:
> I've committed part of Russell Yanofsky's cvs2svn9999.patch.
>
> The two bits I have not committed are:
>
> * tools/cvs2svn/run-tests.py
> (run_cvs2svn):
> changed command line used to start cvs2svn on windows
>
> Francois Beausoleil's recent patch should make this unneccessary.

This is true, but the problem is that run-tests executes cvs2svn in a broken
command line environment. My change fixes run-tests to invoke cvs2svn
properly and give it a normal environment, while Francois's works around the
problem by tweaking cvs2svn to run in the broken environment -- even though
the cvs2svn code is perfectly correct as is.

I do think Francois's patch should be applied anyway (assuming it works, I
never ran it) because of the error checking it adds and the potential
efficiency boost it offers. But don't leave out my fix.

> (svn_strptime):
> new function to take the place of time.strptime, which doesn't
> exist on windows
> (Log.__init__):
> replaced time.strptime() call with svn_strptime() call.
>
> I have a question about DST. The patch as is sets is_dst to 0 "no".
> Would -1 "best guess" be a better idea?

Yeah. It still won't be totally correct (they'll be ambiguity for timestamps
in the hour before clocks roll back), but with -1 at least it won't be any
worse than the unix version.

One more thing. In rev 7470 you didn't apply my relative_name changes
correctly. My changes read:

 def relative_name(cvsroot, fname):
   l = len(cvsroot)
- if fname[:l] == cvsroot:
- if fname[l] == '/':
- return fname[l+1:]
- return fname[l:]
+ if fname[:l] == cvsroot and fname[l] == os.sep:
+ return string.replace(fname[l+1:], os.sep, '/')
   sys.stderr.write('relative_path("%s", "%s"): fname is not a sub-path of'
                    ' cvsroot\n' % (cvsroot, fname))
   sys.exit(1)

while yours read:

 def relative_name(cvsroot, fname):
   l = len(cvsroot)
   if fname[:l] == cvsroot:
- if fname[l] == '/':
- return fname[l+1:]
- return fname[l:]
+ if fname[l] == os.sep:
+ return string.replace(fname[l+1:], os.sep, '/')
+ return string.replace(fname[l:], os.sep, '/')
   sys.stderr.write('relative_path("%s", "%s"): fname is not a sub-path of'
                    ' cvsroot\n' % (cvsroot, fname))
   sys.exit(1)

Here's a sample invocation to show why your version is wrong:

  relative_name('/home/cvsroot', '/home/cvsrootcanal')

Your version will incorrectly return 'canal', while my version will
correctly print out an error stating that /home/cvsrootcanal is not a
subpath of /home/cvsroot. Please fix this.

- Russ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 22 04:02:55 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.