Ticket #12288: trac_12288-sage-hg.patch

File trac_12288-sage-hg.patch, 1.0 KB (added by jhpalmieri, 16 months ago)

version 1: use "sage --hg" instead of "hg" to run Mercurial

  • sage/misc/hg.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1326148179 28800
    # Node ID 560ebfe0044c3ea63f17973330d78c7ad23806a4
    # Parent  92c93226b64f933e0af00bbcbd1a8a79c444f43f
    #12288: use "sage --hg" instead of "hg" to run Mercurial from within Sage.
    
    diff --git a/sage/misc/hg.py b/sage/misc/hg.py
    a b class HG: 
    386386        self._warning() 
    387387        if cmd is None: 
    388388            cmd = 'status' 
    389         s = 'cd "%s" && hg %s'%(self.__dir, cmd) 
     389        # Invoke Mercurial with "sage --hg", not just "hg": when 
     390        # calling "hg", the variable HGPLAIN is set (by sage-env), 
     391        # which disables various configuration options, like the use 
     392        # of a pager.  When calling "sage --hg", HGPLAIN is explicitly 
     393        # unset (see the script sage-sage), so the pager will be used, 
     394        # as will color output, etc.  See trac ticket #12288. 
     395        s = 'cd "%s" && sage --hg %s'%(self.__dir, cmd) 
    390396        if debug: 
    391397            print s 
    392398        if interactive: