Mercurial > hg
view tests/test-revset-dirstate-parents.t @ 49642:7e6f3c69c0fb
tests: update test-util.py for modern attrs package
When updating to 22.1.0, this test started failing:
Traceback (most recent call last):
File "/tmp/mercurial-ci/tests/test-util.py", line 53, in <module>
_start_default = (util.timedcmstats.start.default, 'factory')
AttributeError: type object 'timedcmstats' has no attribute 'start'
Poking around in `hg debugshell`, the attribute is indeed missing, but looks to
be attached to `__attrs_attrs__` in both the currently vendored and the modern
version of attrs. The old attrs packages will print the same for both accesses,
so fingers crossed...
>>> print((util.timedcmstats.start.default, 'factory'))
(Factory(factory=<function timedcmstats.<lambda> at 0x000001EFDF0F21F0>, takes_self=False), 'factory')
>>> print((util.timedcmstats.__attrs_attrs__.start.default, 'factory'))
(Factory(factory=<function timedcmstats.<lambda> at 0x000001EFDF0F21F0>, takes_self=False), 'factory')
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 21 Nov 2022 16:18:28 -0500 |
parents | 7bbc4e113e5f |
children |
line wrap: on
line source
$ HGENCODING=utf-8 $ export HGENCODING $ try() { > hg debugrevspec --debug $@ > } $ log() { > hg log --template '{rev}\n' -r "$1" > } $ hg init repo $ cd repo $ try 'p1()' (func (symbol 'p1') None) * set: <baseset []> $ try 'p2()' (func (symbol 'p2') None) * set: <baseset []> $ try 'parents()' (func (symbol 'parents') None) * set: <baseset+ []> null revision $ log 'p1()' $ log 'p2()' $ log 'parents()' working dir with a single parent $ echo a > a $ hg ci -Aqm0 $ log 'p1()' 0 $ log 'tag() and p1()' $ log 'p2()' $ log 'parents()' 0 $ log 'tag() and parents()' merge in progress $ echo b > b $ hg ci -Aqm1 $ hg up -q 0 $ echo c > c $ hg ci -Aqm2 $ hg merge -q $ log 'p1()' 2 $ log 'p2()' 1 $ log 'tag() and p2()' $ log 'parents()' 1 2 $ cd ..