How to treat subrepo as normal files?

Mads Kiilerich mads at kiilerich.com
Thu May 26 09:55:44 UTC 2011


On 05/26/2011 11:26 AM, Weijun Wang wrote:
>> A solution for you could be to exclude .hg folders from your rsync (and
>> remove the stale .hg directories from your back repo working directory
>> once).
>
> I'd rather keep the .hg folders in rsync. I have several mq patches
> folders which are very important.

Versioned .hg/patches folders and pushing them to a "backup" repo with 
hg would perhaps be the best solution.

> It's a pity the backup repo cannot
> include them

You can call it that, but if Mercurial could commit .hg folders you 
would (in general) be faced with

1: Functionality issues. Where do you want to commit when you commit 
inside a repo inside a repo? You could define one of them as The Right 
One, but the other would be just as good/bad.

2: Security issues. If other users can modify your .hg/hgrc they can 0wn 
you. (Just as they can if they can modify your Makefile, but that's a 
different story.)

That's why it is the way it is, and if you want to modify it locally be 
careful.

> Maybe I should use git for the backup repo.

Mercurial is a version control tool designed for source code. It can be 
abused as a backup tool but it is not good at it and doesn't try to be 
good at it.

git is more like a versioned user-space file system so it might be a 
better choice for you.

(I just noticed SparkleShare which uses git for this purpose and puts a 
lot of polish on top of it.)

/Mads



More information about the Mercurial mailing list