Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

SVN For Beginners

From WowAce Wiki
Jump to: navigation, search

Note this guide is meant for developers of addons or for people who want to develop addons
This guide is here for all you people (like me) who want to host their addon on wowace's svn server and using Tortoise SVN.

Note that RapidSVN is completely unsuitable for a developer since it has a hard limit on the number of chars it permits in a property which prevents specifying externals properly.

Preliminary assumptions:

Import your addon into the SVN

Delete your externals directory

Since you'll be setting your externals up later, you don't want to upload them along with your addon.

By delete, it means the whole directory structure your externals (libraries) live in, not just the files themselves or you'll probably end up with lock errors when you try to update. When you set up the externals later on you will tell it where to create the directories for them again.

Import your addon

Ok, right click your addons's folder, you should see something like this.
Import1.jpg
Choose the import option, fill in the repository info (i.e. http://dev.wowace.com/wowace/trunk/<addon name>) to make it look like so.
Import2.jpg

Delete your local copy

Yes you will have to delete your copy of your addon now, don't worry we will be getting it back with the next step.

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. Recreate the addon's folder, go into it and right click anywhere. See the SVN Checkout option? Choose that and type in the path to your addon on the server (or click the button labled "..." to browse the svn server to find your addon). The window should look like this (the checkout directory should be the directory where you want the addon's files to be in, i have all my svn stuff in a seperate directory so i wont break my addons when i play).
Checkout1.jpg

Setting SVN Properties (i.e. 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 and give it a default commit message template.

Externals

First right click your addons folder, go to Properties and then choose the Subversion tab. Again choose the properties option. I will use my addon Druid_Bar as an example, note my properties are already set in this pic. Your properties panel should be empty.
Svnproperties1.jpg

Next click on the add button at the bottom, choose the property name svn:externals from the drop down, now you want to add your externals like so. notice that you only point to the externals directory, not the .lua file itself.
Svnproperties2.jpg

End of Line

It is mandatory to set svn:eol-style native for each file.

svn:eol-style native

For more on this see svn property eol-style

Log Template

The other property you will want to set is the tsvn:logtemplate setting. This setting will help you so you don't forget to add the addon's name when you commit changes. My template is usually


addon name:
-

I always add the changes after the "-".

Committing your changes

Before we get to updating your addon on the svn server lets talk about adding/deleting/renaming files in your addon. By now you should be used to using the right click menu commands so lets get started.


If you receive an error similar to this:

Error: MKACTIVITY of '/wowace/!svn/act/08b4a468-c27c-2c46-9abf-b3b690f83fef': 403 Forbidden (http://svn.wowace.com)

ensure that you checked the addon out from http://dev.wowace.com, not from http://svn.wowace.com, as you may only authenticate against http://dev.wowace.com

--Nemes 23:53, 31 August 2007 (EDT)

Adding Files

A lot of times you begin an addon and it starts out simple but then you realize you need to split out some functions into a seperate file or add localization. For any reason you need to add a file to your addon you first need svn to see it so right click the file and under Tortoise SVN Options there is the "Add.." option, click ok and its now added and will be uploaded when you do a commit.

Deleting/Renaming Files

If for any reason you need to delete/rename a file, use the right click menu on it and use the Delete/Rename function from under Tortoise SVN option. You should not delete or rename using Explorer.

Updating on the SVN server (i.e. Committing)

Ok now that we know the basics and our addon has had a few bug fixes now its time to upload it to the server to share it with everyone. First right click the addon folder and select the commit option under Tortoise SVN, a dialog box that looks like this should pop up, listing your changed files in the bottom box and it should have your default template message inserted into the top box ready for you to tell people what you changed.
Commit1.jpg
click ok and you have now done your first svn commit, congrats :)

Notes

  • Have anything to add? questions? have an error that you don't know how to fix? well I spend a lot of time in irc://chat.freenode.net/wowace and me and anyone else in there will be happy to answer any and all questions you have, just take it easy on me since I'm still learning also hehe. --User:Greywind 06:37, 12 October 2006 (EDT)
  • It's a very good idea to hang out on the wowace IRC channel when you're making your first few commits. Commits to the Ace SVN are reported there, and if you're having problems or doing something wrong, people will be able to help you right away.