[PATCH 1 of 9 pager v2] pager: move pager-initiating code into core

Simon King simon at simonking.org.uk
Mon Feb 27 05:55:55 EST 2017


On Sun, Feb 26, 2017 at 5:25 AM, Matt Harbison <mharbison72 at gmail.com> wrote:
> On Sat, 25 Feb 2017 23:32:12 -0500, Augie Fackler <raf at durin42.com> wrote:

[snip]

>>> Does it seem reasonable to move the above to a method, similar to
>>> ui.editor()?  I'd like to detect MSYS and default to `less`.  IDK if we can
>>> pull that off with just a global config file.  (The only way I see to detect
>>> MSYS is to look for 'MSYSTEM' in env.)
>>
>>
>> In line with the above, I’d expect an mays-backed package to set
>> systemdefaults.pager to less (maybe that’s not a thing? I dunno.)
>
>
> I'm not thinking of an msys package, rather my personal usage.  If I'm doing
> anything of any substance on the command line, I'll use msys.  But
> TortoiseHg launches cmd.exe with a simple Ctrl + Shift + T, and sometimes
> that's good enough.  Therefore, I can't just set a pager value in
> %HOME%/mercurial.ini.  The hg.exe built from source and the one bundled with
> TortoiseHg are each visible to msys and cmd.exe, depending on what directory
> I'm in.  So even if TortoiseHg picked one (and we ignore hg built from the
> dev repo), it may or may not use the best pager available without a little
> help.
>
>> I’m extremely hesitant to add any kind of conditional logic in hgrc.
>

You could get what you want by using "%include" with an environment
variable in your %HOME%/mercurial.ini, something along the lines of:

  %include mercurial.%MSYSTEM%.ini

It's not particularly user-friendly, but I think it will work.

Simon


More information about the Mercurial-devel mailing list