[darcs-users] darcs patch: Simplify build dependencies: put is_tag ... (and 2 more)

Eric Kow kowey at darcs.net
Tue Dec 9 09:46:42 UTC 2008


On Mon, Dec 08, 2008 at 23:40:37 +0100, florent.becker at ens-lyon.org wrote:
> Mon Dec  8 11:23:57 CET 2008  florent.becker at ens-lyon.org
>   * Simplify build dependencies: put is_tag in Patch.Info

I've applied this one, but I have a request for the second patch (which
by dependencies, affects the third patch)

> Mon Dec  8 22:36:58 CET 2008  florent.becker at ens-lyon.org
>   * some cleaning in progress.hs, move it to src/, split darcsish bits
>   Split src/Darcs/Progress.hs into:
>   - src/Progress.hs for the general functionalities, might be worth releasing
>   outside darcs proper
>   - src/Darcs/ProgressPatches.hs for the darcsish stuff, progressFL and progressRL
>   
> 
> Mon Dec  8 23:36:24 CET 2008  florent.becker at ens-lyon.org
>   * resolve issue1165: tag feedback for progress in get
>   Make darcs get print the following as its progression indicator:
>   42/1664 back to: TAG ada strawberry
>   Where "ada strawberry" is the most recent tag that was effectively fetched.
>   This makes it easier to know when to hit Ctrl-C

Simplify build dependencies: put is_tag in Patch.Info
-----------------------------------------------------
This moves is_tag from Patch.Depends to Patch.Info which seems to make
sense.

some cleaning in progress.hs, move it to src/, split darcsish bits
------------------------------------------------------------------
One objection: could you do the darcs replaces less invasively?
Surely you can ask the shell to give you a list of files that
mention Darcs.Progress and only do darcs replace on those?

Maybe that grep foo | xargs darcs replace foo bar idiom should
be documented somewhere.

I realise this breaks the following patch and I apologise for the
inconvience :-(

[ah, if only we had darcs transplant already!]

resolve issue1165: tag feedback for progress in get
---------------------------------------------------
> +-- | Evaluate an 'RL' list and report progress. In addition to printing
> +-- the number of patches we got, show the name of the last tag we got.
> +progressRLShowTags :: String -> RL (PatchInfoAnd p) C(x y)
> +		   -> RL (PatchInfoAnd p) C(x y)
> +progressRLShowTags _ NilRL = NilRL
> +progressRLShowTags k (x:<:xs) = if l < minlist then x:<:xs
> +                                       else startit x :<: pl xs
> +    where l = lengthRL (x:<:xs)
> +          startit y = unsafePerformIO $ do beginTedious k
> +                                           tediousSize k l
> +                                           return y
> +          pl :: RL (PatchInfoAnd p) C(x y) -> RL (PatchInfoAnd p) C(x y)
> +          pl NilRL = NilRL
> +          pl (y:<:NilRL) = unsafePerformIO $ do endTedious k
> +                                                return (y:<:NilRL)
> +          pl (y:<:ys) =
> +              if is_tag iy 
> +              then finishedOne k ("back to "++ just_name iy) y :<: pl ys
> +              else progressKeepLatest k y :<: pl ys
> +                  where
> +                    iy = info y

I don't understand the progress reporting code in general yet.  Maybe
you can explain the basic principle here?  My guess we just march
forward as usual, updating the counter at each patch, and if the patch
happens to be a tag we spit out the tag name.

The wording 'back to' might be a bit confusing.  Maybe it's worth
checking with #darcs for an alternative?

-- 
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/20081209/f84b0f59/attachment.pgp 


More information about the darcs-users mailing list