My original problem is that I have a directory where I write various scripts. Each of them is independent of others, and usually one-file-long. I want to have some versioning ap
You can create multiple hidden repository directories and symlink .hg
to whichever one you want to be active. So if you have two repositories, create directories for them:
.hg_production
.hg_staging
Then to activate either of them just do:
ln -sf .hg_production .hg
You could easily create a bash command to do this. So instead you could write something like activate-repo production
, which would run ln -sf .hg_production .hg
.
Note: Mac doesn't seem to support ln -sf
so instead you'll need to do:
rm .hg; ln -s .hg_production .hg