revlog data redundancy
Benoit Boissinot
bboissin at gmail.com
Wed Oct 7 02:48:14 CDT 2009
On Wed, Oct 7, 2009 at 8:26 AM, Chad Dombrova <chadd at luma-pictures.com> wrote:
> hi all,
> if i commit two revisions of a file, then revert to the first revision and
> commit, mercurial stores that version of the file a *second* time in the
> revlog, even though it's already there. this came as quite a surprise
> coming from git, where each file is only ever stored once, and commit and
> tree objects are used to store various configurations of these files. why
> does mercurial need to store this redundant file data instead of looking up
> the original file? also, am i mistaken in assuming the node hash is supposed
> to be unique for each file? sorry for the newb questions...
The difference with git is that the parent information is included in
the hash. So if the same file is committed at two different time in
the history it won't have the same hash (because the parents won't be
the same). And if it doesn't have the same hash, a new entry is added.
That property allows us to do a very fast "hg log/annotate <file>"
because we don't need to look into every revision of the changelog.
regards,
Benoit
More information about the Mercurial
mailing list