Issue 2649 task: cleanup display of patches

Title task: cleanup display of patches
Priority Status resolved
Milestone Resolved in 2.15.0
Superseder Nosy List bfrk
Assigned To

Created on 2020-07-15.08:46:15 by bfrk, last changed 2020-07-30.12:07:22 by noreply.

msg22161 (view) Author: bfrk Date: 2020-07-15.08:46:10
When darcs is used interactively, the keys 'x' and 'v'/'p' display 
additional information: 'x' shows a summary, 'v'/'p' show patch 
content ('p' with a pager, 'v' without). Or at least that is what I'd 
like them to do... in reality they re-print the whole patch including 
the patchinfo. I think this is excessive and I would like to change 
the UI such that hitting these keys only displays the new information 
and not repeat the patchinfo. Furthermore, the indentation is also 
excessive. A single four-spaces indentation should be anough.

On the non-interactive side, specifying both -s and -v is teh same as 
specifying only -v. Getting both is not something I have ever missed 
as a feature, but if -s and -v specify different levels of verbosity, 
perhaps this should be made more obvious in the UI.

The amount of information printed and the level to which it is 
indented also differs between interactive and non-interactive use and 
also depends on the command. This is because some commands use lower 
level functions like displayPatch which does no indentation, while 
other use showNicely (which indents the patch details) or even 
showFriendly (which does an additional extra indentation). This is 
all pretty much a mess, starting with the naming for these functions 
(when should I use showNicely, when showFriendly???).

These problems are paralleled at the patch interface layer. The class 
ShowPatch has methods description, summary, and showNicely. 
description makes sense only for a single named patch. summary makes 
sense for all patches and also for sequences, but only if it excludes 
printing the patch description. showNicely differs from displayPatch 
only for named patches: the patch details are shown indented and 
dependencies are shown in a slightly different format.

Here is my current plan of attack:

 * Change summary for named patches to print only the summary and not
   the description. BTW, RebaseChange already does that, which means
   'darcs rebase log -s' is currently broken because the patch
   descriptions are missing.
 * Another method to print only the full patch content verbosely (but
   without the description) is needed. We need a name for that
   method. One that fits the existing method names is 'contents' (but
   for clarity perhaps something like 'showContents' is better).
 * The UI code is then free to compose description, summary, and
   contents (using the $$ operator) as they please, applying
   indentation (via 'prefix "    ") separately for each part as
 * Method showNicely is no longer needed as a class method is turned
   into a normal overloaded function at the UI layer.
msg22295 (view) Author: noreply Date: 2020-07-30.12:07:19
The following patch sent by Ben Franksen <ben.franksen@online.de> updated issue issue2649 with
status=resolved;resolvedin=2.15.0 HEAD

* resolve issue2649: cleanup display of patches 
Ignore-this: cf33c42dbf89ee78c135b9fdbfedfc7989fd57f6de3acbce746035f4cd19f4f2667e1e846b2951ec
Date User Action Args
2020-07-15 08:46:15bfrkcreate
2020-07-30 12:07:22noreplysetstatus: unknown -> resolved
messages: + msg22295
resolvedin: 2.15.0