[ 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 [2008/06/16 21:06]
zeman Corrected messed up formatting caused by migration from MediaWiki.
subversion [2008/09/19 13:29]
zeman
Line 66: Line 66:
     htpasswd -s /home/svn/users/passwords <uzivatelske_jmeno>     htpasswd -s /home/svn/users/passwords <uzivatelske_jmeno>
     # 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 ===== ===== Lokální Subversion =====
Line 98: Line 99:
 rm -rf proj.old rm -rf proj.old
 </code> </code>
 +
 +Výše uvedený postup je možné po úpravách použít i pro vzdálený repozitář na serveru SVN. Předpokládáme, že jste si už vytvořili repozitář ''$REP'' podle návodu uvedeného dříve, a že jste k&nbsp;němu nakonfigurovali přístupová práva. Řádek ''svnadmin create ...'' zde tedy vynecháváme.
 +
 +<code>cd /home/$USER
 +mv $PROJ $PROJ.old
 +mkdir tmp
 +cd tmp
 +mkdir $PROJ
 +cp -r /home/$USER/$PROJ.old $PROJ/trunk
 +mkdir $PROJ/branches
 +mkdir $PROJ/tags
 +svn --username $USER import $PROJ https:///svn.ms.mff.cuni.cz/svn/$REP/$PROJ --message 'Initial import'
 +cd ..
 +svn checkout -q https:///svn.ms.mff.cuni.cz/svn/$REP/$PROJ/trunk $PROJ
 +rm -rf tmp
 +rm -rf $PROJ.old</code>
 +
 +Pokud jste si jisti, že pro tento projekt nebudete nikdy potřebovat větve ani otagované verze, můžete pravděpodobně vynechat vytváření podsložek ''branches'' a ''tags'' a celý projekt posunout o patro výš. To jsem ale nezkoušel.
  
 ===== Přechod z CVS pod SVN ===== ===== Přechod z CVS pod SVN =====
Line 373: Line 392:
   ~/projects/project   ~/projects/project
 </code> </code>
 +
 +
 +
  
 ===== Rolling Back Versions ===== ===== Rolling Back Versions =====
Line 378: Line 400:
 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
  
-''svn log &lt;file&gt;''+''svn log $FILE''
  
 This will show you the change log.  Hopefully, this will be sufficiently informative as to when particular changes occurred, but if you aren't sure what happened in a particular revision, you can always run This will show you the change log.  Hopefully, this will be sufficiently informative as to when particular changes occurred, but if you aren't sure what happened in a particular revision, you can always run
  
-''svn diff &lt;file&gt; -r &lt;revision&gt;''+''svn diff $FILE -r $REVISION''
  
 To see the changes that have been made.  Once you figure out which version you need, you can restore your working copy to that revision using  To see the changes that have been made.  Once you figure out which version you need, you can restore your working copy to that revision using 
  
-''svn update &lt;file&gt; -r &lt;revision&gt;''+''svn update $FILE -r $REVISION'' 
 + 
 +Warning: If you update the whole project (''svn update .'' in the root of the working copy) this way, svn will behave as if the revisions after the one you rolled back to did not exist. For instance, it will not show you the renewed files as changed when you call ''svn status''. If you call ''svn log'', it will show only revisions up to the one you rolled back to. If you call ''svn commit'' without making additional changes, nothing will happen. However, ''svn diff -r HEAD:BASE'' **will** show the differences between your current (rolled-back) version and the most recent one in the repository. So how do we force svn to store the restored old revision as the newest one in the repository?
  
 ===== Setting Up an Archive ===== ===== Setting Up an Archive =====

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