Martin Fuchs wrote:
> Hello Russel,
>
>> There's a small patch which fixes this issue and some other cvs2svn
>> windows problems here:
>>
>> http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=41909
>>
>> It might be a little out of date now though.
>
> Thank you, I applied it with a small adjustment on the current source
> code. Attached is the diff against revision 7003.
Thanks for taking the time to test this patch.
I see that you changed the implementation of relative_name from:
def relative_name(cvsroot, fname):
l = len(cvsroot)
assert fname[:l] == cvsroot and fname[l] == os.sep
return string.replace(fname[l+1:], os.sep, '/')
to
def relative_name(cvsroot, fname):
l = len(cvsroot)
if fname[:l] == cvsroot:
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)
I'm not sure why though. If fname[l] is not the seperator character, then
that either means that fname[l:] is the empty string, making the second
replace operation unneccessary, or that fname begins with a path other than
the cvsroot, which means an error should be thrown. Was this change actually
needed to get the patch to run with the new code?
Also I think that using an assertion is a more appropriate way of handling
this error than calling sys.exit because the only thing that can cause it to
be triggered is programmer error (incorrect usage of the relative_name
function).
- Russ
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 12 21:13:43 2003