1. Summarise the issue (what were doing, what went wrong?)
> time darcs rollback -p'compress patch data before sending'
in a clone of the darcs screened repo runs for over 2 minutes without
giving me any feedback. A matching patch is near the top, only a handful
of patches back.
2. What behaviour were you expecting instead?
That I quickly get a prompt asking me about the last (in application
order) matching patch.
3. What darcs version are you using? (Try: darcs --exact-version)
2.9.9 (+ 253 patches)
4. Further note
There is a patch that depends on the one I want to roll back and this
other patch does not match the pattern. At first I thought the pattern
is not unique and rollback tries too eagerly to calculate all
dependencies of a very old patch. But not so, darcs log -p'compress
patch data before sending' returns quickly and lists one matching patch.
Looks like rollback -p scans the whooole history before showing the
prompt. In a sense rollback is similar to obliterate in the patch
selection process. (With the difference that obliterate does not look
for patches older than the last tag.)
Hence I wonder why rollback has to show us the total number of
selectable patches in the selection prompt? If we change this setting
the bug is fixed.
The fundamental issue seems to be that the SelectChanges exclusively
works with FL's, because Darcs.Patch.Choices does. The solution, then,
would be to generalize Darcs.Patch.Choices to work with RL's also (which
makes sense for "undo" operations like rollback, obliterate).
I have been looking into Darcs.Patch.Choices and made some experimental
changes to support RL as well as FL. I found that some of the functions
can be easily generalized while for others this is hard. Thinking a bit
more about the reasons for that I began to ask myself why PatchChoices
does not use a zipper-like structure. Currently pcsFirsts and pcsLasts
are both an FL of (labeled) patches. I wonder if it makes sense to turn
pcsFirsts into an RL; then the whole thing can be made to work in a more
symmetric manner. I am also thinking about pulling things like
WhichChanges from UI.SelectChanges into Patch.Choices.