On Sun, Feb 26, 2017 at 5:25 AM, Matt Harbison <mharbiso...@gmail.com> wrote: > On Sat, 25 Feb 2017 23:32:12 -0500, Augie Fackler <r...@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 _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel