[RFC MERGE] Pipe long winded commands through a pager

Michael Ellerman michael at ellerman.id.au
Fri Dec 16 07:09:02 GMT 2005


Heyho,

Martin suggested rather than using less(diff|log|status..) plugins, we could 
send all long winded commands through a pager.

I've done a hack job implementation so people can get a feel for it and decide 
if they like it, check it out:

http://michael.ellerman.id.au/files/bzr/pager

I've just added a "paged_command" decorator, kinda like "display_command". 
There's currently 35 or so "display_commands" many of which _don't_ produce a 
lot of output, so I haven't changed them all to use the new decorator.

The command that are paged ATM are:
 - inventory
 - renames
 - unknowns
 - ignored
 - deleted
 - log
 - modified
 - added
 - diff
 - ancestry
 - revision-history
 - annotate
 - status

Things that work:
 - if stdout is not a tty we don't use the pager
 - we use PAGER and PAGER_ARGUMENTS so people can customise.
 - we fallback to cat if we can't find a pager
 - doesn't break lessdiff (I like the colours :)

Stuff that needs fixing:
 - No way to enable/disable it completely.
 - when there's no pager we still have to run cat which is ineffcient, I can't 
   think of a way around this though.
 - still uses my pipes code, I couldn't get it working right with subprocess.

cheers

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051216/c0fd6a24/attachment.pgp 


More information about the bazaar mailing list