[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: Max Bowsher <maxb_at_ukf.net>
Date: 2003-10-22 10:50:00 CEST

Russell Yanofsky wrote:
> 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.

Hmm. OK. This change is a bit of a kludge, but I can't think of a better
idea, so I'll commit it.

>> (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.

OK. I will commit soon.

> 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.

My omission was deliberate.
I noticed your fix to the bug above, but your change broke invocations such
as:
./cvs2svn.py path/to/cvsrepos/with/trailing/slash/

Rather than fix one bug and create another, I chose to remain with the
harmlessly broken version above until cvs2svn is patched to do some cleanup
on the pathname it is passed.

Max.

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