4th November, 2007

An approach to revision control your documents using Mercurial   

Posted in random | by evilbitz |



This post describes how to control documents revisions under Windows. Warning - it involves the use of command line. I take it for granted that the average Linux guy will manage on his own.
I want to share something that I just recently did, I find it really useful - I put all the “My Documents” directory under local revision control. What it gives you? basically, an easy way to track changes inside documents. If you have, like me, thousands of documents that are continually evolving (I’m talking about the annoying Document History section…) and many different versions of each document, instead of renaming them and creating local copies I’m now using mercurial in order to put them under a revision control.

Mercurial is a “a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects”, according to the website. It means that there is no central server and each user working on the project has a local copy of the whole repository on disk. The most important word in that sentence is “lightweight”.

So, after you downloaded Mercurial from the link above, create a directory under “My Documents” and name it whatever you would like to. Now, from the command line, cd into that directory and execute hg init, this will create a repository in that directory, every change could be tracked by executing hg status when you have a finalized version of the document that you want to take a snapshot of, execute hg commit -m “[Revision description goes here…]”

That’s pretty much it, if you want to see the document history of each commit, execute hg log and see the details of each revision along with the comments you supplied.

But really, Mercurial is a powerful tool, you can read all about it here.

Digg!


There are currently 2 responses to “An approach to revision control your documents using Mercurial”

Why not let us know what you think by adding your own comment! Your opinion is as valid as anyone elses, so come on... let us know what you think.

  1. 1 On November 4th, 2007, lorg said:

    I like the idea of putting your documents under source control. The idea itself is more interesting than the technical details of the implementation.

    Cool thinking!

  2. 2 On November 5th, 2007, evilbitz said:

    Thanks,

    Actually, I guess that the idea is not that new, and there are probably commercial product that are doing exactly that. It is a good working practice though.

    I posted this method because it is free and accessible for everyone. It is also easy if you are comfortable without GUI.

Leave a Reply

Top »
"If you can't join them, beat them!"
Search Evilbitz: