Archive

Archive for the ‘svn’ Category

Set the text editor in SubVersion to VI

October 27th, 2009 admin No comments
export EDITOR=vi

or

EDITOR=vi; export EDITOR

Source: http://codenewbie.com/forum/program-design-methods/3251-subversion-tutorial.html

Categories: svn Tags:

Ignore Files and Directories in Subversion

May 17th, 2009 admin No comments
# ---------------------------------------------------------------------
#  Ignore all the .txt files in the /trunk/Blah/ directory
# ---------------------------------------------------------------------
 
# Go to the directory
cd trunk/Blah/              # The directory with the files
 
# Start editing the properties for the current directory
svn propedit svn:ignore .   # Opens an editor (SVN_EDITOR, EDITOR)
 
# Add the following value with a new line, save, and exit:
*.txt
 
# See that things worked
svn propget svn:ignore .    # So you can see the properties
svn status --no-ignore      # You should see an 'I' next to the ignored files
 
# Commit
svn commit -m "New Ignores" # You must commit the new property change
 
# ---------------------------------------------------------------------
#     Ignore a single file secret.txt in the /trunk/ directory
# ---------------------------------------------------------------------
 
# Go to the directory
cd trunk/
 
# Add just the single file to the current directories ignore list (like above)
# Note the dot at the end of the command is important
svn propset svn:ignore secret.txt .
 
# See that things worked
svn propget svn:ignore .    # Notice the single file was added to the list
svn status --no-ignore      # You should see an 'I' next to the ignored files
 
# Commit
svn commit -m "Its secret"  # You must commit the new property change

Source: http://blog.bogojoker.com/2008/07/command-line-svnignore-a-file/

Categories: svn Tags:

Setup svn repo with an auto update hook

April 23rd, 2009 admin No comments

This is on a MediaTemple VPS running on CentOS 5 and is assuming you already have svn installed

So first thing is to go into the hooks folder for a particluar svn repository

cd /var/svn/website/hooks

You’ll see they all have .tmpl on the end – so the’yre all just templates

To make it active we need to remove the .tmpl
The one we want is post-commit.tmpl
So jut need to copy it to new file without the extension

cp post-commit.tmpl post-commit

So now we need to vi into it
You’ll see its full or instructions, etc.
You can just leave that
Go down to bottom
Comment out the last 5 lines, well last 2 and the 2 above

Now add two lines whever u want:

cd /var/www/vhosts/somedomain.com/subdomains/devdomain/httpdocs/  #path to website
svn up

Ok save and exit

Ok now need to make executable

chmod 755 post-committ

Now, the script needs to be owned by a user that has an svn account set up in the repo

To see list of users look in the passwd file ( /var/svn/website/conf/ )

chown username post-commit

Now u can test with

./post-commit

It might need the ownership of whoever made the working copy checkout on the server, the ones I have done I have always made the first checkout on the server so it’s always been my account.  It will give an error if it needs to be a different user ownership anyway.

Categories: svn Tags:

svn checkout — Check out a working copy from a repository.

April 9th, 2009 admin No comments

Synopsis

svn checkout URL... [PATH]

Description

Check out a working copy from a repository. If PATH is omitted, the basename of the URL will be used as the destination. If multiple URLs are given each will be checked out into a subdirectory of PATH, with the name of the subdirectory being the basename of the URL.

Alternate Names

co

Source: http://svnbook.red-bean.com/en/1.0/re04.html

Categories: svn Tags: