Mercurial is a distributed revision control system which runs on linux, windows, solaris, aix, freebsd, netbsd, openbsd and os-x. It’s known to be easy to use and easy to extend. It’s opensource and licensed under the GNU GPLv2. It’s very lightweight and suitable for lone programmers as well as for big projects. Acceptance is good and big websites like sourceforge and Google projects are already offering mercurial to their users.
Setting up this on a debian based distribution is easy:
apt-get install mercurial
Check if it’s running and which version:
Create a directory “projects” in your home e.g. and change to that directory.
Now issue the following command:
hg clone https://inactiveredirect.googlecode.com/hg/ inactiveredirect
You will now have a local copy of my source tree of “inactiveredirect” on your disk…”inactiveredirect” is a small wordpress-mu plugin I wrote. Don’t mind.
Make a change to the file “inactive_redirect.php” and issue the following command:
And you will get something like this:
andreas@andreas-laptop:~/projects/inactiveredirect$ hg status M inactive_redirect.php andreas@andreas-laptop:~/projects/inactiveredirect$
Where “M” stands for “modified”.
To see what we’ve modified exactly:
diff -r d7678156af03 inactive_redirect.php --- a/inactive_redirect.php Fri Oct 16 13:30:15 2009 +0200 +++ b/inactive_redirect.php Fri Oct 16 16:44:46 2009 +0200 @@ -1,6 +1,6 @@ This is the output and lines with a prefixed "-" show you the state before and lines prefixed with a "+" show you the new state.
To commit the changes:hg commit -u "firstname.lastname@example.org"
Your change will only be local. To push it back to the server you have to “push” it:hg pushYou will be prompted to enter your username and password. The username is your gmail email and the password is that from this site.
Your changes will be published.
If you haven’t cloned before, you can push your files via: site.