hg clone doesn't really clone
Nick
t31 at 2thebatcave.com
Mon Aug 10 18:46:57 CDT 2009
I'm trying to setup reliable backups for a mercurial repository. From
what I understand, the best way to do this is to do an "hg clone" of
the repository, and then backup the cloned repository using regular
means.
However, in testing, hg clone isn't true to it's name.
The original repository looks like this at the top level:
# ls -al
total 12
drwxr-x--- 3 apache apache 4096 Aug 10 13:57 .
drwxr-x--- 3 root apache 4096 Aug 10 13:57 ..
drwxr-xr-x 3 apache apache 4096 Aug 10 14:17 .hg
# du -sh .
422M .
However, the "cloned" repository looks like this:
# ls -al
total 59112
drwxr-xr-x 5 apache apache 4096 Aug 10 16:24 .
drwxr-xr-x 3 root root 4096 Aug 10 16:23 ..
drwxr-xr-x 3 apache apache 4096 Aug 10 16:24 .hg
drwxr-xr-x 22 apache apache 4096 Aug 10 16:24 linux-2.6.30.4
-rw-r--r-- 1 apache apache 59416037 Aug 10 16:23 linux-2.6.30.4.tar.bz2
drwxr-xr-x 2 apache apache 1028096 Aug 10 16:24 lots-of-files
# du -sh .
872M .
It seems to be adding in an extra "working" copy of the files in the
repo. Is there any way to get a real clone? It seems silly to waste
space in this fashion. I could do the clone and then manually delete
the files at the root, but that seems really stupid and inefficient.
If sheep were cloned in this way, the resulting sheep would end up
with a couple of extra legs coming out if it's head and would probably
be put down.
More information about the Mercurial
mailing list