[darcs-users] unrecord --matches and --patches (was: Re: Feature Request: darcs unrecord --all)

David Roundy droundy at abridgegame.org
Sun Feb 27 13:36:16 UTC 2005


On Sat, Feb 26, 2005 at 06:49:57PM +0000, Jamie Webb wrote:
> For revert, the summary should presumably look like whatsnew -s. For
> unpull/unrecord, should it run annotate -s for each patch, or just
> display the patch names?
> 
> The advantage of showing the summary is that it gives a reminder of
> the contents of the patch, so people can double-check that it's the
> one they want before binning it. The disadvantage is that in the
> case of multiple patches selected, the list of patches (which is far
> more important) will be obscured by other information, and may even
> vanish off the top of the scrollback buffer.

It's a little hard to say which is better.  If we had an interactive
confirmation, we could let the user decide what to view, and the user could
select things again.  It might be a good idea to write a function

prompt_confirmation :: String -> [(Char,String)] -> (Char -> IO ()) -> IO Bool

which could be called like

prompt_confirmation "Shall I unpull these patches?"
  [('v',"view patches"), ('x',"view patch summaries")]
  (\c -> case c of
         'x' -> print_summary ...
         'v' -> print_patches ...)

The confirmation would then require that the user type something like "y\n"
or "n\n" perhaps before proceeding.  It definitely couldn't accept just 'y'
or 'n' (with now newline) as confirmation, or the user can very easily
mistakenly confirm or cancel.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-users mailing list