Benutzerspezifische Werkzeuge
Sie sind hier: Startseite Dokumentation Freelancer SVN FAQ How do I create a local SVN repository for my buildout on the server?
Artikelaktionen

How do I create a local SVN repository for my buildout on the server?

Preceedings

Install svn from the tarball or via apt-get as described in the Ubuntu support area.
IMPORTANT: You do not need to install Subversion as a server to use it locally on the filesystem!
You can use the same way for non buildout contents.
More infos on:
http://subversion.tigris.org

Creating the repository

  1. Create a folder i.e. "svndev" in your users home directory holding the repository or more repositories.
    cd ~
    mkdir svndev
    cd svndev
  2. Create a repository "boarepos" inside
    svnadmin create ./boarepos
  3. Take a look inside the repository (but never touch manually!)
    ls -la boarepos

    and get i.e.

    total 36
    drwxr-xr-x 7 boa users 4096 2007-12-09 18:55 .
    drwxr-xr-x 3 boa users 4096 2007-12-09 18:55 ..
    drwxr-xr-x 2 boa users 4096 2007-12-09 18:55 conf
    drwxr-xr-x 2 boa users 4096 2007-12-09 18:55 dav
    drwxr-sr-x 5 boa users 4096 2007-12-09 18:55 db
    -r--r--r-- 1 boa users 2 2007-12-09 18:55 format
    drwxr-xr-x 2 boa users 4096 2007-12-09 18:55 hooks
    drwxr-xr-x 2 boa users 4096 2007-12-09 18:55 locks
    -rw-r--r-- 1 boa users 229 2007-12-09 18:55 README.txt
  4. Copy your current code to temporary location, where "~/instances/boaweb" is the current source and maybe add or delete as needed. 
    mkdir -p ~/tmp/boaweb
    cd ~/tmp/boaweb/
    cp ~/instances/boaweb/bootstrap.py ./
    cp ~/instances/boaweb/buildout.cfg ./
    cp -R ~/instances/boaweb/products ./
    cp -R ~/instances/boaweb/src ./
  5. Import your code from the temporary location into your local repository.
    svn import /home/boa/tmp/boaweb file:///home/boa/svndev/boarepos/boaweb -m "initial import"
  6. Check out from the new repository to test if all is there.
    mkdir ~/test
    cd ~/test
    svn co file:///home/boa/svndev/boarepos/boaweb
  7. Check out from the distance via ssh
    • You need a working ssh account with access to the repository to do this!
    • To use http or WebDAV you need to setup the SVN-server!
    svn co svn+ssh://boa@88.198.8.232/home/boa/svndev/boarepos/boaweb boaweb

Optionally use your checkout of the buildout

  1. Initialize "bootstrap" your buildout
    path/to/your/python bootstrap.py
  2. Run your buildout

    bin/buildout -v
  3. Run Zope in the foreground to debug your installation

    bin/instance fg

    when everything is OK shutdown with ctrl-c and then run permanent:

    bin/instance start

Modify your code and check in revisions

  1. Always update your local working copy before you start to modify code
    svn up
  2. Check for modifications
    svn stat
  3. Look for files marked with M, C, A, ?
    where
    • M = modified
    • C = conflict (file on server was modified since latest update! Needs merging the changes manually or reverting with "svn revert ..." !)
    • A = added file that was not checked in yet! Use "svn checkin" or "svn ci" for this
    • ? = unknown – file not under version control! Add these if necessary or modify the "svn ignore" policy file.
      Usually python bytecode files with endings "*.pyc" are not useful to be under version-control i.e.
  4. Add files with
    svn add [path to your file(s)]
  5. Check In changes with comments (best file by file, change by change)
    svn ci [path to your file(s)] -m "Comment"