[darcs-users] darcs cannot apply some patch bundles

Owen Stephens darcs at owenstephens.co.uk
Mon Mar 5 17:05:00 UTC 2012

On 5 March 2012 16:18, Michael Hendricks <michael at ndrix.org> wrote:
>Since I'm not yet familiar with Darcs' internal workings, can someone
>help me understand why calculating a minimal context is so expensive?

Because you need to do a whole bunch of commutes - working out which of
the patches in the repository cleanly commute past a given patch.

>Is it because Darcs doesn't have quick access to patch summaries and
>must load every patch, in its entirety, from disk to perform a

Yeah, I think that's pretty much it.

>If that's the reason, is it possible to store patch summaries (like
>"hunk ./src/Darcs/Repository/Merge.hs 83 -1 +1") in the inventory
>files?  To my naive understanding, it seems that many commutations
>could be calculated with just those summaries.

Many, yes, but not all - you'd still sometimes need both, for example
commuting a
replace patch and a hunk (you'd need to know if the replace affected the

e.g. consider commuting p1 and p2, where file1 initially consists of just
"A" and p2 duplicates file1's line:
p1 = replace file1 A B
p2 = hunk file1 2 +B

These commute to
p2' = hunk file1 2 +A
p1' = replace A B

But you wouldn't be able to calculate that, just knowing the summary of p2.
attached a shell script that demonstrates that it works (unpulling the
causes the commute).

In fact, storing a "summary" is what mornfall's GSoC project did for v3
primitive patches, exactly so that in non-conflicting cases, we can commute
hunk-patches *without* loading the entire patch, but that work isn't merged
into Darcs yet...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20120305/36eb4dde/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unpull_replace.sh
Type: application/x-sh
Size: 263 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20120305/36eb4dde/attachment.sh>

More information about the darcs-users mailing list