Mercurial > hg
annotate tests/test-histedit-merge-tools.t @ 48014:0dc4cc654d96
typing: drop annotations on `mercurial/logcmdutil.walkopts` attributes
Pytype 2021-09-09 must have learned some things about `@attr`, because while
these were presumably required to help it before (c1d0f83d62c4::9a26fea2b518 and
c11099cc1de4::224c786f4fce), these instances now get flagged as an assignment
mismatch:
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 717, in walkopts: Type annotation for pats does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 718, in walkopts: Type annotation for opts does not match type of assignment [annotation-type-mismatch]
Annotation: Dict[bytes, Any]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 722, in walkopts: Type annotation for revspec does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 725, in walkopts: Type annotation for bookmarks does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 726, in walkopts: Type annotation for branches does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 727, in walkopts: Type annotation for date does not match type of assignment [annotation-type-mismatch]
Annotation: Optional[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 728, in walkopts: Type annotation for keywords does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 729, in walkopts: Type annotation for no_merges does not match type of assignment [annotation-type-mismatch]
Annotation: bool
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 730, in walkopts: Type annotation for only_merges does not match type of assignment [annotation-type-mismatch]
Annotation: bool
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 731, in walkopts: Type annotation for prune_ancestors does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 732, in walkopts: Type annotation for users does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 735, in walkopts: Type annotation for include_pats does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 736, in walkopts: Type annotation for exclude_pats does not match type of assignment [annotation-type-mismatch]
Annotation: List[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 739, in walkopts: Type annotation for follow does not match type of assignment [annotation-type-mismatch]
Annotation: int
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 743, in walkopts: Type annotation for force_changelog_traversal does not match type of assignment [annotation-type-mismatch]
Annotation: bool
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 747, in walkopts: Type annotation for filter_revisions_by_pats does not match type of assignment [annotation-type-mismatch]
Annotation: bool
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 750, in walkopts: Type annotation for sort_revisions does not match type of assignment [annotation-type-mismatch]
Annotation: Optional[bytes]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 753, in walkopts: Type annotation for limit does not match type of assignment [annotation-type-mismatch]
Annotation: Optional[int]
Assignment: mercurial.thirdparty.attr._make._CountingAttr
Differential Revision: https://phab.mercurial-scm.org/D11474
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 20 Sep 2021 11:22:27 -0400 |
parents | 527ce85c2e60 |
children |
rev | line source |
---|---|
42052
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
1 Test histedit extension: Merge tools |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
2 ==================================== |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
3 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
4 Initialization |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
5 --------------- |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
6 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
7 $ . "$TESTDIR/histedit-helpers.sh" |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
8 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
9 $ cat >> $HGRCPATH <<EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
10 > [alias] |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
11 > logt = log --template '{rev}:{node|short} {desc|firstline}\n' |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
12 > [extensions] |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
13 > histedit= |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
14 > mockmakedate = $TESTDIR/mockmakedate.py |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
15 > EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
16 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
17 Merge conflict |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
18 -------------- |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
19 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
20 $ hg init r |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
21 $ cd r |
45768
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
22 $ cat >> .hg/hgrc <<EOF |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
23 > [command-templates] |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
24 > pre-merge-tool-output='pre-merge message for {node}\n' |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
25 > EOF |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
26 |
42052
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
27 $ echo foo > file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
28 $ hg add file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
29 $ hg ci -m "First" -d "1 0" |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
30 $ echo bar > file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
31 $ hg ci -m "Second" -d "2 0" |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
32 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
33 $ hg logt --graph |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
34 @ 1:2aa920f62fb9 Second |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
35 | |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
36 o 0:7181f42b8fca First |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
37 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
38 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
39 Invert the order of the commits, but fail the merge. |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
40 $ hg histedit --config ui.merge=false --commands - 2>&1 <<EOF | fixbundle |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
41 > pick 2aa920f62fb9 Second |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
42 > pick 7181f42b8fca First |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
43 > EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
44 merging file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
45 pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
46 merging file failed! |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
47 Fix up the change (pick 7181f42b8fca) |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
48 (hg histedit --continue to resume) |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
49 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
50 $ hg histedit --abort | fixbundle |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
52 |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
53 Invert the order of the commits, and pretend the merge succeeded. |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
54 $ hg histedit --config ui.merge=true --commands - 2>&1 <<EOF | fixbundle |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
55 > pick 2aa920f62fb9 Second |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
56 > pick 7181f42b8fca First |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
57 > EOF |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
58 merging file |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
59 pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec |
15d2afa31e57
histedit: narrow the scope of discarded ui output
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
60 7181f42b8fca: skipping changeset (no changes) |
45768
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
61 $ hg histedit --abort |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
62 abort: no histedit in progress |
45840
527ce85c2e60
errors: introduce StateError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents:
45768
diff
changeset
|
63 [20] |
45768
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
64 $ cd .. |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
65 |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
66 Test legacy config name |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
67 |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
68 $ hg init r2 |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
69 $ cd r2 |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
70 $ echo foo > file |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
71 $ hg add file |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
72 $ hg ci -m "First" |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
73 $ echo bar > file |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
74 $ hg ci -m "Second" |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
75 $ echo conflict > file |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
76 $ hg co -m 0 --config ui.merge=false \ |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
77 > --config ui.pre-merge-tool-output-template='legacy config: {node}\n' |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
78 merging file |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
79 legacy config: 889c9c4d58bd4ce74815efd04a01e0f2bf6765a7 |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
80 merging file failed! |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
81 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
82 use 'hg resolve' to retry unresolved file merges |
5effb1992c17
config: move ui.pre-merge-tool-output-template into [command-templates]
Martin von Zweigbergk <martinvonz@google.com>
parents:
42052
diff
changeset
|
83 [1] |