Difference between revisions of "Brief introduction to SVN"
(→Usefull things to know) |
(→The svnci script) |
||
Line 83: | Line 83: | ||
Usage: | Usage: | ||
− | *place svnci in your root svn directory, eg <code>gramps22</code> or <code>gramps30</code> | + | *place svnci in your root svn directory, eg <code>gramps22</code> or <code>gramps30</code> (chmod +x) |
*you '''need''' to have the ''patchutils'' package installed, or svnci will throw an error (''filterdiff'' is needed) | *you '''need''' to have the ''patchutils'' package installed, or svnci will throw an error (''filterdiff'' is needed) | ||
*do edits and commit new files | *do edits and commit new files |
Revision as of 11:14, 24 November 2007
The development source of GRAMPS is stored in the SVN repository. This helps synchronizing changes from various developers, tracking changes, managing releases, etc. If you are reading this, you probably want to do just two things with SVN: download latest source or the development version, or upload your changes.
Contents
Stable version 2.2.x
- To download the source to a /home/~user/gramps22 directory, you can use two methods to access the SVN repository:
- An http frontend to gramps SVN
- SVN access
- To upload your changes, you have to have developer access.
The second method requires that svn be installed on your system (Debian/Ubuntu: apt-get install subversion
; Fedora: yum install subversion
).
With the SVN method, type the following in the command line:
svn co https://gramps.svn.sourceforge.net/svnroot/gramps/branches/gramps22 gramps22
You should see the downloading progress reported in your terminal. If you would like to update your source tree after some time, execute the following command in the top directory of the gramps22 source tree:
svn update
To commit your changes, you can execute:
svn commit
Since uploading is a potentially dangerous operation, you have to explicitly obtain a write access to the SVN repository from Don Allingham or Alex Roitman.
Unstable development version 3.0
- Also see: Running a development version of Gramps
Obtain it
As of 02 Feb 2007, a development branch has been created, which is now the new trunk. To grab a copy to ./gramps30 :
svn co https://gramps.svn.sourceforge.net/svnroot/gramps/trunk gramps30
Prepare it
Now go into the gramps30
directory and type
./autogen.sh
You will get warnings of missing packages that GRAMPS needs to build from source. Install these, read INSTALL and README file in the gramps30 dir for pointers This will execute the make command too. If not, type after the above
make
make install |
Run the development version
As you should not install the development version, how can you try it out?
Easy, just type the following in the gramps30
directory
python src/gramps.py
Where for bugs?
The bug tracker has in the right top angle different projects. Choose project 3.x and submit an issue.
Useful things to know
Subversion commands
svn help add
svn help commit
svn help log
Adding files to repositories requires you to set some properties to the files. See svn help propset
. You can use the propget
on existing files to see how you should add it. A convenient way is to common files to your ~/.subversion/config
file, eg in my config I have:
*.py = svn:eol-style=native;svn:mime-type=text/plain;svn:keywords=Author Date Id Revision *.sh = svn:eol-style=native;svn:executable Makefile = svn:eol-style=native *.png = svn:mime-type=application/octet-stream *.svg = svn:eol-style=native;svn:mime-type=text/plain
The svnci script
A usefull script for helping you commit changes is svnci
: Download svnci
Usage:
- place svnci in your root svn directory, eg
gramps22
orgramps30
(chmod +x) - you need to have the patchutils package installed, or svnci will throw an error (filterdiff is needed)
- do edits and commit new files
- edit the Changelog file with your edits
- to commit changes to the svn repository, go to the root directory, and do
./svnci
. This will collect all changes, and upload the change. The log message will be taken from the Changelog.
Browse svn
An alternative to the command line tools to view the svn repository is the online interface.
Official committing policies
- Adding new files
- All the files with the translatable strings must be listed in the po/POTFILES.in file. This means that most new files must have their names added to that file.
- All the files that need to be released must be listed in the Makefile.am in the same directory. Please remember to do this for new files that you add to SVN.
- You'll also need to set several properties for new files. For .py files, try the following:
svn propset svn:mime-type text/plain src/somefile.py svn propset svn:eol-style native src/somefile.py svn propset svn:keywords 'Author Date Id Revision' src/somefile.py
- Bugfixes in branches
- Whenever a bug is fixed in a branch, it should be the committer's responsibility to make sure the fix is also committed to the trunk.
- You can do this manually, but you can also create a patch on gramps22 branch and apply it to trunk:
gramps22$ svn diff -r PREV > ~/mypatch.patch gramps22$ cd ../trunk trunk$ patch -p0 < ~/mypatch.patch
- Then you may have to fix things that could not be applied due to conflicts. The patch program would mark the conflicts with the <<<<<<, ======, and >>>>>> signs. You will then need to commit your changes:
trunk$ ./svnci
- More info: http://svnbook.red-bean.com/
- ChangeLog entries
- Every change to the code should be documented in the top-level ChangeLog file (or in per-directory ChangeLog for po and help directories). When possible, we'd like to stick to the GNU ChangeLog standards.
- This especially goes for committing contributed code. In that case, the ChangeLog should list the contributor's name and email, not the maintainer's.