> >> [...] next a similar pattern applies to the "normal" part of the > >> update (everything it does after "restore"). Obviously we need the > >> normal part of update > > > >Yes, but for the "deltas" part of update we already mostly DTRT, don't we? > > > >- If the file is not modified, [...] > > > >- If the file is locally modified, then by design, we need to end up > > with a pristine for it. Right now we'll download BASE, and then > > [...] What am I missing? > > You're missing the case where the file is locally modified, and is in > the tree scope of the update request, but no update is found in the > repo. Currently we download its base before executing the business > logic of update, so before we know that we're not going to need the > base to complete this update request.
But that's exactly the branch's invariant, isn't it? [[[ The core idea is that we start to maintain the following invariant: only the modified files have their pristine text-base files available on the disk. ]]] So, if the file is locally modified, and we download its base, we cause the file to meet the invariant. I don't see how that's a problem, unless we download a base we already have, or discard the base rather than keep it. I suspect I'm still missing something. Cheers, Daniel