D3665: graph: improve graph output by using Unicode characters

smf (Sean Farley) phabricator at mercurial-scm.org
Sun Jun 17 01:07:04 UTC 2018


smf added a comment.


  In https://phab.mercurial-scm.org/D3665#58973, @johnstiles wrote:
  
  > Thanks for the assist, @smf ! I appreciate it.
  
  
  Sure, no problem :-)
  
  By the way, here's the diff of what I changed:
  
    diff --git a/hgext/beautifygraph.py b/hgext/beautifygraph.py
    index 7ff3c08..254d2cc 100644
    --- a/hgext/beautifygraph.py
    +++ b/hgext/beautifygraph.py
    @@ -4,23 +4,23 @@
     # Copyright 2018 John Stiles <johnstiles at gmail.com>
     #
     # This software may be used and distributed according to the terms of the
     # GNU General Public License version 2 or any later version.
     
    -'''This extension beautifies log -G output by using Unicode characters.
    +'''beautify log -G output by using Unicode characters (EXPERIMENTAL)
     
        A terminal with UTF-8 support and monospace narrow text are required.
     '''
     
     from __future__ import absolute_import
     
     from mercurial.i18n import _
     from mercurial import (
         encoding,
         extensions,
    +    graphmod,
         templatekw,
    -    graphmod
     )
     
     # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
     # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
     # be specifying the version(s) of Mercurial they are tested with, or
    diff --git a/tests/test-duplicateoptions.py b/tests/test-duplicateoptions.py
    index 4511a89..397eca4 100644
    --- a/tests/test-duplicateoptions.py
    +++ b/tests/test-duplicateoptions.py
    @@ -4,11 +4,11 @@ from mercurial import (
         commands,
         extensions,
         ui as uimod,
     )
     
    -ignore = {b'highlight', b'win32text', b'factotum'}
    +ignore = {b'highlight', b'win32text', b'factotum', b'beautifygraph'}
     
     if os.name != 'nt':
         ignore.add(b'win32mbcs')
     
     disabled = [ext for ext in extensions.disabled().keys() if ext not in ignore]
    diff --git a/tests/test-glog-beautifygraph.t b/tests/test-glog-beautifygraph.t
    index c3d1fb7..e62334f 100644
    --- a/tests/test-glog-beautifygraph.t
    +++ b/tests/test-glog-beautifygraph.t
    @@ -89,10 +89,14 @@ o  (0) root
       >   logcmdutil,
       >   revsetlang,
       >   smartset,
       > )
       > 
    +  > from mercurial.utils import (
    +  >   stringutil,
    +  > )
    +  > 
       > def logrevset(repo, pats, opts):
       >     revs = logcmdutil._initialrevs(repo, opts)
       >     if not revs:
       >         return None
       >     match, pats, slowpath = logcmdutil._makematcher(repo, revs, pats, opts)
    @@ -109,11 +113,11 @@ o  (0) root
       >             else:
       >                 tree = []
       >             ui = repo.ui
       >             ui.write(b'%r\n' % (opts.get(b'rev', []),))
       >             ui.write(revsetlang.prettyformat(tree) + b'\n')
    -  >             ui.write(smartset.prettyformat(revs) + b'\n')
    +  >             ui.write(stringutil.prettyrepr(revs) + b'\n')
       >             revs = smartset.baseset()  # display no revisions
       >         return revs, filematcher
       >     extensions.wrapfunction(logcmdutil, 'getrevs', printrevset)
       >     aliases, entry = cmdutil.findcmd(b'log', commands.table)
       >     entry[1].append((b'', b'print-revset', False,
    @@ -324,1003 +328,1001 @@ The extension should not turn on if we'r
       
     
     The rest of our tests will use the default narrow text UTF-8.
     
       $ hg log -G -q
    -  \xe2\x8c\xbe  34:fea3ac5810e0 (esc)
    +  \xe2\x97\x8d  34:fea3ac5810e0 (esc)
       \xe2\x94\x82 (esc)
    -  \xe2\x94\x82 \xe2\x97\xaf  33:68608f5145f9 (esc)
    +  \xe2\x94\x82 \xe2\x97\x8b  33:68608f5145f9 (esc)
    
    [... elided the rest]

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3665

To: johnstiles, #hg-reviewers, spectral, indygreg
Cc: quark, spectral, indygreg, smf, yuja, mercurial-devel


More information about the Mercurial-devel mailing list