mercurial/stack.py
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 04 Oct 2024 01:40:35 -0400
changeset 51952 f4c038081561
parent 51863 f4733654f144
permissions -rw-r--r--
run-tests: bump the default timeout on Windows to 4x the normal value There are a ridiculous number of tests that timeout on Windows with the 360 sec default (~60). And because of the bug where timed out tests still run to completion before the results are thrown away[1], the timeout does nothing but waste time, so there's no reason to try to find a lower value that still works. For reference on my system: # Ran 909 tests, 116 skipped, 119 failed. python hash seed: 2052473208 real 151m44.322s user 0m0.077s sys 0m0.046s [1] I thought that I wrote a bug for this, but search isn't finding it.

# stack.py - Mercurial functions for stack definition
#
#  Copyright Olivia Mackall <olivia@selenic.com> and other
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

from __future__ import annotations


def getstack(repo, rev=None):
    """return a sorted smartrev of the stack containing either rev if it is
    not None or the current working directory parent.

    The stack will always contain all drafts changesets which are ancestors to
    the revision and are not merges.
    """
    if rev is None:
        rev = b'.'

    revspec = b'only(%s) and not public() and not ::merge()'
    revisions = repo.revs(revspec, rev)
    revisions.sort()
    return revisions