annotate tests/test-glog-topological.t @ 26750:9f9ec4abe700

cmdutil: make in-memory changes visible to external editor (issue4378) Before this patch, external editor process for the commit log can't view some in-memory changes (especially, of dirstate), because they aren't written out until the end of transaction (or wlock). This causes unexpected output of Mercurial commands spawned from that editor process. To make in-memory changes visible to external editor process, this patch does: - write (or schedule to write) in-memory dirstate changes, and - set HG_PENDING environment variable, if: - a transaction is running, and - there are in-memory changes to be visible "hg diff" spawned from external editor process for "hg qrefresh" shows: - "changes newly imported into the topmost" before 49148d7868df(*) - "all changes recorded in the topmost by refreshing" after this patch (*) 49148d7868df changed steps invoking editor process Even though backward compatibility may be broken, the latter behavior looks reasonable, because "hg diff" spawned from the editor process consistently shows "what changes new revision records" regardless of invocation context. In fact, issue4378 itself should be resolved by 800e090e9c64, which made 'repo.transaction()' write in-memory dirstate changes out explicitly before starting transaction. It also made "hg qrefresh" imply 'dirstate.write()' before external editor invocation in call chain below. - mq.queue.refresh - strip.strip - repair.strip - localrepository.transaction - dirstate.write - localrepository.commit - invoke external editor Though, this patch has '(issue4378)' in own summary line to indicate that issues like issue4378 should be fixed by this. BTW, this patch adds '-m' option to a 'hg ci --amend' execution in 'test-commit-amend.t', to avoid invoking external editor process. In this case, "unsure" states may be changed to "clean" according to timestamp or so on. These changes should be written into pending file, if external editor invocation is required, Then, writing dirstate changes out breaks stability of test, because it shows "transaction abort!/rollback completed" occasionally. Aborting after editor process invocation while commands below may cause similar instability of tests, too (AFAIK, there is no more such one, at this revision) - commit --amend - without --message/--logfile - import - without --message/--logfile, - without --no-commit, - without --bypass, - one of below, and - patch has no description text, or - with --edit - aborting at the 1st patch, which adds or removes file(s) - if it only changes existing files, status is checked only for changed files by 'scmutil.matchfiles()', and transition from "unsure" to "normal" in dirstate doesn't occur (= dirstate isn't changed, and written out) - aborting at the 2nd or later patch implies other pending changes (e.g. changelog), and always causes showing "transaction abort!/rollback completed"
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 17 Oct 2015 01:15:34 +0900
parents 3ecbcffdeb0c
children d7af9b4ae7dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23565
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
1 This test file aims at test topological iteration and the various configuration it can has.
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
2
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
3 $ cat >> $HGRCPATH << EOF
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
4 > [ui]
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
5 > logtemplate={rev}\n
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
6 > EOF
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
7
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
8 On this simple example, all topological branch are displayed in turn until we
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
9 can finally display 0. this implies skipping from 8 to 3 and coming back to 7
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
10 later.
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
11
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
12 $ hg init test01
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
13 $ cd test01
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
14 $ hg unbundle $TESTDIR/bundles/remote.hg
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
15 adding changesets
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
16 adding manifests
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
17 adding file changes
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
18 added 9 changesets with 7 changes to 4 files (+1 heads)
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
19 (run 'hg heads' to see heads, 'hg merge' to merge)
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
20
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
21 $ hg log -G
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
22 o 8
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
23 |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
24 | o 7
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
25 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
26 | o 6
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
27 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
28 | o 5
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
29 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
30 | o 4
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
31 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
32 o | 3
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
33 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
34 o | 2
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
35 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
36 o | 1
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
37 |/
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
38 o 0
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
39
23567
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
40
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
41 (display all nodes)
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
42
23569
3ecbcffdeb0c graphmod: rename graph-topological config to graph-group-branches
Augie Fackler <raf@durin42.com>
parents: 23568
diff changeset
43 $ hg --config experimental.graph-group-branches=1 log -G
23565
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
44 o 8
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
45 |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
46 o 3
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
47 |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
48 o 2
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
49 |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
50 o 1
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
51 |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
52 | o 7
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
53 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
54 | o 6
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
55 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
56 | o 5
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
57 | |
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
58 | o 4
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
59 |/
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
60 o 0
996c01bfbec4 graphlog: add a way to test the 'groupbranchiter' function
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
61
23567
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
62
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
63 (revset skipping nodes)
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
64
23569
3ecbcffdeb0c graphmod: rename graph-topological config to graph-group-branches
Augie Fackler <raf@durin42.com>
parents: 23568
diff changeset
65 $ hg --config experimental.graph-group-branches=1 log -G --rev 'not (2+6)'
23567
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
66 o 8
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
67 |
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
68 o 3
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
69 |
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
70 o 1
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
71 |
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
72 | o 7
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
73 | |
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
74 | o 5
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
75 | |
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
76 | o 4
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
77 |/
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
78 o 0
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
79
1f080c9c6a35 groupbranchiter: support for non-contiguous revsets
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23565
diff changeset
80
23568
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
81 (begin) from the other branch
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
82
23569
3ecbcffdeb0c graphmod: rename graph-topological config to graph-group-branches
Augie Fackler <raf@durin42.com>
parents: 23568
diff changeset
83 $ hg --config experimental.graph-group-branches=1 --config experimental.graph-group-branches.firstbranch=5 log -G
23568
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
84 o 7
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
85 |
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
86 o 6
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
87 |
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
88 o 5
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
89 |
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
90 o 4
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
91 |
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
92 | o 8
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
93 | |
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
94 | o 3
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
95 | |
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
96 | o 2
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
97 | |
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
98 | o 1
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
99 |/
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
100 o 0
740ae54573a3 groupbranchiter: allow callers to select the first branch
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23567
diff changeset
101