Quake3World.com Forums
     Programming Discussion
        Subversion experts?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Subversion experts?

god xor reason
god xor reason
Joined: 08 Dec 1999
Posts: 21100
PostPosted: 01-12-2010 07:37 AM           Profile   Send private message  E-mail  Edit post Reply with quote


We've started to use subversion for side projects here at work and are trying to figure out whether to make the jump to TFS or subversion (or maybe even something else). The problem we've got with subversion is that even with as little as two people working on the same project, we're having instances where the last person to commit of the two just erased the other person's work. It is also rather annoying when you're pulling a copy out of subversion to update the server and you end up with the main file full of merge tags and three or four versions now sitting in the folder.

Clearly, we're not doing it right. How do large projects manage subversion?




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 01-12-2010 12:43 PM           Profile Send private message  E-mail  Edit post Reply with quote


1. Always run `svn update` before you start hacking on a file.
2. Use `svn export` to create the production build (and test it on a staging server first).

It also pays to learn branching and merging - `svn copy` and `svn merge` - so you can hack away at your experimental features while your co-workers maintain the trunk.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 01-12-2010 12:46 PM           Profile Send private message  E-mail  Edit post Reply with quote


And a corollary to #1: don't do stupid things like changing the indentation of whole files just because you feel like it. That way lies conflict hell and your co-workers will hate you for it.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 01-12-2010 02:32 PM           Profile Send private message  E-mail  Edit post Reply with quote


And on the subject of commits:

1. Commit often. Reduces the chance of conflicts.
2. Commit little (as in: small changesets). Makes it easy to roll back bad changes and helps in tracking and visualising the evolution of your code base.

Rule of thumb: one commit, one change.




Top
                 

god xor reason
god xor reason
Joined: 08 Dec 1999
Posts: 21100
PostPosted: 01-13-2010 07:28 AM           Profile   Send private message  E-mail  Edit post Reply with quote


Makes sense, thanks. So you're saying use trunk for the more stable code and branch off for heavy dev work? We do essentially the opposite with VSS6 right now. We have one solution that is the main dev code and then whenever we're going to update production, we copy that code over to a "patch" solution that only gets touched if it is an approved bug fix.

I didn't know VSS2005 was on the table so it looks like we're going with that as long as the web access doesn't suck.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 01-13-2010 12:27 PM           Profile Send private message  E-mail  Edit post Reply with quote


Yep. Branch when you are doing experimental or major overhaul stuff and merge it back into the trunk when it has matured.

It sounds like you are already doing this (the 'copy to patch' bit) but create a branch for each major release and declare it immutable safe for show-stopper bugs. The trunk is for maintenance, the release branches for back-porting bug fixes to.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 01-13-2010 12:31 PM           Profile Send private message  E-mail  Edit post Reply with quote


On the topic of VSS: viewtopic.php?p=786403#p786403

Just to illustrate how awful it is: even Microsoft, a company renowned for eating its own dog food even when better alternatives exist, doesn't use VSS internally. That's saying something, innit?




Top
                 

god xor reason
god xor reason
Joined: 08 Dec 1999
Posts: 21100
PostPosted: 01-21-2010 01:10 PM           Profile   Send private message  E-mail  Edit post Reply with quote


Turns out we're going with subversion next week. Should be interesting as we're also converting the entire solution from NET1.1 to NET3.5.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 01-21-2010 01:27 PM           Profile Send private message  E-mail  Edit post Reply with quote


Let me know how that works out for you. Couple of years ago, I converted a 20,000 line C# project from 1.1 to 2.0. Went fairly smooth, no major obstacles.




Top
                 

god xor reason
god xor reason
Joined: 08 Dec 1999
Posts: 21100
PostPosted: 01-22-2010 09:35 AM           Profile   Send private message  E-mail  Edit post Reply with quote


I've done the conversion a couple times now. It compiles and runs but there are some things that simply don't work anymore. We had a guy test the entire app and it all seems pretty minor. I'm so pumped to not have to use VS2003 in Windows 7 anymore.




Top
                 

god xor reason
god xor reason
Joined: 08 Dec 1999
Posts: 21100
PostPosted: 03-12-2010 10:44 AM           Profile   Send private message  E-mail  Edit post Reply with quote


Is there a way to have a file be part of a repository, but never update locally? We have server specific files that shouldn't change. What I'm doing right now is putting an ignore on the files and checking in example.X.X.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 03-13-2010 06:03 AM           Profile Send private message  E-mail  Edit post Reply with quote


That's about right. I usually solve this with Maven profiles (Maven = Java build tool) where each profile corresponds with a run-time environment (dev, test, prod).




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.