Subversion
Table of Contents
This page will attempt to describe common Subversion operations within the Aegisub repository.
Some notes before you start reading
- Any occurrence of $SVN should point to your svn+ssh:// URL to the repository that you normally use to commit.
- Your Subversion version should be at least 1.5.
Merging
This example uses the 2.1.8 branch with merges from trunk/aegisub both are at r3165.
Some general notes
- Always list the revision you've merged from in your commit message. If you're up to it a brief list of what it fixes or what was changed would be useful. This does not have to be as detailed as the original commit message.
- DO NOT MERGE INTO A FILE: This is very bad, always merge directories. It should always be the toplevel directory from what you're merging if in doubt ask!
- You can merge both ways if you commit something to a branch that should go into trunk. If possible however commit to trunk first then to the branch.
- Before you merge make sure the directory you're merging to is clean, there should be no modifications or files laying around otherwise the merge could screw up. You only need to checkout the aegisub_2.1.8 directory, or in the case of trunk trunk/aegisub.
Unix
So lets say someone has committed a translation to trunk and you want to now merge those changes into the 2.1.8 branch. Subversion actually makes things quite easy, in order to find a list of eligible revisions you can merge do:
svn mergeinfo --show-revs=eligible $SVN/trunk/aegisub
In the branches/aegisub_2.1.8 directory, this will give you a list of revisions you can merge into the current branch, in this case we want r3165 which was an update to the German translation.
To merge this specific change into the 2.1.8 branch:
svn merge -c3165 $SVN/trunk/aegisub
You will get this output returned:
verm@peach# svn merge -c3165 $SVN/trunk/aegisub --- Merging r3165 into '.': U po/de.mo U po/de.po
Use svn diff to ensure that everything has updated as it should, you'll see an additional property at the top which contains the actual mergeinfo. The path merged from and a list of revisions.
It's possible to select multiple revisions from the list, just use a comma seperated list of revisions after -c. As long as they are in the list of eligible revisions it will work.
Any conflicts created when merging should be solved in the usual way.
Windows
Assuming the same scenario as in the Unix case, this is how you do it with TortoiseSVN.
- Navigate to the directory you want to merge to (i.e. $SVN/branches/aegisub_2.1.8).
- Right-click the folder you want to merge to (i.e. aegisub) and select TortoiseSVN -> Merge.
- Select the first option (merge a list of revisions) and click next.
- Fill in the URL you want to merge from in the top box (i.e. $SVN/trunk/aegisub).
- Fill in the revision you want to merge (3165 in this case) in the "revision range to merge" box. If you want to merge several revisions, just follow the instructions (i.e. separate them with commas) and hit next.
- Everything in this screen can be left alone; just press "test merge" to make sure everything it is going to happen as planned.
- When you've assured yourself that everything is OK, press Merge to finish.
- You can now commit the changes. Note that the merge will change the svn:mergeinfo properties on the directories. This is normal.
First / Initial Merge
If this is the first merge check to make sure that there are _no_ svn:mergeinfo properties on any files, the examples are for Unix however this should be a simple operation on tsvn.
svn propget svn:mergeinfo -R .
There should be no mergeinfo properties on any files, if there are then the original Branching was done incorrectly. To remove them do:
svn propdel svn:mergeinfo -R .
Then commit this before doing any merges.
