[darcs-users] darcs patch: Import relevant bits of gorsvet, for now... (and 16 more)

Eric Kow kowey at darcs.net
Sun May 31 15:52:24 UTC 2009


One more eight of the review!
I've applied the bulk of the patches and this one below.
I still need to look at the whatsnew patches when I get home

On Wed, May 27, 2009 at 19:39:21 +0200, Petr Rockai wrote:
> > ----------------------------------------------------------------------------
> > Invalidate index at key positions in relevant (pristine-modifying) commands.
> > ----------------------------------------------------------------------------
> > TODO (still)
> >
> > This adds calls to Darcs.Gorsvet.invalidateIndex in strategic places.
> >
> > Darcs.Gorsvet.invalidateIndex creates a file called 'index_invalid', the
> > presence of which presumably is used by hashed-storage to indicate that
> > the index is invalid... (which means...)

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.

> 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?

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
 
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

> I will look around in the library, whether there's a more suitable place than
> in the commands themselves (but I'm a little worried that one of the commands
> will bypass the canonical code path, since this happens relatively often in
> darcs).

Would finalizeRepositoryChanges be a good place for this?
I also notice add_to_pending which could be a candidate

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090531/5866ac6a/attachment.pgp>


More information about the darcs-users mailing list