Help with bzr-svn

Brian de Alwis bsd at cs.ubc.ca
Tue Mar 24 18:22:06 GMT 2009


On 23-Mar-2009, at 8:50 PM, Talden wrote:
>>> I'm using bzr.1.13 (windows standalone) on Windows XP and have a new
>>> error that's blocking conversion.  Seemingly bzr thinks these path
>>> separators are part of the folder name and are iillegal characters.
[...]
> Here's the only interesting entry in bzr.log (the others are all
> "unsupported file property 'svn:eol-style'" or svn:ignore)
[...]
>  File "C:/tools/scm/BazaarStandalone1.13-1/plugins\svn\fetch.py",
> line 167, in check_filename
> InvalidFileName: Unable to convert Subversion path
> lib/eclipse\eclipse\eclipse-3.4.0 because it contains characters
> invalid in Bazaar.


Please forgive a momentary whinge, but this behaviour has been  
annoying me too.  It's registered as bug 58180 (https://bugs.launchpad.net/bzr/+bug/58180 
).

I've been fiddling with importing the NetBSD CVS repository into bzr.   
Early in the NetBSD CVS history, somebody wrongly committed some files  
whose named contained embedded backslashes (e.g., "\n.d"), the results  
of some set of tests gone wrong.  The files were deleted in a  
subsequent commit, but the files were not scrubbed from the  
repository.  These files were brought across when the repository was  
converted to Subversion, Git, and Mercurial.

Unfortunately bzr refuses to import from these repositories (via fast- 
import or bzr-svn) as it claims that these files have invalid file  
names.  It's not that bzr cannot handle these file names, but rather  
that bzr is being overly protective to prevent committing files with  
deemed-invalid characters from some idealized file system.  IMHO bzr  
should accept any valid filename for the file system being used, and  
filename checking logic should only be performed when building a  
working tree.  After all, imagine supporting a new file system where,  
say, colons are used as the separator in a filepath (like old MacOS  
HFS file systems).

So when trying a new version of bzr, the first thing I do is edit  
bzrlib/inventory.py and bzrlib/plugins/svn/fetch.py to take out these  
tests; patches follow.

Brian.

--- bzrlib/inventory.py.orig	2009-03-24 11:57:42.000000000 -0600
+++ bzrlib/inventory.py	2009-03-06 16:42:36.000000000 -0600
@@ -212,8 +212,8 @@
          Traceback (most recent call last):
          InvalidEntryName: Invalid entry name: src/hello.c
          """
-        if '/' in name or '\\' in name:
-            raise errors.InvalidEntryName(name=name)
+        #if '/' in name or '\\' in name:
+        #    raise errors.InvalidEntryName(name=name)
          self.executable = False
          self.revision = None
          self.text_sha1 = None

--- bzrlib/plugins/svn/fetch.py.orig	2009-03-24 11:58:21.000000000 -0600
+++ bzrlib/plugins/svn/fetch.py	2009-03-06 16:41:14.000000000 -0600
@@ -107,8 +107,8 @@
      :raises InvalidFileName:
      """
      assert isinstance(path, unicode)
-    if u"\\" in path:
-        raise InvalidFileName(path)
+    #if u"\\" in path:
+    #    raise InvalidFileName(path)


  def editor_strip_prefix(editor, path):


-- 
"Amusement to an observing mind is study." - Benjamin Disraeli




More information about the bazaar mailing list