[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:59:10 CET

--- Karl Fogel kfogel@newton.ch.collab.net wrote:
 Marshall White cscidork@yahoo.com writes:
  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
 
 Hmmm. I'm surprised tihs works, because (in C) those two functions
 take arguments of different types. But in Python, they're both taking
 the result of an os.popen() as argument... Is SWIG type conversion
 folding this so that the two functions are now interchangeable?
 
 -K

Yes that is exactly what the function svn_swig_py_make_file does.
It checks the type of the argument and handles it accordingly:
1) Strings are treated as file names.
2) On UNIX-like machines, integers are treated as file descriptors.
   On Windows, integers are treated as file HANDLES
3) The Python file type is automagically converted to a FILE * by the SWIG code.

The os.popen call seems to return a Python file.

My guess is that there was some other magic conversion function that took care of whatever
svn_stream_from_stdio expected. I only just recently started looking at Subversion, I
completely missed that function.

BTW: I spelled the word occurrences wrong. Spell checkers are great if you use them...
Also the words be wanting should be replaced with want. Changing thoughts in the middle of a
sentence is not good either.

Marshall

---------------------------------------------------------------------
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:27 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.