In an effort to fix my current failing workflow, I’m trying to really learn how to use Mecurial well. My main problem is that I’m fixing a whole bunch of bugs that cluster in a set of files, and the changes are sometimes dependent, sometimes not. I’ve had to resort to hand editing diffs and other tricks that are causing Chris Tyler to shake his head at me.
So I’m reading the hg-book, and a bunch of other sites recommend by my hg-elders: Jason Orendorff, Ben Hearsum, Ted Mielczarek, and Benjamin Smedberg. It’s been interesting to spend some time really getting to know it, and I’m already more productive.
Here’s an example, albeit a simple thing (that’s what you learn by taking your time, the simple things). If you have a clone on disk, you can clone it again and hg will use hard links and copy-on-write to save you space (important with a mozilla hg clone). So, if you want to do something dangerous to your existing repo, you can clone it like so:
$hg clone existing-repo new-repo
Now you have hard links back to your existing-rep, and only when you make changes in new-repo is a new file created. It’s a cheap way to try something and not worry about killing your repo.