pythonsvnpysvn

Using import_() function from pysvn package


I would like to know how to use the function import_() from pysvn package but I do not understand exactly all the different parameters it needs.

Anyone can give me an example of how to use it?

Thank you in advance


Solution

  • Anyone can give me an example of how to use it?

    The following program demonstrates the use of client.import_(). This program performs exactly the same function as the command line:

    svn import /tmp/example svn+ssh://t420/svnroot/trunk/example -m "Initial checkin"
    

    Example program (x.py):

    import pysvn
    client = pysvn.Client()
    client.import_(path='/tmp/example',
                   url=u'svn+ssh://t420/svnroot/trunk/example',
                   log_message='Initial checkin')
    

    Result:

    $ ls /tmp/example
    hello.py  hello.txt
    $ python x.py 
    $ svn ls svn+ssh://t420/svnroot/trunk/example
    hello.py
    hello.txt