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

cvs2svn: Bug? (relative_path)

From: Max Bowsher <maxb_at_ukf.net>
Date: 2003-08-13 00:32:00 CEST

--------------------------------------------------------------------
def relative_name(cvsroot, fname):
  l = len(cvsroot)
  if fname[:l] == cvsroot:
    if fname[l] == '/':
      return fname[l+1:]
    return fname[l:]
  return l
--------------------------------------------------------------------

That last "return l" looks odd. I'm pretty sure it shouldn't be returning a
number on failiure
How about the following code?

--------------------------------------------------------------------
  sys.stderr.write('relative_path("%s", "%s"): fname is not a sub-path of'
  ' cvsroot\n' % (cvsroot, fname))
  sys.exit(1)
--------------------------------------------------------------------

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 13 00:36:25 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.