Eric Kow <[email protected]> writes: > The significance of invalidating the index is that the next time > an operation needs to look something up in the index, it will know > that it has to rebuild the index first. Indeed.
>> Yes, I'll double-check that. Basically, the places are: >> - before pristine content changes >> - before pending changes > > Which is where this remark from Petr makes sense. > I didn't check very closely if all the places in the code make sense, > unfortunately. Two potentially missing places are replace and remove: > don't these modify pending? Ok, this needs some clarification. Only two kinds of changes that are in pending are relevant for the index: adds (addfile and adddir) and moves. Ie. replace should have no effect. As for remove, I have just checked what it does, and this will write hunk and rmfile/rmdir patches into pending. Ick. I'd say this has a bunch of problems on its own... We can support it by invalidating the index of course, but I'm not convinced that remove is such a great idea. > So far we have: > * add > * amend-record > * apply > * convert (is it normal that this is happening after the applySome > call? I guess it's pristine.tentative that's being > updated there, and that you're only invalidating the > index prior to creating a new pristine) > * get (before unpulling patches for --tag or --match) > * move > * pull > * record > * rollback > * unrecord and obliterate We have missed revert, which can remove bits from pending and break the index. I'll fix that. > Petr: just in case, it may be worth watching out for these guys too: > > foo_command opts | someFlag `elem` opts = > -- huge thing... > foo_command opts = > -- other huge thing Will check. > Would finalizeRepositoryChanges be a good place for this? Could be, hard to tell. As things are, this would also introduce cyclic module imports. So I'm deferring this for a later stage. > I also notice add_to_pending which could be a candidate Same import problem here, and I'm quite sure this is not used universally (see revert, mentioned above). -- Peter Rockai | me()mornfall!net | prockai()redhat!com http://blog.mornfall.net | http://web.mornfall.net "In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." -- Blair P. Houghton on the subject of C program indentation _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
