#11142: clean up sage/misc/hg.py
-----------------------------------+----------------------------------------
Reporter: jhpalmieri | Owner: jason
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-4.7.1
Component: misc | Keywords: sd31
Work_issues: | Upstream: N/A
Reviewer: Karl-Dieter Crisman | Author: John Palmieri
Merged: | Dependencies:
-----------------------------------+----------------------------------------
Changes (by jhpalmieri):
* status: needs_work => needs_review
Comment:
Replying to [comment:3 kcrisman]:
> Okay, I also have a question. Why the `debug=False`? You did a nice
job with this and the pager, but shouldn't we print out the commands?
Or is that just annoying to see? Just wondering.
I thought it was little annoying to see. Typical output might be
{{{
cd "/Applications/sage/devel/sage" && hg diff --config
pager.pager="LESS='FSRX' less"
}}}
But I've changed it to True.
> 'Needs work' for adding the very important options in the documentation
to revert, rollback, and import. If we are going to update doc at all,
this should happen.
Okay, I've taken care of this.
Now, changing the pager as I've done changes the current behavior in
several ways (from the command line, not the notebook: the notebook should
behave the same way):
- (the option F says to quit the pager if everything fits on one page;
this doesn't change the current behavior, but see option X below.)
- the option S says to truncate long lines rather than wrap them.
Currently we wrap them, as in
{{{
changeset: 15816:11586fb87f83
user: John Cremona <[email protected]> and Robert Bradshaw
<[email protected]
u>
date: Fri Apr 22 15:50:26 2011 +0100
summary: Trac #11220: #11220: implement CM j-invariants and orders for
quadratic fields
}}}
Note lines 2-3. With the S option, line 3 would be omitted. Opinions?
- the option R says to preserve any color information in the output, so
output from hg_sage.diff() would be colorized nicely. This is one of the
points of this ticket, so I definitely want to keep this.
- the option X says to not clear the screen when you quit the pager. I
happen to like this. However, if this is off but option F is on, then any
output containing less than a screen displays briefly, and then the screen
gets cleared, so it's gone. This is not Sage-specific: it reproduces the
behavior when you run "hg diff" from the shell, with {{{pager = LESS='FSR'
less}}} in the {{{[pager]}}} section of your .hgrc file.
My suggestion: we use either "FSRX" or "FRX", and probably the second of
these is better. That's what the latest version of the patch uses.
Another question: should we try to have a way to configure the pager
options? We can accept keyword arguments into the various hg commands and
then pass them to the pager command, or we can do it like the way latex
options are set. Is it worth it?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11142#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.