comparison mercurial/ui.py @ 31691:c3ca0ad8ab9c

ui: rerun color.setup() once the pager has spawned to honor 'color.pagermode' Otherwise, ui.pageractive is False when color is setup in dispatch.py (without --pager=on), and this config option is ignored.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 25 Mar 2017 19:17:11 -0400
parents 2d11d278279a
children 8181f378b073
comparison
equal deleted inserted replaced
31690:2d11d278279a 31691:c3ca0ad8ab9c
865 # Preserve the formatted-ness of the UI. This is important 865 # Preserve the formatted-ness of the UI. This is important
866 # because we mess with stdout, which might confuse 866 # because we mess with stdout, which might confuse
867 # auto-detection of things being formatted. 867 # auto-detection of things being formatted.
868 self.setconfig('ui', 'formatted', wasformatted, 'pager') 868 self.setconfig('ui', 'formatted', wasformatted, 'pager')
869 self.setconfig('ui', 'interactive', False, 'pager') 869 self.setconfig('ui', 'interactive', False, 'pager')
870
871 # If pagermode differs from color.mode, reconfigure color now that
872 # pageractive is set.
873 cm = self._colormode
874 if cm != self.config('color', 'pagermode', cm):
875 color.setup(self)
870 else: 876 else:
871 # If the pager can't be spawned in dispatch when --pager=on is 877 # If the pager can't be spawned in dispatch when --pager=on is
872 # given, don't try again when the command runs, to avoid a duplicate 878 # given, don't try again when the command runs, to avoid a duplicate
873 # warning about a missing pager command. 879 # warning about a missing pager command.
874 self.disablepager() 880 self.disablepager()