[ 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/10/08 12:21]
zeman Přeuspořádání.
subversion [2008/09/19 12:39]
zeman Warning.
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 353: Line 372:
  
 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 373: Line 393:
 </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
  
-''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''
  
-=== Setting Up an Archive ===+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. 
 + 
 +===== 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 414: Line 436:
 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): ''<nowiki>svn merge -r 474:475 file:///fs/clip-mteval/svn/Programs/branches/bittorrent .</nowiki>'' 
- +  Change your mind when you realize those bug fixes did more harm than good: ''<nowiki>svn merge -r 475:474 file:///fs/clip-mteval/svn/Programs/branches/bittorrent .</nowiki>''
-: $ 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 448: Line 464:
 * 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:

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