Mercurial > hg
annotate tests/test-push-r.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 | f2719b387380 |
children | 24ea47037186 |
rev | line source |
---|---|
12279 | 1 $ hg init test |
2 $ cd test | |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14117
diff
changeset
|
3 $ hg unbundle "$TESTDIR/bundles/remote.hg" |
14117
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
4 adding changesets |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
5 adding manifests |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
6 adding file changes |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
7 added 9 changesets with 7 changes to 4 files (+1 heads) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
8 (run 'hg heads' to see heads, 'hg merge' to merge) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
9 $ hg up tip |
12279 | 10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
11 $ cd .. | |
1781
284fc722c342
add an optional argument to push only the specified revisions (push -r)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
12 |
12279 | 13 $ for i in 0 1 2 3 4 5 6 7 8; do |
14 > echo | |
15 > mkdir test-"$i" | |
16 > hg --cwd test-"$i" init | |
17 > hg -R test push -r "$i" test-"$i" | |
18 > cd test-"$i" | |
19 > hg verify | |
20 > cd .. | |
21 > done | |
22 | |
23 pushing to test-0 | |
24 searching for changes | |
25 adding changesets | |
26 adding manifests | |
27 adding file changes | |
28 added 1 changesets with 1 changes to 1 files | |
29 checking changesets | |
30 checking manifests | |
31 crosschecking files in changesets and manifests | |
32 checking files | |
33 1 files, 1 changesets, 1 total revisions | |
34 | |
35 pushing to test-1 | |
36 searching for changes | |
37 adding changesets | |
38 adding manifests | |
39 adding file changes | |
40 added 2 changesets with 2 changes to 1 files | |
41 checking changesets | |
42 checking manifests | |
43 crosschecking files in changesets and manifests | |
44 checking files | |
45 1 files, 2 changesets, 2 total revisions | |
46 | |
47 pushing to test-2 | |
48 searching for changes | |
49 adding changesets | |
50 adding manifests | |
51 adding file changes | |
52 added 3 changesets with 3 changes to 1 files | |
53 checking changesets | |
54 checking manifests | |
55 crosschecking files in changesets and manifests | |
56 checking files | |
57 1 files, 3 changesets, 3 total revisions | |
58 | |
59 pushing to test-3 | |
60 searching for changes | |
61 adding changesets | |
62 adding manifests | |
63 adding file changes | |
64 added 4 changesets with 4 changes to 1 files | |
65 checking changesets | |
66 checking manifests | |
67 crosschecking files in changesets and manifests | |
68 checking files | |
69 1 files, 4 changesets, 4 total revisions | |
70 | |
71 pushing to test-4 | |
72 searching for changes | |
73 adding changesets | |
74 adding manifests | |
75 adding file changes | |
76 added 2 changesets with 2 changes to 1 files | |
77 checking changesets | |
78 checking manifests | |
79 crosschecking files in changesets and manifests | |
80 checking files | |
81 1 files, 2 changesets, 2 total revisions | |
82 | |
83 pushing to test-5 | |
84 searching for changes | |
85 adding changesets | |
86 adding manifests | |
87 adding file changes | |
88 added 3 changesets with 3 changes to 1 files | |
89 checking changesets | |
90 checking manifests | |
91 crosschecking files in changesets and manifests | |
92 checking files | |
93 1 files, 3 changesets, 3 total revisions | |
94 | |
95 pushing to test-6 | |
96 searching for changes | |
97 adding changesets | |
98 adding manifests | |
99 adding file changes | |
100 added 4 changesets with 5 changes to 2 files | |
101 checking changesets | |
102 checking manifests | |
103 crosschecking files in changesets and manifests | |
104 checking files | |
105 2 files, 4 changesets, 5 total revisions | |
106 | |
107 pushing to test-7 | |
108 searching for changes | |
109 adding changesets | |
110 adding manifests | |
111 adding file changes | |
112 added 5 changesets with 6 changes to 3 files | |
113 checking changesets | |
114 checking manifests | |
115 crosschecking files in changesets and manifests | |
116 checking files | |
117 3 files, 5 changesets, 6 total revisions | |
118 | |
119 pushing to test-8 | |
120 searching for changes | |
121 adding changesets | |
122 adding manifests | |
123 adding file changes | |
124 added 5 changesets with 5 changes to 2 files | |
125 checking changesets | |
126 checking manifests | |
127 crosschecking files in changesets and manifests | |
128 checking files | |
129 2 files, 5 changesets, 5 total revisions | |
130 | |
131 $ cd test-8 | |
132 | |
133 $ hg pull ../test-7 | |
134 pulling from ../test-7 | |
135 searching for changes | |
136 adding changesets | |
137 adding manifests | |
138 adding file changes | |
139 added 4 changesets with 2 changes to 3 files (+1 heads) | |
140 (run 'hg heads' to see heads, 'hg merge' to merge) | |
141 | |
142 $ hg verify | |
143 checking changesets | |
144 checking manifests | |
145 crosschecking files in changesets and manifests | |
146 checking files | |
147 4 files, 9 changesets, 7 total revisions | |
148 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
149 $ cd .. |