[bzr-fastimport:MERGE] Fix win32

James Westby jw+debian at jameswestby.net
Wed Mar 12 20:44:53 GMT 2008


On Wed, 2008-03-12 at 20:26 +0800, SuperMMX wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi, James Westby <jw+debian at jameswestby.net> :
> 
> On Mon, 10 Mar 2008 17:56:53 +0000
> James Westby <jw+debian at jameswestby.net> wrote:
> 
> > Hi,
> > 
> > Thanks for trying to fix this.
> > 
> > I don't think this is the correct solution. The fast-import stream
> > definition allows only \n for line endings, so I think the problem is
> > in the svn-fast-export code instead. I would imagine that if it is 
> > written for git then it hasn't been tested on Windows.
> > 
> 
> Before your fix, it processes contents with UNIX eol without any 
> problems on Windows with the same svn-fast-export. With your fix,
> fastimport can't process the normal commands (blob, etc).
> 
> Here is a test case. Two files are attached. 
> One is the original repo, the other one is the exported content.
> 

Thanks for the information. The dump that you provided is pretty
broken with regards to line endings. I didn't look at the file
contents, but the commands are all terminated wrongly.

Did you use the python or C version to generate them?

Could you try the following patch to the python svn-fast-export.py
please?

diff --git a/svn-fast-export.py b/svn-fast-export.py
index 77496f1..f2719ae 100755
--- a/svn-fast-export.py
+++ b/svn-fast-export.py
@@ -155,6 +155,12 @@ if __name__ == '__main__':
     if repos_path == '.': 
         repos_path = ''
 
+    try:
+        import msvcrt
+        msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+    except ImportError:
+        pass
+
     # Call the app-wrapper, which takes care of APR
initialization/shutdown
     # and the creation and cleanup of our top-level memory pool.
     run_app(crawl_revisions, repos_path)

Thanks,

James





More information about the bazaar mailing list