[GSoC] lightweight copies

Vsevolod Solovyov vsevolod.solovyov at gmail.com
Wed Jul 8 11:56:20 CDT 2009


Hi all,

What is done [1]:

- new flag in requires file

- lightweight copies are packed and unpacked correctly

- all hashes are calculated correctly

- new and old version can inter-operate, but there are some fallbacks
and bugs (wrong data get stored in cache). Really, it's about adding
delta groups.


What needs to be done:

- fix bugs in adding delta groups

- design and implement new part of wire protocol (that was announced
by Matt for 1.4 release). It will be responsible for interaction
between new versions.


Details of work and some design decisions:

Flag in requires file: I thought hard about it and have chosen
"lwcopy", because it is much shorter than "lightweightcopies" and more
meaningful than "copies"/"copy"/"rename"/whatever.

Lightweight copies itself are indicated by the additional entry in
metadata ("lwcopy": 1). Hence, repository can have mixed copies -
full-weight and lightweight. Copies were stored in revlogs as
"metadata + full text", now they are stored as "metadata + delta". If
you only copy/rename file and don't change it's content, then delta is
empty and only metadata is stored.

When you try to get revision (even with metadata, i.e. you don't use
filelog.read()), filelog will return the same text as it would in old
version, there will be no "lwcopy" entry in metadata. I think that
it's even worth to move adding of "lwcopy" to dict from
localrepository to filelog code.


[1] Here is my MQ: http://bitbucket.org/Murkt/hg-lwcopy-mq/ . Few last
patches are a subject to change.

-- 
Vsevolod Solovyov


More information about the Mercurial-devel mailing list