[PATCH 3 of 4] ui: defer setting pager related properties until the pager has spawned

Yuya Nishihara yuya at tcha.org
Sun Mar 26 10:41:48 EDT 2017


On Sun, 26 Mar 2017 00:41:06 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1490490720 14400
> #      Sat Mar 25 21:12:00 2017 -0400
> # Node ID 84bda5db69dbe3d550f45ccd6d6eda2aad760ee4
> # Parent  a263702b064a5a3ce1ca74b227e8e624e4b05874
> ui: defer setting pager related properties until the pager has spawned

This looks good. I slightly prefer propagating OSError instead of returning
False, but that isn't important.

  # ui.pager()
  if pagercmd == 'cat':
      return
  try:
      self._runpager(pagercmd)
  except OSError as e:
      if e.errno == errno.ENOENT:
          self.warn(_("missing pager command '%s', skipping pager\n")

> I don't understand what chg is doing with pager, or how it signals a failure to
> spawn the pager.  But this is no worse that the previous behavior.

chg never reports error since it always spawns a pager through /bin/sh.


More information about the Mercurial-devel mailing list