SVN For Idiots
From WowAce Wiki
--Greywind 23:21, 11 October 2006 (EDT) If you plan on using Tortoise SVN then i suggest you use this guide SVN For Beginners.
The purpose of this article is to help idiots (like me) use the SVN for all their updated coding desires. This is specifically targeted at people who want to host their addons on the SVN and aren't sure how to go about it.
Preliminary assumptions: You're using DOS (either from a really old version, or from a DOS box in Windows). You're using the commandline version of Tigris' SVN programs. You already have an SVN account. If you do not, please visit SVN_Rules#Getting_an_Account
Contents |
Import your addon into the SVN
Delete the contents of your externals directory
Since you'll be setting your externals up later, you don't want to upload them along with your addon. You still need the libs folder in order to set externals properly.
Command Line
rd /s /q libs
Import your addon
This creates your addon's directory, and uploads your data. Be sure that you are specificing a unique name for the directory.
Note that path names are case sensitive.
Note, the semicolon is a suggested seperator. Feel free to use hyphens, periods, or whatever else you feel is appropriate.
Be sure to change to the local AddOn directory on your computer first.
Command Line
svn import http://dev.wowace.com/wowace/trunk/<addon directory> -m "<addon name>: <commit message>"
Example
svn import http://dev.wowace.com/wowace/trunk/FairyGodmother -m "FairyGodmother: I'm a real boy, now!"
Delete your local copy
Craziness? Yes. Necessary? Yes (until and unless someone tells me otherwise). This must be done from the directory above your addon.
Command Line
rd /s /q <addon directory>
Example
This example assumes you are still in the addon directory. Your command prompt will look something like:
c:\program files\World of Warcraft\Interface\Addons\FairyGodmother
cd .. rd /s /q FairyGodmother
Checkout your addon from the SVN
Now that it's safe on the SVN, you'll need to get it back. You should be familiar with checking out addons, but a small refresher is provided. Note, it is assumed you are in the Addons directory in your WoW folder.
Note that path names are case-sensitive.
Command Line
svn co <full path to addon>
Example
svn co http://dev.wowace.com/wowace/trunk/FairyGodmother
How to set externals
This section assumes that you have already imported your addon into the SVN.
Now that your addon is under SVN versioning control, you can set your externals again.
Set up a text file with the definitions
Create a up a text file in your addon directory. Each line of the text file should consist of two parts: the name of the external, and its http address on the svn. Note that you are pointing to the directory where the LUA file lives, not the LUA file itself.
It is advised that you not "add" this file to the SVN.
Example
AceConsole-2.0 http://svn.wowace.com/wowace/trunk/Ace2/AceConsole-2.0 Crayon-2.0 http://svn.wowace.com/wowace/trunk/CrayonLib/Crayon-2.0
Set the property in the .svn data
This assumes that your command prompt is at your addons directory. If the text file containing your externals definition is not in the current directory, you'll need to provide a full path. After setting the property, you will need to commit the change for the directory (see below for a check-in example).
Command Line
svn propset svn:externals -F <externals file> <externals directory>
Example
svn propset svn:externals -F externals.txt libs
Delete your externals directory
This step should only be necessary if you are jumping in mid-stream. This should be pretty self-explanatory. This assumes you are in your addon directory. (Note, you can either use the commandline, or just delete it via Windows Explorer in the usual manner.)
Command Line
rd /s /q <externals directory>
Example
rd /s /q libs
Update your externals from the SVN
Again, this part is pretty self-explanatory. You may either do this from the addon directory, or above it. Since your addon is in the SVN, its directory structure will be recursed.
Command Line
svn update *
Commit your changes
Be sure to commit your changes by Updating your addon.
Updating your addon
As your addon evolves, you may wish to update the SVN with your changes. Happily, updating is much easier than importing
Note, this assumes you are in your addon directory.
Note, the semicolon is a suggested seperator. Feel free to use hyphens, periods, or whatever else you feel is appropriate.
Command line
svn ci -m "<addon name>: <update message>"
Example
svn ci -m "FairyGodmother: Squished that pesky bug that's been jumping around."
Adding new files to the SVN
As your addon evolves, you may need to add localization, module, or other files to it.
Note, this assumes you are in your addon directory.
Be sure to commit your changes by Updating your addon.
Command Line
svn add <file name>
Example
svn add Conjuring.lua
Removing files from the SVN
As your addon evolves, you may need to remove modules, or other files from it.
Note, this assumes you are in your addon directory.
Be sure to commit your changes by Updating your addon.
Command Line
svn del <file name>
Example
svn del FlyingVacumnCleaner.lua
Commit messages beyond the one-liner
If you would like to have long or formatted commit messages, you will need to use a text file.
Set up a text file with your commit message
The first line or word of your text file should be your addon name. There are ways to set up all kind of fancy formatting with bullets and stuff, but I don't know that yet. Perhaps someone will update this with that info.
It is advised that you not "add" this file to the SVN.
Example
FairyGodmother: Added: -- turns wooden puppets into real boys -- provides crickets with medals -- prognosticates the location of foster parents, especially those in the bellies of large fishes ToDo: -- turn pumpkin into carriage -- chastise young girls into being home on-time.
Commit your addon
The next time you go to commit your addon use the -F option.
Note that options are case sensitive.
Command Line
svn ci -F <commit text file>
Example
svn ci -F commit.txt

