Patch updated

Frank Kingswood frank at kingswood-consulting.co.uk
Thu Mar 6 05:03:08 CST 2008


David Soria Parra wrote:
> i updated the patch, so it only displays the pager when a minimum number
> of lines is used, and I help now uses the pager.
> 
> As christian said, it's not python 2.3 compatible
> 
> # HG changeset patch
> # User David Soria Parra <sn_ at gmx.net>
> # Date 1204795366 -3600
> # Node ID e38e2f5a22fcfe52548124d0a0e5ad64ff54495f
> # Parent  0068809347d72e552f980487ee669ace9a82d214
> Add a pager to display long output using the pager given by the environment
> 
> Long output like annotate, help, log or diff are now using the given
> pager from
> the environment when the output is longer than a default value (default:
> 25 lines)
> to display the content.

That is way too magic for my liking. You can not predict what users want 
either. I for example like to see output immediately, and am prepared to 
use scrollback.

A simpler method that does not mess with the hg internals is to wrap hg 
in a bash function, like

function hg() {
    command hg "$@" | crufty_pager
}

where crufty_pager is a script that reads its input and if it finds more 
than 25 lines fires up $PAGER, and otherwise just writes them to stdout.

Frank



More information about the Mercurial-devel mailing list