Categories
- Chronicles (59)
- Community and Society (90)
- Ecology & Environment (12)
- Essays (32)
- Events (25)
- Gourmet (30)
- Info & Biz Technology (289)
- Linux & Open Source (103)
- Linux Journal Index (14)
- Mobility (19)
- Multimedia (17)
- OpenDocument Format (64)
- Web 2.0 (68)
- Linux & Open Source (103)
- Metaphysics (32)
- Misc (8)
- Music & Podcasts (39)
- Podcast: brazilian jazz (8)
- Podcast: general (13)
- Travels (67)
- Central Asia 2007 (29)
- Vegetarianism (10)
Short updates
Basic Subversion Repository Management
3
comments
By AviPublished:
Fri, 31 Aug 2007 06:22:51 +0000
Updated:
Thu, 31 Jan 2008 19:47:42 +0000
Published:
31 Aug 2007
Updated:
31 Jan 2008
Published:
6:22 am
Updated:
7:47 pm
Categories: Linux & Open Source
Tags: best best:tech lang:en tech:yes
(This is a shared personal note, suggestions are welcome.)
Create a Subversion repository for a project, say The SVG Blog Icons:
- Create the repository on the hosting panel with a project name (e.g. Blog Icons) and project ID (e.g. blogicons).
- Import the files:
bash$ cd src/ bash$ ls blogicons bash$ export EDITOR=vi bash$ svn -m "First import" import blogicons http://svn.alkalay.net/blogicons/trunk
- Start over with a fresh copy:
bash$ mv blogicons blogicons.old bash$ svn co http://svn.alkalay.net/blogicons/trunk blogicons
- Create a repository for pointers to official releases and register the official release the files imported represent:
bash$ svn -m "Links of official releases" mkdir http://svn.alkalay.net/blogicons/tags bash$ svn -m "Official 20070518 version" cp http://svn.alkalay.net/blogicons/trunk http://svn.alkalay.net/blogicons/tags/20070518
- Check how it looks pointing the browser to http://svn.alkalay.net/blogicons/
Manage project files:
- Add files
bash$ cd blogicons bash$ svn add newfile.svg bash$ svn add newfiles.*
- Remove files
bash$ cd blogicons bash$ svn rm oldfile.svg bash$ svn rm oldfiles.*
- To embed the file’s meta information in itself as a comment
bash$ cd blogicons bash$ echo "<!-- $Id$ -->" >> file.xml bash$ echo "/* $Id$ */" >> file.c bash$ echo "// $Id$" >> file.cpp bash$ echo "# $Id$" >> file.sh bash$ echo "# $Id$" >> Makefile bash$ svn propset svn:keywords Id file.xml file.c file.cpp file.sh Makefile
Every time changes and commits happen, the $Id$ tag will be replaced as this examples:
<!-- $Id: file.xml 148 2007-07-28 21:30:43Z username $ --> /* $Id: file.c 148 2007-07-28 21:30:43Z username $ */ // $Id: file.cpp 148 2007-07-28 21:30:43Z username $ # $Id: file.sh 148 2007-07-28 21:30:43Z username $ # $Id: Makefile 148 2007-07-28 21:30:43Z username $
People use to put the $Id$ tag in the beginning of source files. The example show how to put in the end, but that’s because it is easy to represent it here in the documentation. You should put $Id$ tags in the beginning of the file.
- Commit changes to repository
bash$ cd blogicons bash$ svn -m "Changed color to red on icon A, moved the circle shape to left on icon C" commit
Use descriptive comments favoring WHAT changed on files and not which files changed.