Hi Petr, Here's one quarter of the review.
The remaining quarter in the high-level half is marked with TODO.
The low-level half (understand Darcs.Gorsvet) is also still open.
-------------------------------------------------------------
Import relevant bits of gorsvet, for now under Darcs.Gorsvet.
-------------------------------------------------------------
> > + hashed-storage
I see you have put hashed-storage on hackage (thanks!). Is it safe for
build slave owners to rely on hashed-storage 0.2 for this current patch
bundle?
Please remember to version this before we release darcs.
----------------------------------------------------------------------------
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...)
> invalidateIndex _ = do
> BS.writeFile "_darcs/index_invalid" BS.empty
Applying this would be harmless as far as backward compatibility is
concerned, but it would be a good idea to verify that the places really
are the right ones, and ideally if that we haven't missed any.
-------------------------------------------------------------------------
Use index for diffing in the basic whatsnew scenario.
Pass options to unrecordedChanges and handle LookForAdds and IgnoreTimes.
-------------------------------------------------------------------------
TODO: the job here is to see what Darcs.Gorsvet.unrecordedChanges does
at a high level.
I've manually coalesced these two patches together in my reply...
> > hunk ./src/Darcs/Commands/WhatsNew.lhs 140
> > (do slurps <- slurp_recorded_and_unrecorded repository
> > warn_if_bogus slurps files
> > putStrLn $ "What's new in "++unwords (map show files)++":\n")
> > - changes <- get_unrecorded_in_files repository (map sp2fn files)
> > + changes <- unrecordedChanges opts repository (restrict_subpaths files)
For the interested, there is the relevant bit of Darcs.Gorsvet to be
reviewed.
> unrecordedChanges :: (RepoPatch p) => [DarcsFlag] -> Repository p
> -> (Tree -> Tree) -> IO (FL Prim)
> unrecordedChanges opts repo restrict_ = do
> checkIndex repo
> slurp_pending repo -- XXX: only here to get us the "pending conflicts" check
> -- that I don't know yet how to implement properly
> pristine <- readDarcsPristine "."
> Sealed pending_patches <- read_pending repo
> (res, current') <- virtualTreeIO (apply [] pending_patches) pristine
> let current = {- restrict -} current'
>
> working <- case (LookForAdds `elem` opts, IgnoreTimes `elem` opts) of
> (False, False) -> (restrict_ `fmap` readIndex) >>= unfold
> (False, True) -> do guide <- unfold current
> restrict guide `fmap` readPlainTree "."
> (True, _) -> filter nodarcs `fmap` readPlainTree "."
> ft <- filetype_function
> diff <- treeDiff ft current working
> return $ sort_coalesceFL (pending_patches +>+ diff)
> where nodarcs (AnchoredPath (Name x:_)) _ | x == BS.pack "_darcs" =
> False
> nodarcs _ _ = True
--------------------------------------------------------------------------------
Extend the weird filenames part of the whatsnew test to cover indexed filenames.
--------------------------------------------------------------------------------
> > hunk ./tests/whatsnew.sh 31
> > - darcs whatsnew > log
> > - not grep "no changes" log
> > + darcs whatsnew | tee log
> > + grep 'hunk ./\\92\\' log
> > fi
> >
> > hunk ./tests/whatsnew.sh 35
> > +echo foo > "foo bar"
> > +darcs add "foo bar"
> > +darcs wh | tee log
> > +grep 'hunk ./foo\\32\\bar' log
> > +
> > +# check that filename encoding does not botch up the index
> > +darcs rec -am "weird filenames"
> > +not darcs wh
> > +
This is also relevant to current darcs, so I'll apply this straight
away.
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
