<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
<document xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en">
   <header>
      <title>How to use SVN</title>
   </header>
   <body>
      <p>SVN is a program which keeps track of all the different versions of our source files. People familiar with its
      predecessor, <em>cvs</em> should read on.  This
      documentation is written because of our transition to SVN. When the transition period is over, we will rewrite
      these pages. While waiting, this page will contain information useful for our present cvs users.</p>
      <p>Our main subversion repository is at the address <link href="https://victorio.uit.no/langtech/">http://victorio.uit.no/langtech/</link>. Subversion documentation is
      available as a <link href="http://svnbook.red-bean.com/en/1.4/index.html">browsable book</link>.</p>
      <section>
         <title>Graphical Subversion clients</title>
         <p>If you want to use a graphical Subversion client, please see the following pages:</p>
         <ul>
            <li><link href="docu-svn-user-tortoisesvn.html">TortoiseSVN</link> - an open-source GUI front-end for Windows; this is the 
            program we have experience with on Windows. (<link href="http://tortoisesvn.net/">home page</link>, <link href="http://en.wikipedia.org/wiki/TortoiseSVN">Wikipedia page</link>)</li>
            <li><link href="docu-svn-user-versionsapp.html">Versions.app</link> - a Mac only, commercial client (<link href="http://www.versionsapp.com/">home page</link>)</li>
            <li><link href="docu-svn-user-rapidsvn.html">RapidSVN</link> - a multi-platform, open-source GUI front-end (<link href="http://rapidsvn.tigris.org/">home page</link>)</li>
            <li><link href="docu-svn-user-svnx.html">SvnX</link> - a Mac only, open-source client (home page <link href="http://code.google.com/p/svnx/">here</link> and <link href="http://www.lachoseinteractive.net/en/community/subversion/svnx/features/">here</link>)</li>
         </ul>
         <p>Please follow the recommendations for daily routines at the end of this document!</p>
      </section>
      <section>
         <title>Use svn on the command line</title>
         <p>To <em>check out</em> means that you copy all the documents that our projects are working on to your
         computer.</p>
         <section>
            <title>The first commands</title>
            <p>Go to your home directory (write <code>cd</code>), and give the following command:</p>
            <source xml:space="preserve"><![CDATA[
svn co https://victorio.uit.no/langtech/trunk main --username <your_username>
]]></source>
            <p>... where you have replaced &lt;your_username&gt; with the username you have aquired from the admin. This
            will enable you to check in your work. If you don't have a user name or just want to browse our code, just
            skip the username.</p>
            <p>After you have checked out, please run the following script, and follow the on-screen instructions:</p>
            <source xml:space="preserve"><![CDATA[
main/gt/script/gtsetup.sh
]]></source>
            <p>With the above commands, you have now on your local computer a copy of the source code and the
            environment is set up properly.</p>
         </section>
         <section>
            <title>Frequently used commands</title>
            <p>Now that you have checked out your repository, you can use a set of commands to manipulate your copy of
            the source code. We recommend to always <em>update</em> the repository before you begin to edit files inside
            it. After having edited some files you usually want to have an overview of which files have been
            <em>modified</em>. To share our work with the others we <em>check in</em> our work. We can also
            <em>add</em>, <em>delete</em>, <em>move</em> and <em>copy</em> files inside the repository. A brief overview
            of the commands needed for these actions is given below, for further details see the references at the end
            of this document.</p>
            <dl>
               <dt>Update your working copy</dt>
               <dd>svn up</dd>
               <dt>Scedule a file for addition</dt>
               <dd>svn add filename</dd>
               <dt>Scedule a file for deletion</dt>
               <dd>svn delete filename</dd>
               <dt>You may also copy and move files and directories with these two commands, but read about them in the
               svn book first:</dt>
               <dd>svn copy filename<br/> svn move filename</dd>
               <dt>Examine your changes</dt>
               <dd>svn status</dd>
               <dt>Examine the file history</dt>
               <dd><code>svn log FILE</code></dd>
               <dt>Change the commit message for a specific revision</dt>
               <dd><code>svn propedit svn:log --revprop -r REV FILE</code><br/>This will bring up the existing log text
               for the specified revision in your default editor (typically Emacs), where you can edit and change it as
               you want. This is useful if you accidentally committed some changes with an empty or uninformative log
               message.</dd>
               <dt>Compare your modified file to the version in the repository</dt>
               <dd><code>svn diff FILE</code></dd>
               <dt>Compare some earlier versions, say here versions 123 and 120</dt>
               <dd><code>svn diff -r 123:120 FILE</code></dd>
               <dt>Undo your local changes (ie revert to the repository status)</dt>
               <dd><code>svn revert FILE</code></dd>
               <dt>Resolve Conflicts (Merge Others' Changes)</dt>
               <dd>svn update<br/> svn resolved</dd>
               <dt>Commit your changes</dt>
               <dd><code>svn ci -m "Your description of the changes here." FILE</code><br/> (Note that the above
               changes, add, delete, copy, move, must all be committed by ci in order to take effect)</dd>
            </dl>
         </section>
         <section>
            <title>Ignoring items</title>
            <p>The Subversion <code>svn:ignore</code> property is very similar in syntax and function to the CVS
            <code>.cvsignore</code> file. In fact, if you are migrating a CVS working copy to Subversion, you can
            directly migrate the ignore patterns by using the <code>.cvsignore</code> file as input file to the
            <code>svn propset</code> command:</p>
            <source xml:space="preserve"><![CDATA[$ svn propset svn:ignore -F .cvsignore . 
property 'svn:ignore' set on '.' 
$]]></source>
            <p>More details about ignoring files can be found in <em>Chapter 3: Advanced Topics</em>, in the section
            <em>Ignoring Unversioned Items</em>, in the <link href="http://svnbook.red-bean.com/">SVN book</link>.</p>
         </section>
      </section>
      <section>
         <title>Daily routines</title>
         <ul>
            <li>Update in the morning, and allways before you check in.</li>
            <li>Always check in the files at the end of the day.</li>
            <li>If you know that other people are working on the same file, you should check in several times a
            day.</li>
            <li>Check in after you have done major revisions.</li>
            <li>Remember to compile the program before you check in, so that you know you do not check in a defect
            file.</li>
         </ul>
      </section>
      <section>
         <title>What do I write in the log message</title>
         <p>The best way to learn to write good log messages is to read other log messages. Pick a file (e.g.
         twol-sme.txt, sme-lex.fst), and read the log (the command is <strong>svn log filename | less</strong>). If the
         log message tells you what you want to know, then it is a good log message.</p>
         <p>In svn it is possible to edit and correct bad log messages. See the list of useful commands above for how to
         do this.</p>
      </section>
      <section>
         <title>Further reading</title>
         <p>The <link href="http://svnbook.red-bean.com/en/1.4/svn.tour.cycle.html">Basic work cycle</link> in the <link href="http://svnbook.red-bean.com">SVN book</link> covers daily usage in great detail. <link href="http://svnbook.red-bean.com/en/1.4/svn.forcvs.html">Appendix B</link> covers some details for users
         accustomed to CVS.</p>
         <p>The <link href="http://www.rapidsvn.org/index.php/Main_Page">RapidSVN wiki</link> has a <link href="http://www.rapidsvn.org/index.php/Documentation#Tutorial.2C_Part_1">tutorial</link> that covers our daily
         usage pattern.</p>
      </section>
      <p class="last_modified">Last modified: $Date: 2011-11-22 12:52:28 +0100 (tir, 22 nov 2011) $, by $Author: sjur
      $</p>
   </body>
</document>
