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

Re: Tool for converting a CVS repository into a SVN repository?

From: <cscidork_at_yahoo.com>
Date: 2003-01-30 23:19:56 CET

--- Karl Fogel kfogel@newton.ch.collab.net wrote:
 Marshall White cscidork@yahoo.com writes:
  I can post a patch if you're interested. I am hoping that the
  small change in swigutil_py.c
  didn't accidently break something else.
 
 Sure, post it!
 
 ---------------------------------------------------------------------
 To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
 For additional commands, e-mail: dev-help@subversion.tigris.org
 

I looked around for calls to the function svn_swig_py_make_file.
There were a few more SWIG wrappers that used it.
Notable the functions were:
  svn_client_diff
  svn_stream_from_aprfile
  svn_stringbuf_from_file
  svn_io_run_diff
  svn_io_run_diff3

I didn't find any Python scripts that called any of these functions. From what I guess these
functions *should* do, I can only guess that the patch will be good for them as well.

Marshall

Log:
Make cvs2svn work again.

* subversion/bindings/swig/swigutil_py.c (svn_swig_py_make_file):
  Call apr_os_file_put with an argument of O_RDWR instead of O_WRONLY.
  We might be wanting to read the file instead of just writing to it.

* tools/cvs2svn/cvs2svn.py:
  Replace all occurances of svn_stream_from_stdio with calls to
  svn_stream_from_aprfile

Index: subversion/bindings/swig/swigutil_py.c
===================================================================
--- subversion/bindings/swig/swigutil_py.c (revision 4672)
+++ subversion/bindings/swig/swigutil_py.c (working copy)
@@ -866,7 +866,7 @@

   if (fd = 0)
     {
- status = apr_os_file_put (apr_file, fd, O_CREAT | O_WRONLY, pool);
+ status = apr_os_file_put (apr_file, fd, O_CREAT | O_RDWR, pool);
     }

   /* FIXME: We shouldn't just silently fail. */
Index: tools/cvs2svn/cvs2svn.py
===================================================================
--- tools/cvs2svn/cvs2svn.py (revision 4672)
+++ tools/cvs2svn/cvs2svn.py (working copy)
@@ -383,7 +383,7 @@
         delta.svn_txdelta_send_string(pipe.read(), handler, baton, f_pool)
       else:
         # open an SVN stream onto the pipe
- stream2 = util.svn_stream_from_stdio(pipe, f_pool)
+ stream2 = util.svn_stream_from_aprfile(pipe, f_pool)

         # Get the current file contents from the repo, or, if we have
         # multiple CVS revisions to the same file being done in this
@@ -392,7 +392,7 @@
         # the contents in the repo won't have changed yet.
         if repos_path == lastcommit[0]:
           infile2 = os.popen(co -q -p%s \'%s\' % (lastcommit[1], f), r, 102400)
- stream1 = util.svn_stream_from_stdio(infile2, f_pool)
+ stream1 = util.svn_stream_from_aprfile(infile2, f_pool)
         else:
           stream1 = fs.file_contents(root, repos_path, f_pool)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:26:21 2006

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.