Exporting only changed files from SVN

At work we've got a number of large projects that have a considerable number of very large binary resources that we manage under source control with SVN.

The problem we have is that some of the legacy projects have resource in folders underneath the code base rather than outside of the code base. This makes it difficult to update just the code from an export of a tag. This is exacerbated by the fact that the large resources are binary, so we can't patch using an svn diff.

For some time now I've been looking for a means to get a diff, pick up the files that have changed or added and export only those files into an appropriate directory structure that I can easily drop into place.

I finally have one!

[More]

Eclipse, Mylyn and Trac 0.11

My first post for ages! Sorry about that....

Something quite exciting, that I've had a crack at fixing myself, but the combination of my poor java and python skills has prevented me from completing this adequately. However, the combined skills of the trac developers and the development team for Mylyn and the Mylyn Trac connector have managed to combine to finally provide the highly awaited Mylyn, Eclipse and custom Trac workflow integration!

[More]

Blog Round #5

 

This week I wrote the round-up in ScribeFire and posted up to Mango Blog.  Only flaw in the plan is I have to remember to manually add an excerpt to the top of the round-up and double check the categories.  (I just noticed that ScribeFire/MangoBlog some how dropped some of my selected categories)

This weeks round-up has ended up with 3 distinct threads, Source Control and all that goodness, ColdFusion frameworks and Open Bluedragon updates.

So lets crack on...

Subversion Branching Preso Online
Sean Corfield has posted his SVN Branching presentation from A Wee Dram.  I didn't make it down for the one day event and would have liked to have seen this presentation, but having read through Sean's presentation it looks like I work with svn the same way as Sean anyway!  Alway nice to know you aren't completely insane! ;)

While I'm adding an svn related link - here's another Terry Ryan has created an unfuddlecfc to help with backing up their svn hosting at unfuddle.com

Also, if you're hosting your own SVN/Trac installations and you're using TOCMacro on your trac environment you need to upgrade this plugin. Take a look here for why : Trac sporadic hang solved

Well this round-up seems to be taking a bit of a source control and ticketing theme to it, so here's another related post! Ray Camden has released a much updated Lighthouse Pro 2.5

Moving on from source control and bug tracking - Congrats to Mark Mandel for his first post on Adobe Devnet with his An Introduction to ColdFusion frameworks article. Even if you know what CF frameworks are out there, this provides a neat summary of the general features and design patterns behind each of them, as well as helping provide a clear distinction between MVC frameworks, dependancy injection and data persistence. 

For more information on frameworks, while Sean Corfield was over in the UK for A Wee Dram he also gave a "Design Patterns" presentation at the Devon CFUG and Tom Chiverton will be presenting on ColdSpring for the ColdFusion Meetup Group on the 16th of October.
It would seem that  my round up this week has some very definite threads!  The next blog post of interest is also on ColdSpring! Scott Stroz has a interesting post on using Coldspring Interceptors with Remote Proxies.

Moving away from frameworks, Matt Woodward has posted a couple of updates on what has been going on with Open Bluedragon. Lots going on with Open BlueDragon and Digging Deeper into the Java Underpinnings of Open Bluedragon

And finally, to end on a humours note - take a look at a slice of life at Alagad and Andy Jarrett's Friday Joke.

Getting started with Subversion

Yesterday I was having a conversation with a recent convert to source control. He had a few questions and I thought the answers might be useful to other people. So here are the questions and answers with a bit of paraphrasing.

Q) I have just install visual SVN on my server and I am try to add all my sites to the repository. I do an import, then do a checkout to create the working copy over my original files, but it doesn't work, gives errors that the folders already exist.

I'm using Tortoise.

A) With Tortoise you'll need to delete or move the original files before you can check out the project into that location.

I was talking to a ColdFusion Developer so I asked if he was using Eclipse/CFEclipse. He is, so I pointed him at Subclipse and Subversive

Both of these are SVN plug-ins for Eclipse. Some people prefer Subversive over Subclipse. Personally I have no preference - I have a few different installs of eclipse and I'm using both in different places. You can't use both of them at the same time in the same client - its one or the other.

There are a number of immediate advantages to using one of these plug-ins.
The first one is that your svn client is integrated into your development environment, which makes your work flow easier. No need to go to an external client to check for updates or commit your changes and you can see there in your project which files you've changed recently.
Secondly,when you want to set up a development project in SVN, there is an option to "Share" your project. What this does is submits your project into your svn repo and also sets up your working copy as a "checked out".
Another advantage if you're using subversive, which helps with his first question/problem. If you have a project in svn and you have a project that already exists, subversive will ask you if you want to overwrite the existing project. This takes out the step of having to move or delete your existing working copy. (NOTE: Subclipse might do this as well - I just can't remember right now)

The next question was :

Q) So the eclipse plugin will commit my files every time I save?

A) I think you can tell it to do that, but I tend not to.

I would now like to retract this answer.... ;)
I've had a look at the docs for both subversive and subclipse and I can't see any way that you can do a "commit-on-save". Thinking about it I'm not sure you really want to be committing on every save anyway, unless you're doing something like extreme programming.

This lead on to :

Q) So what if you find out you messed up a file the last time you edited it and you didn't commit? Eclipse has some sort of basic rollback doesn't it?

A) There is local history built in to eclipse. From the right click menu, you can compare a file with a version in the local history or replace the file with a local history version.

I wanted to make sure that he was using svn in a way that would help him in the future as well as immediately, so I gave him this summary of how to use trunk, branches and tags. I know that this won't be the way that every one uses trunk, branches and tags, but this is one way that makes sense. So here's my summary :

Just a quick summary of tags and branches for you....
  • Trunk is pure development - new features - new version
  • Branches are live version which you should only do minor feature enhancements and bug fixes
  • Tags are fixed releases that are NEVER edited.

Q)So trunk is my working version. Branches would be like beta releases, and Tags would be final releases.

Say you have a released product at v1.01 and you're currently working on v2.
Trunk would be alpha/beta releases of v2
Branches you would have a branch called something like v100 which is a released version 1.00
In tags you'd have v100 which is the release at version 1.00, but you would also have v101 which is the released 1.01 version.

When you release v2 you'd copy it to a branch called v200 and create a tag called v200 - bug fixes for version 2 would now go into your v200 branch and version 3 development would occur in trunk.

The naming is up to you - the suggestions I used were just to give an idea of how to use branches and tags.

Well I hope that that is useful to someone else.

SVN set up for idiots

Ok - so maybe not for idiots. Anyone that wants to use SVN for source control can't be all daft.... ;)

I've used SVN and Trac in the past with other peoples projects, but having seen Andy Allan's post on setting up Trac on windows and then listening to the guys at ColdFusion Podcast doing their schpeel on SVN I decided that it was time I sorted out my own SVN server for work.To start with I got thoroghly distracted by the big blob of yellow text on the binary packages page on the SVN site that says that the SVN client works on windows, but the server doesn't. Then I got distracted by the SVN FAQ that also says that SVN Server doesn't run on windows and talks about the Apache Portable Runtime. All this had Andy giving me weird electronic looks via google talk and asking me wtf I was talking about! All I had to do was install SVN and Apache and that was it!

I should mention that I asked Andy about SVN 1 Click Set up - his response was fairly to the point and suggested that blunt instruments would be used about my bodily-person if I used it, because it sets up SVNServe which can cause concurrency issues and Apache is better anyway.

So I resorted back to Google and came up with this article! HOWTO: Subversion for Windows with Apache server - a beginner's guide. This article is very good. It provides all the information you need to get up and running, including setting up users, permissions and backing up your projects, as well as providing a direct link to the SVN windows downloads.

I used the svn 1.3.2 setup exe and that worked fine for me.

The next task was to get my existing project into SVN. Eclipse 3.2 with subclipse didn't seem to have a means to put an existing project into a repository or at least no clear means of doing this. I've used TortoiseCVS before, so I grabbed TortoiseSVN and installed that. Annoyingly Tortoise asks you to restart at the end of installation, but you can quite happily ignore that and it'll work anyway.

TortoiseSVN attaches itself to the right-click menu providing you a bunch of SVN tools for folders and files. For a folder that isn't already associated with SVN there are only a couple of options - one of those options is "export". The export function allows you to specify an svn repository and folder and export the content to that repository. So thats exactly what I did!

I made sure I had my trunk, branches and tags folder made in my project's SVN repository, selected my existing project and then exported its content to the trunk folder.

The last thing I had to so was get eclipse to synchronise with SVN.

Under SVN Repository Explorer I added the url for the project's repository, right-clicked on the trunk folder and then selected "checkout". I was then prompted to create a new project or to select an existing project. I selected my already existing project.

Now - something slightly scary happens.... You get prompted to delete the existing project content. As long as no one has edited any of the files in your project since you put them into the repository this is fine - all your files get replaced with the exact same files from SVN.

My project is pretty small at the minute, so its not like it had to replace a vast quantity of files. You might also want to download the SVN version into a new project and move/remove the existing project yourself.

There's probably an easy way to put your eclipse project that I've completely missed without all this messing. If anyone knows, please drop me a note.

Next job is installing Trac from Andy's blog entry.