On 5 March 2012 16:18, Michael Hendricks <[email protected]> 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 *all* 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 >commutation? 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 hunk). 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. I've attached a shell script that demonstrates that it works (unpulling the replace 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... Cheers, Owen.
unpull_replace.sh
Description: Bourne shell script
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
