docs: def within_history(rev, windowdict):
      """Return whether the windowdict has history at the revision."""
      if not windowdict:
          return False
      begin = windowdict._past[0][0] if windowdict._past else \
              windowdict._future[-1][0]
      end = windowdict._future[0][0] if windowdict._future else \
            windowdict._past[-1][0]
      return begin <= rev <= end