Lightweight copy

TK Soh teekaysoh at gmail.com
Thu Feb 14 09:25:40 CST 2008


On Mon, May 7, 2007 at 9:59 PM, Brendan Cully <brendan at kublai.com> wrote:
>
> On Sunday, 06 May 2007 at 15:58, TK Soh wrote:
>  > On 5/6/07, Matt Mackall <mpm at selenic.com> wrote:
>  > > On Sun, May 06, 2007 at 02:29:03PM +0200, Guido Ostkamp wrote:
>  > > > > The most recent revision of the file or all the files in the directory
>  > > > > is copied, and it remembers where each file was copied from so that it
>  > > > > can merge changes across file renames.
>  > > >
>  > > > thanks, but this is not what I meant.
>  > > >
>  > > > I just did some experiments. My repository (after removal of working copy)
>  > > > has a size of 442 MB. When I "hg copy dir1 dir2; hg commit" where dir1 has
>  > > > everything in it, then (again after removal of the working copy) the size
>  > > > of the repository has increased to 825 MB.
>  > > >
>  > > > This certainly means that Mercurial does not use lightweight copies.
>  > >
>  > > When you copy a file, a new revlog is created with the new filename
>  > > containing a single compressed revision of the file. If the old file
>  > > only had one revision, then yes, the size will double. If the old file
>  > > had a thousand revisions, it will not.
>  >
>  > I am guessing a significant portion of renames, especially on the
>  > directories, happen as second thought, so there's a good chance that a
>  > lot of files will only contain one revision. It'd be nice if Hg can
>  > somehow create a link info in the new revlog that reference back to
>  > old revlog instead.
>
>  Overlay does some pretty similar work. I think it shouldn't be too
>  hard to adapt it for in-repo backpointers, say by setting another
>  revlog flag in entry 0 and making the inline data be the source name.

Just wondering, has any work been done on this? It maybe the last
major concern I have in the wise-spread use of Mercurial within my
organization, as a large number of files are huge binary files.


More information about the Mercurial mailing list