[darcs-devel] [issue2379] only clone repositories with packs when they are up-to-date

Guillaume Hoffmann bugs at darcs.net
Tue Apr 15 20:47:32 UTC 2014


New submission from Guillaume Hoffmann <guillaumh at gmail.com>:

Packs aim at making repo cloning via HTTP faster. To create packs, the
user must run "darcs optimize --http", which creates packs corresponfing
to the current state of the repository.

When packs get outdated (because of new patches), "darcs get" gets the
packs anyway, and applies the missing patches. The problem is that
outdated packs make cloning *slower* than cloning without packs, since
patch application can be costful.

So I suggest a little change of format and behaviour:

* when creating packs, copy pristine hash to _darcs/packs/pristine
* when getting, compare remote _darcs/packs/pristine to the pristine
hash of _darcs/hashed_inventory
* if _darcs/packs/pristine does not exist, or hash is different, get
normally, otherwise get with packs (function copyPackedRepository2)

Basically this makes darcs clone repository with packs only when they
are up-to-date (modulo pristine hash collision, which can happen, mostly
if the missing patches are tags).

As a bonus, this is retrocompatible with darcs 2.8, but anyway packs
were not enabled by default so I guess we can change them as we wish.

Related:

* <http://darcs.net/Internals/OptimizeHTTP>
* <http://irclog.perlgeek.de/darcs/2014-04-15#i_8592088>

----------
messages: 17352
nosy: gh
status: unknown
title: only clone repositories with packs when they are up-to-date

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2379>
__________________________________


More information about the darcs-devel mailing list