def revdatelimit(ui, revset):
    """Update revset so that only changesets no older than 'prefetchdays' days
    are included. The default value is set to 14 days. If 'prefetchdays' is set
    to zero or negative value then date restriction is not applied.
    """
    days = ui.configint(b'remotefilelog', b'prefetchdays')
    if days > 0:
        revset = b'(%s) & date(-%s)' % (revset, days)
    return revset