[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
subversion [2007/09/28 02:53]
bojar zahada, wiki zase kravne
subversion [2008/06/16 21:03]
zeman Corrected messed up formatting caused by migration from MediaWiki.
Line 3: Line 3:
 Subversion (''svn'') je nástroj pro archivaci (a v případě potřeby obnovu) starších verzí softwaru, který vyvíjíte. Pokud se vás v jednom projektu hrabe víc, Subversion vám pomůže ohlídat, abyste si vzájemně neničili práci. Subversion (''svn'') je nástroj pro archivaci (a v případě potřeby obnovu) starších verzí softwaru, který vyvíjíte. Pokud se vás v jednom projektu hrabe víc, Subversion vám pomůže ohlídat, abyste si vzájemně neničili práci.
  
-Pro projekty ÚFALu, na nichž chcete spolupracovat i s lidmi zvenkupoužijte vyhrazený stroj [[internal:svn.ms.mff.cuni.cz]].+Subversion vám poskytuje různé možnosti, kde založit tzv. **repozitář** (tedy archív verzí vašeho projektu), a různé možnosti, jak k němu přistupovat. **Lokální repozitář** vám stačí, používáte-li Subversion pro archivaci projektu, na kterém pracujete pouze vy, případně i další členové ÚFALu, ale všem vám stačí přistupovat k repozitáři z terminálu či skriptů běžících na linuxových počítačích na ÚFALu. Lokální repozitář je prostě podstrom adresářové struktury na síťových discích (konkrétně v ''/net/work/public/SVN'', ale můžete si ho vytvořit jinde). Když chcete lokálním repozitářem pracovatmusíte mít na dané místo souborový přístup. **Serverový repozitář** využijete, jestliže potřebujete s repozitářem pracovat z počítače, ze kterého není přímo vidět disk, na kterém je repozitář uložen (napřz Windows, z domova) nebo pokud s vámi na projektu spolupracují lidé vně ÚFALu, kteří ani úplný přístup do naší sítě nemajíU serverového repozitáře je potřeba nakonfigurovat metody, jakými se k němu bude po síti přistupovat, a také přístupová práva uživatelů.
  
 +Pro projekty ÚFALu, na nichž chcete spolupracovat i s lidmi zvenku, (serverové repozitáře) použijte vyhrazený stroj [[internal:svn.ms.mff.cuni.cz]]. Návod na konfiguraci najdete níže v kapitole [[#Subversion Server]]. Návod na vytvoření jednoduchého lokálního repozitáře najdete níže v kapitole [[#Lokální Subversion]].
  
-===== Nové Milanovo shrnutí (26.9.2007) =====+===== Subversion Server ===== 
 + 
 +Toto je Milanovo e-mailové shrnutí 26.9.2007. Týká se konfigurace serverových repozitářů na serveru svn.ms.mff.cuni.cz.
  
 Mili kolegove,  Mili kolegove, 
Line 15: Line 18:
   - pak se rozhodnete kterymi cestami budete s projektem pracovat - nejlepsi je asi nakonfigurovat vsechny (viz. nize) - tedy svn, webovy pristup do svn a Trac (take webovy). Vsude jsou prednastaveny nejake zakladni ucty, ale nejlepsi je tyto veci upravit podle vlastnich potreb. Napriklad nemusite chtit, aby ufal/maly... mel rw prava ve vasem projektu, jak tomu defaultne je!   - pak se rozhodnete kterymi cestami budete s projektem pracovat - nejlepsi je asi nakonfigurovat vsechny (viz. nize) - tedy svn, webovy pristup do svn a Trac (take webovy). Vsude jsou prednastaveny nejake zakladni ucty, ale nejlepsi je tyto veci upravit podle vlastnich potreb. Napriklad nemusite chtit, aby ufal/maly... mel rw prava ve vasem projektu, jak tomu defaultne je!
  
 +==== Konfigurace webového rozhraní SVN (preferováno) ====
  
-==== Konfigurace webového rozhraní SVN ==== +Toto rozhraní je užíváno SVN klienty, kteří dostanou repository udanou ve tvaru ''https://svn.ms.mff.cuni.cz/svn/PROJEKT'', tj. např.: 
- +<code>    svn --username ufal checkout https://svn.ms.mff.cuni.cz/svn/$PROJEKT</code>
-Toto rozhraní je užíváno SVN klienty, kteří dostanou repository udanou ve tvaru ''http(s)://svn.ms.mff.cuni.cz/svn/PROJEKT'', tj. např.: +
-    svn --username ufal checkout https://svn.ms.mff.cuni.cz/$PROJEKT +
  
 Co se tyce svn weboveho rozhrani, tak ten modul ma nasledujici konfiguraky (viz. /etc/httpd/conf.d/subversion.conf): Co se tyce svn weboveho rozhrani, tak ten modul ma nasledujici konfiguraky (viz. /etc/httpd/conf.d/subversion.conf):
Line 28: Line 29:
  
 Konfiguraky jsou globalni, tj. pro vsechny projekty spolecne. Konfiguraky jsou globalni, tj. pro vsechny projekty spolecne.
 +
 +O přidávání uživatelů a hesel viz níže.
  
 ==== Konfigurace protokolu SVN ==== ==== Konfigurace protokolu SVN ====
  
-Toto rozhraní je užíváno SVN klienty, kteří dostanou repository udanou ve tvaru ''svn://svn.ms.mff.cuni.cz/svn/PROJEKT'', tj. např.:+Toto rozhraní je užíváno SVN klienty, kteří dostanou repository udanou ve tvaru ''svn...'', tj. např.: 
     svn --username ufal checkout svn://svn.ms.mff.cuni.cz/$PROJEKT     svn --username ufal checkout svn://svn.ms.mff.cuni.cz/$PROJEKT
  
Line 63: Line 67:
     # na heslo budete dotázáni, heslo se nezobrazí ani na terminálu     # na heslo budete dotázáni, heslo se nezobrazí ani na terminálu
  
------------------------------------------------------------------------------------------------------------+===== Lokální Subversion =====
  
-Doufam, ze timto shrnutim zajistime optimalni vyuziti  :+//(Z návodu ve wiki University of Maryland převzal a upravil Dan Zeman.)//
  
-  Milan +Tento návod se týká lokálních repozitářů SVN, tedy takových, ke kterým budete přistupovat pouze z linuxových počítačů v síti ÚFALu.
- +
-===== Setting Up an Archive =====+
  
 You can use svn to keep track of your own code. You can use svn to keep track of your own code.
Line 76: Line 78:
 <code>svnadmin create /net/work/public/SVN/$MY_PROJECT</code> where obviously ''$MY_PROJECT'' should be replaced by the desired name for your project. <code>svnadmin create /net/work/public/SVN/$MY_PROJECT</code> where obviously ''$MY_PROJECT'' should be replaced by the desired name for your project.
  
-**Beware!** Do not use older versions (e.g. 1.1.4) of Subversion to create a repository! By default, they will use the Berkeley DB backend, which is not recommended. You may be able to "successfully" finish the repository creation but things are likely to get broken later! Check your version by running ''svn --version''Version 1.3.1 and above should work fine.+**Beware!** Do not use older versions (e.g. 1.1.4) of Subversion to create a repository! By default, they will use the Berkeley DB backend, which is not recommended. You may be able to "successfully" finish the repository creation but things are likely to get broken later! Check your version by running <code>svn --version</code> Version 1.3.1 and above should work fine.
  
 Let's say you want to archive the directory ''/home/$USER/proj'' and all its subdirectories. The following code puts your project in the ''proj'' folder under version control. After executing the commands, your ''proj'' folder will become a working copy of the files stored in the repository. Let's say you want to archive the directory ''/home/$USER/proj'' and all its subdirectories. The following code puts your project in the ''proj'' folder under version control. After executing the commands, your ''proj'' folder will become a working copy of the files stored in the repository.
Line 351: Line 353:
  
 This command takes the differences between the alopez branch from rev. 250 to 271, and applies them to the working copy.  Note that this may create conflicts!  (To preview these, I can use the ''--dry-run'' flag to ''svn merge'').  Once I've successfully resolved any conflicts, merged the files, and run regression tests as described above, I can commit the files to the development trunk. This command takes the differences between the alopez branch from rev. 250 to 271, and applies them to the working copy.  Note that this may create conflicts!  (To preview these, I can use the ''--dry-run'' flag to ''svn merge'').  Once I've successfully resolved any conflicts, merged the files, and run regression tests as described above, I can commit the files to the development trunk.
 +
  
 ===== Tags ===== ===== Tags =====
Line 371: Line 374:
 </code> </code>
  
-=== [[VersionControlTags|Current Tags and Branches]] === +===== Rolling Back Versions =====
- +
-=== Rolling Back Versions ===+
  
 What do you do if something is broken that wasn't broken before?  You can simply check out a copy of the file (or the entire project) from a point before the problem arose.  In order to see the revisions in which a particular file changed, you can run What do you do if something is broken that wasn't broken before?  You can simply check out a copy of the file (or the entire project) from a point before the problem arose.  In order to see the revisions in which a particular file changed, you can run
Line 387: Line 388:
 ''svn update &lt;file&gt; -r &lt;revision&gt;'' ''svn update &lt;file&gt; -r &lt;revision&gt;''
  
-=== Setting Up an Archive ===+===== Setting Up an Archive =====
  
 You can use svn to keep track of your own code.  Let's say you want to archive the directory ''/nfshomes/$USER/proj'' and all its subdirectories.  You can do so with the following commands. You can use svn to keep track of your own code.  Let's say you want to archive the directory ''/nfshomes/$USER/proj'' and all its subdirectories.  You can do so with the following commands.
Line 412: Line 413:
 See [[VersionControlSetup|VersionControlSetup]] for the series of commands used to set up the MTEval archive. See [[VersionControlSetup|VersionControlSetup]] for the series of commands used to set up the MTEval archive.
  
-=== Stupid Repository Tricks ===+===== Stupid Repository Tricks =====
  
 You can accomplish virtually anything you can imagine with the repository, although it may not be immediately obvious how.  For instance: You can accomplish virtually anything you can imagine with the repository, although it may not be immediately obvious how.  For instance:
  
-: $ Get the latest revision number of your current branch (wine cluster only).: ''svn info -r HEAD''  +  * Get the latest revision number of your current branch: ''svn info -r HEAD''You can also try ''svn log | head -2'' 
-:You can also try ''svn log | head -2'' +  View the logs of all changes to your current branch since you last updated: ''svn log -r HEAD:BASE'' 
- +  View all the differences between your working copy and the latest revision of your current branch: ''svn diff -r HEAD .'' 
-: $ View the logs of all changes to your current branch since you last updated.: ''svn log -r HEAD:BASE'' +  Merge into your current working copy the bug fixes checked in to r475 of the bittorrent branch (even if that's not your working branch): ''svn merge -r 474:475 file:///fs/clip-mteval/svn/Programs/branches/bittorrent .'' 
- +  Change your mind when you realize those bug fixes did more harm than good: ''svn merge -r 475:474 file:///fs/clip-mteval/svn/Programs/branches/bittorrent .''
-: $ View all the differences between your working copy and the latest revision of your current branch.: ''svn diff -r HEAD .'' +
- +
-: $ Merge into your current working copy the bug fixes checked in to r475 of the bittorrent branch (even if that's not your working branch).: ''svn merge -r 474:475 file:///fs/clip-mteval/svn/Programs/branches/bittorrent .'' +
- +
-: $ Change your mind when you realize those bug fixes did more harm than good.: ''svn merge -r 475:474 file:///fs/clip-mteval/svn/Programs/branches/bittorrent .'' +
- +
  
-=== Troubleshooting ===+===== Troubleshooting =====
  
 If you get the message: If you get the message:
Line 446: Line 440:
 * pray * pray
  
-=== Further Reading ===+===== Further Reading =====
  
 All of the information in this tutorial comes directly from the online [http://svnbook.red-bean.com/ Subversion book].  It is not necessary to read the entire book to get a good idea of how subversion works.  In general, if you only have a limited period of time in which to get acquainted, you will get the most mileage out of the following parts of the book: All of the information in this tutorial comes directly from the online [http://svnbook.red-bean.com/ Subversion book].  It is not necessary to read the entire book to get a good idea of how subversion works.  In general, if you only have a limited period of time in which to get acquainted, you will get the most mileage out of the following parts of the book:
Line 458: Line 452:
 Most likely, this is all you will need to look at to do most of your work.  Most of this material comes from Section 3.5. Most likely, this is all you will need to look at to do most of your work.  Most of this material comes from Section 3.5.
  
-[[Category:Resources]] 

[ Back to the navigation ] [ Back to the content ]