Work behind proxy with subversion

Uncategorized No Comments

To checkout (or perform any other svn command) svn content from repository outside the proxy, modify ther servers file:

  • Linux/Mac OS X:

    [html]
    vi ~/.subversion/servers
  • Window 7/Window Server 2008:

    [html]
    cd %USERPROFILE%\AppData\Roaming\Subversion
    start servers

By uncommenting the following line and add your detail

[html]
http-proxy-host = your.proxy.com
http-proxy-port = 8000
http-proxy-username = defaultusername
http-proxy-password = defaultpassword

PySvn in Ubuntu and Mac

Subversion, Ubuntu/Linux No Comments

My main intention of building Subversion 1.5.1 is for PySvn 1.6.0 because it needs at least subversion 1.5.0.
Download source package from: https://launchpad.net/ubuntu/+source/pysvn/1.6.0-1.

* Untar the pysvn_1.6.0.orig.tar.gz into pysvn_1.6.0 directory
* Move to the Source directory:

[html]
octalina@desktop:~$ cd pysvn_1.6.0/Source

* Make sure subversion is installed
* Create the makefile:

[html]
octalina@desktop:~$ python setup.py configure
Info: Found Python include in /usr/include/python2.5
Info: Found  PyCXX include in /home/octalina/pysvn-1.6.0/Import/pycxx-5.4.1
Info: Found   PyCXX Source in /home/octalina/pysvn-1.6.0/Import/pycxx-5.4.1/Src
Info: Found    SVN include in /usr/local/include/subversion-1
Info: Found    APR include in /usr/local/apr/include/apr-1
Info: Found    SVN library in /usr/local/lib
Info: Found    APR library in /usr/local/apr/lib
Info: Creating Makefile for Source
Info: Building against SVN 1.5.1
Info: Creating Makefile for Tests

* compile the source code:

[html]
make

* Install pysvn by copying the extension from pysvn_1.6.0/Source.pysvn to python site-specific directory. e.g. normally Python 2.5 will be installed in /usr/lib/Python2.5

[html]
mkdir python-libdir/site-packages/pysvn
cp pysvn/__init__.py python-libdir/site-packages/pysvn
cp pysvn/_pysvn*.so python-libdir/site-packages/pysvn

Test on pysvn installtion:

[html]
octalina@octalina-desktop:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysvn
>>>

Build subversion 1.5.1 from source code release for Ubuntu (Hardy)

Subversion, Ubuntu/Linux No Comments

Installing subversion by building from source code:

Download subversion:

[html]
sudo wget http://darkstar.ist.utl.pt/ubuntu/archive/pool/main/s/subversion/subversion_1.5.1dfsg1-1ubuntu2_i386.deb

Download the dependencies package:

[html]
sudo wget http://darkstar.ist.utl.pt/ubuntu/archive/pool/main/s/subversion/libsvn1_1.5.1dfsg1-1ubuntu2_i386.deb
[html]
sudo wget http://darkstar.ist.utl.pt/ubuntu/archive/pool/main/n/neon27/libneon27-gnutls_0.28.2-2_i386.deb
[html]
sudo wget http://linux.cdpa.nsysu.edu.tw/debian/pool/main/s/sqlite3/libsqlite3-0_3.5.9-3_i386.deb

Process the debian package for installation:

[html]
sudo dpkg -i libsqlite3-0_3.5.9-3_i386.deb
sudo dpkg -i libneon27-gnutls_0.28.2-2_i386.deb
sudo dpkg -i libsvn1_1.5.1dfsg1-1ubuntu2_i386.deb
sudo dpkg -i subversion_1.5.1dfsg1-1ubuntu2_i386.deb

Install subversion:

[html]
apt-get -f install

Check the subversion version:

[html]
octalina@desktop:~$ svn --version --quiet
1.5.1

For other subversion dependencies can be found in these repositories:
* subversion rep: http://darkstar.ist.utl.pt/ubuntu/archive/pool/main/s/subversion/
* debian rep: http://packages.debian.org/testing/libs/

Subversion common error when performing

[html]
octalina@desktop:~$ svn up
svn: Unrecognized URL scheme for ''

If the above error occur, try to get latest libneon from the debian repository and install with SSL support. You can use SSL package from Ubuntu by typing:

[html]
sudo apt-get install openssl

and for neon installation add “–with-ssl” when you install neon package. Then re-install subversion with this new neon module.

Subversion Command

Mac OS, Subversion, Ubuntu/Linux, Window No Comments

Although I use subversion daily, I always forget how to add new project to current repository ‘cos I seldom do this. Scratch head and search internet again. Now, I just create new project for creating component for Joomla, before I forget I better post it to my blog so can be reviewed in the future without going through the hassle of search from google again. :P

Creating local repository:

  • In Mac/Unix
    [html]svnadmin create /full/path/to/repository
  • In Window
    [html]svnadmin create c:/full/path/to/repository

Add New Project to the repository:

  • In Mac/Unix

    [html]svn import new_project_name file:///full/repository/path/new_project_name -m "Initial Import"
  • In Window
    [html]svn import new_project_name file:///c:/full/repository/path/new_project_name -m "Initial Import"
  • In Network
    [html]svn import new_project_name http://hostname/svndirectory/repositoryname/new_project_name -m "Initial Import"

Check out project to working directory so you can start working on your new project with subversion features ;) . Upon checkout, content of new_project_name in the repository will be imported to working_directory_name.

  • In Mac/Unix

    [html]svn checkout file:///full/repository/path/new_project_name working_directory_name
  • In Window
    [html]svn checkout file:///c:/full/repository/path/new_project_name working_directory_name
  • In Network
    [html]svn checkout new_project_name http://hostname/svndirectory/repositoryname/new_project_name working_directory_name

Commonly used svn command:

  • Add file to version control:
    [html]svn add file_name_or_directory_name
  • Delete file from version control:
    [html]svn delete file_name_or_directory_name
  • Delete file directly from repository:
    [html]svn delete /full/path/of/repository/file_name_or_directory_name
  • Commit all changes:
    [html]svn commit -m "put useful message here, can add refs: #ticket_number is trac being used" file_name_or_directory_name_or_use_dot_for_current_directory
  • Update local working file from repository
    [html]svn update
  • When there is conflict: Easier way is to delete the conflict files (includes conflict log) from working directory and use `svn update` command to import the deleted files from repository. Another way is use below code to clean up the working directory after you managed to solve the conflict (always give me headache :P )
    [html]svn cleanup
  • Check the status of local files:
    [html]svn status
  • Check where is the the repository and the other status of current working directory (this is useful as I always forget which repository I used):
    [html]svn info