Friday, September 28, 2007

Version Control Tip


Heres a problem I came across recently. The Unit tests for my current project are certified working on my desktop. But the build machine runs the test scripts and runs into a bunch of failures. Looking into it its become clear I haven't tagged something with the 'build' tag so the ant scripts aren't checking it out.

Now arguably we shouldn't need a build tag ("why would you check in code that you didn't want to build?") but to use one of my favorite pieces of office-speak 'we are where we are'.

So how do I track down the rogue untagged files? Do I try to recall which files I changed between builds? Sounds like a bit too time consuming and error prone for my liking.

Lest allow cvs do the work instead (in my case tortoise cvs my weapon of choice when dealing with CVS, its windows integrated so I don't have to switch contexts).


1. Simply Checkout a copy of your projects HEAD (or branch) into a sandbox ( or just the relevant package in your code if your codebase is to sprawling as to make checking everything out non-trivial).

2. Then Update your sandbox specifying the build tag.

3. As your cvs client performs the updates you will see a list of files which are being changed. these files will be the ones whose tags are not set to the latest on the HEAD/branch (i.e the ones you're looking for.

p.s. As you can see from the screenshot above, Tortoise has an option to simulate the update, so you can do it from within your workspace without fear of making any changes. I believe command line has the same option but a quick google isn't revealing it to me.

No comments: