#11142: clean up sage/misc/hg.py
-----------------------------------+----------------------------------------
   Reporter:  jhpalmieri           |          Owner:  jason          
       Type:  enhancement          |         Status:  positive_review
   Priority:  minor                |      Milestone:  sage-4.7.2     
  Component:  misc                 |       Keywords:  sd31           
Work_issues:                       |       Upstream:  N/A            
   Reviewer:  Karl-Dieter Crisman  |         Author:  John Palmieri  
     Merged:                       |   Dependencies:  #10594         
-----------------------------------+----------------------------------------
Changes (by jhpalmieri):

  * status:  needs_review => positive_review


Old description:

> The attached patch cleans up hg.py in a few ways:
>
>  - it adds a few doctests, although many of them are marked "not tested",
> since otherwise it would try to import or export non-existent patches,
> etc.
>
>  - the function "pager" is rewritten, to use the Mercurial pager
> extension.  This way, any highlighting is preserved when you use
> "hg_sage.diff()" or "hg_sage.log()" with the color extension enabled.
>
>  - the function "color" was added, to disable the Mercurial color
> extension in the notebook.  Otherwise it produces some bad output: try
> putting
>     {{{
> [extensions]
> color =
>     }}}
>  in your .hgrc file, modify some files in the Sage library, and type
> "hg_sage.status()" in      the command line vs. the notebook.
>
> ------
>
> Apply [attachment:trac_11142-sage-hg.v2.patch].

New description:

 The attached patch cleans up hg.py in a few ways:

  - it adds a few doctests, although many of them are marked "not tested",
 since otherwise it would try to import or export non-existent patches,
 etc.

  - the function "pager" is rewritten, to use the Mercurial pager
 extension.  This way, any highlighting is preserved when you use
 "hg_sage.diff()" or "hg_sage.log()" with the color extension enabled.

  - the function "color" was added, to disable the Mercurial color
 extension in the notebook.  Otherwise it produces some bad output: try
 putting
     {{{
 [extensions]
 color =
     }}}
  in your .hgrc file, modify some files in the Sage library, and type
 "hg_sage.status()" in      the command line vs. the notebook.

 ------

 Apply [attachment:trac_11142-sage-hg.v2.patch] and
 [attachment:trac_1142-reviewer.patch].

--

Comment:

 The changes look good to me.  Thanks for cleaning that up.

 The nice thing about the "::" for the option lists is that it uses a
 fixed-width font, so the hyphens line up, etc.  Speaking of which, I'm
 putting up a new version of my patch which just adds a missing space in
 one of these option lists:
 {{{
 #!diff
 diff --git a/sage/misc/hg.py b/sage/misc/hg.py
 --- a/sage/misc/hg.py
 +++ b/sage/misc/hg.py
 @@ -527,7 +527,7 @@ class HG:
                 %b   basename of the exporting repository
                 %h   short-form changeset hash (12 bytes of hexadecimal)
                 %n   zero-padded sequence number, starting at 1
 -               %r  zero-padded changeset revision number
 +               %r   zero-padded changeset revision number

          -  ``text`` - boolean (default False).  Setting this to be True
             has the same effect as passing the "-a" option below.
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11142#comment:22>
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.

Reply via email to