Version 4 (modified by 10 years ago) ( diff ) | ,
---|
Checking out
To check out the software of FACT (or just a part of it) you need to know the URL for the
user@host:~$ svn checkout <URL>
call. In order to find out this URL, just click on the "Browse Source" button on the upper right side of this page. Browse to the partent folder you want to checkout and copy the URL from your browsers address field to your command line, the URL you copy might look like this:
https://trac.fact-project.org/browser/trunk/Mars
Note: Before you hit <Enter> replace '/browser/' with '/svn/'. So for the example the call might look like this:
user@host:~$ svn co https://trac.fact-project.org/svn/trunk/Mars mars
This call will checkout the current version of Mars form our SVN repository and dump it into a new folder called mars/ in your home folder.
Before you commit something
Although the svn is a versioning system which keeps the history, it should be kept clean as much as possible. We are all humans, so we make mistakes, but svn should help us to cure real mistakes as fast as possible, not be sloppy and create more mistakes.
Here are a few simple rules which help a lot to make sure you know what you do when accessing the svn and which help you to properly document your changes. The later is important if a problems needs to be tracked. Not only the comments to the code of question might be important, but also other comments. To find the commit in question as soon as possible, comments which tells you the kind of the commit are very important (cosmetics, only includes, major code change, etc) and the meaning (fixed a compiler warning, fixed a memory leak, ...)
Comitting
Before you commit anything, check which files would be committed:
svn diff | grep Index
Now you have a list of files... choose the ones you want to submit and check the diff
svn diff filename
You might find surprises sometimes. A change you forgot or a change which was only for debugging. Clean your change. Now you are ready to commit the file
svn ci filename -m "Comment"
Write a comment which tells the type of change, the reason of change and maybe some details. Write comments for every change you made, try to be as detailed as possible. Hint: If you write a comment which needs the name of a file or class, most probably it is the wrong comment because it applies to another file.
Do that for each file independently, file by file. It is very rare that the same comment applies to several files. If this is the case, make sure that you checked all their diffs and then commit all of them together.
Revert
Sometimes it might happen that you committed something by mistake. For example, you thought to do svn ci filename but in fact did svn ci and committed file which were not intended to be committed. Don't forget to keep the list of files which need to be reverted as soon as possible before it is off your console history!
I have created a short script (I called it *revert.sh*) which allows to revert the last change (unfortunately only file-by-file, but this makes sense to ensure you know what you do).
svn merge -r COMMITTED:PREV $1
svn ci $1 -m "Reverting to last revision."
svn merge -r COMMITTED:PREV $1