annotate tests/test-update-dest.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 8d72e29ad1e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31844
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
1 Test update.requiredest
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
2 $ cd $TESTTMP
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
3 $ cat >> $HGRCPATH <<EOF
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
4 > [commands]
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
5 > update.requiredest = True
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
6 > EOF
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
7 $ hg init repo
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
8 $ cd repo
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
9 $ echo a >> a
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
10 $ hg commit -qAm aa
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
11 $ hg up
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
12 abort: you must specify a destination
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
13 (for example: hg update ".::")
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 34661
diff changeset
14 [10]
31844
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
15 $ hg up .
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
16 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
17 $ HGPLAIN=1 hg up
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
18 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
19 $ hg --config commands.update.requiredest=False up
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
21
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
22 $ cd ..
478999e8281d tests: move update requiredest test to own test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
23
31845
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
24 Check update.requiredest interaction with pull --update
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
25 $ hg clone repo clone
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
26 updating to branch default
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
28 $ cd repo
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
29 $ echo a >> a
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
30 $ hg commit -qAm aa
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
31 $ cd ../clone
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
32 $ hg pull --update
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
33 abort: update destination required by configuration
86246530b8d2 pull: abort pull --update if config requires destination (issue5528)
Ryan McElroy <rmcelroy@fb.com>
parents: 31844
diff changeset
34 (use hg pull followed by hg update DEST)
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 34661
diff changeset
35 [10]
33980
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
36
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
37 $ cd ..
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
38
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
39 update.requiredest should silent the "hg update" text after pull
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
40 $ hg init repo1
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
41 $ cd repo1
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
42 $ hg pull ../repo
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
43 pulling from ../repo
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
44 requesting all changes
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
45 adding changesets
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
46 adding manifests
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
47 adding file changes
8abbae93045a pull: do not prompt "hg update" if update.requiredest is set
Jun Wu <quark@fb.com>
parents: 31845
diff changeset
48 added 2 changesets with 2 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33980
diff changeset
49 new changesets 8f0162e483d0:048c2cb95949