Author Topic: Svn Server  (Read 7002 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Svn Server
« on: September 18, 2008, 08:58:47 AM »


Edit: There is now a Git server available. See http://forum.outpost2.net/index.php?showto...indpost&p=75209 for details.




SVN - Subversion, used for source code/revision control. Great for sharing code between developers.

I've been saying we should use something like SVN for a while, and figured I'd finally get off my butt and setup a server. You're all welcome to use it if you want. It's set to world readable, so anyone can download off of it. You need an account for write access though. Let me know if you want to write to it or update things in it, and I'll set you up with an account. Just keep in mind the public nature of it. Anything put on there is pretty much the same as posting it to the forums.

Now this is great for me, since it sits at a static IP on my local network, but not quite so great for you guys though, since my external IP is dynamic. Mind you, it usually doesn't change for months at a time. Perhaps someday we'll convince someone with a static IP to setup something like this (and host the net fix game server). For now, this is running on the same machine as the game server.


Btw, this would be really good way to exchange code that you need help with. Put the code into the repository, post for help on it, and other programmers can checkout your project, make changes, and checkin the changes. Then you can just update your local copy with the changes. It's also possible to do diffs with previous versions, so you can see exactly what changed.


To get an SVN client, I recommend Tortoise SVN, which you can get here:
http://tortoisesvn.tigris.org/
Or, just right to the download page:
http://tortoisesvn.net/downloads

Tortoise SVN is a Windows shell extension. You can just right-click on folders on your computer and select the appropriate action from the context menu.


You can find the Respository (currently) at this address:
svn://68.146.111.58/outpost2/


The repository doesn't have much in it right now. For now I just put a current copy of the Forced Exports project into it. Here's what it looks like from the Repository Browser.



Typical Usage
Repository Browser: You can view the repository by right-clicking pretty much anywhere in Explorer (not IE, just Windows Explorer) and going to TortoiseSVN -> Repo-browser. Enter the URL (svn://68.146.111.58/outpost2/) and click ok.

Export: Export lets you get a copy of a subtree from the repository. This is most suitable if you don't intend to commit any changes. (You're just leeching the file). Choose TortoiseSVN -> Export..., and then enter the Repository URL of the subtree you'd like to retrieve. You can click on the "..." to open the Repository Browser to select the right folder. You probably want to do this into a new empty folder. It defaults to storing the local copy in whatever folder you've right-clicked on, or had selected when you opened the context menu.

Checkout: Checkout lets you get a "working copy" of a subtree from the repository. This is what you need to do if you intend to submit changes. (You're also free to use this option if you're only leeching, as it in no way locks out anyone from getting or changing files on the server). Checkout creates an extra .svn folder in each of the checked out folders. This extra .svn folder contains a cached copy of each of the files that were checked out. This lets the client do a diff (compare) of the last checked out version of the file with the current working copy, so when changes are submitted to the server, only the difference needs to be sent rather than the whole file. This can save a lot of time for commits of large files. It also lets you revert any changes you make without needing to contact the server, which is particularly convenient if you're no longer connected to the internet. Checkout works pretty much the same as the Export option, except you just select the "SVN Checkout...".

Update: Update lets you download changes to a working copy. You must have already run Checkout to see this option. It is only available on checked out folders. If you check out a copy, and then someone submits a change to the server, you can run Update to download a copy of the change. The change is sent as a diff from your last checked out version, so it should run fairly fast for small updates, even on large files. If you changed the same local file that was updated on the server, then you will be informed of this. It won't just overwrite your local changes.

Commit: Commit (aka checkin) lets you submit changes from your working copy to the server. You must have already run Checkout to see this option. It is only available on checked out folders. Note: You need to have write access to do this. The server I set up requires a login name and password before you can run a commit.


Diff: To see a list of changes between revisions of a checked out copy, by choosing TortoiseSVN -> Revision graph, and using Ctrl+click to select the two revisions you want to compare, and then right-click to see a menu of possible compare options.


If you take turns editing files, that's all you'll need to know. If two people work concurrently on the same file, then there are a few more things you'll need to know regarding Conflicts and Merging. You can check the help file or the Subversion book (see below) for details on how to handle this.


For More Information
The official SVN site is here: http://subversion.tigris.org/ (SVN server download, and a command line client)  (You guys don't need this)
The Subversion book can be downloaded in multiple formats here: http://svnbook.red-bean.com/ (but again, you don't really need it, since this is basically included in the Tortoise SVN package). (It's a good book too).
« Last Edit: April 23, 2011, 01:20:20 AM by Hooman »

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3237
Svn Server
« Reply #1 on: September 18, 2008, 11:56:05 AM »
Excellent!  Good job, Hooman.  Now I can steal all your source code! Mwahahetc (yeah, as if I know how to do anything with it!  Maybe I can look at it and learn, or something).

Seriously though, this will be good for "team" projects that involve the entire community.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline vennom

  • Jr. Member
  • **
  • Posts: 73
Svn Server
« Reply #2 on: September 18, 2008, 04:25:16 PM »
i still think hooman made Op2... lol.... (he knows everything o.o!)

hehe and nice idea the SVN ^^

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Svn Server
« Reply #3 on: September 24, 2008, 12:11:50 AM »
Well, I'm loving the SVN, so I decided to throw up a few more projects on there. Nothing too exciting. Mostly stuff that is available elsewhere, although a few may be first time releases. (Small calculational tools that I probably posted about, like the population simulator). There is also some source code for decompressing .vol files.

Oh, and I copied the SDK-v2 stuff into there. If anyone wants updates to the SDK, now would be a good time to request them.
 

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Svn Server
« Reply #4 on: September 24, 2008, 02:23:44 PM »
Nice work.

Are we gonna get this up on the web server?

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Svn Server
« Reply #5 on: September 24, 2008, 03:16:10 PM »
BlackBox said something a while ago about trying to get an SVN module to work with Apache, but I haven't heard anything since. I hear setting that up is a real pain though, and it's a bit slower than the native SVN protocol with svnserve (which is really easy to setup).

I don't think svnserve could be used on the webserver as I heard most ports are blocked. I believe that was one of the reasons for using the Apache module, because it would all work over port 80.

Anyways, speak to BlackBox about that.


Plus, there is another reason to not bother moving it at the moment. Aside from a bit of stuff from Hidiot and Sirbomber, it's mostly me using this thing at the moment. As such, I like having it on my LAN where the connection speed is nice and fast. :)