Mercurial > hg
annotate tests/test-update-branches.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 | a271925699d6 |
children | 72072cfc7e91 |
rev | line source |
---|---|
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
1 # Construct the following history tree: |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
2 # |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
3 # @ 5:e1bb631146ca b1 |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
4 # | |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
5 # o 4:a4fdb3b883c4 0:b608b9236435 b1 |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
6 # | |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
7 # | o 3:4b57d2520816 1:44592833ba9f |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
8 # | | |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
9 # | | o 2:063f31070f65 |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
10 # | |/ |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
11 # | o 1:44592833ba9f |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
12 # |/ |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
13 # o 0:b608b9236435 |
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
14 |
17773
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
15 $ mkdir b1 |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
16 $ cd b1 |
12279 | 17 $ hg init |
18 $ echo foo > foo | |
19 $ echo zero > a | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
20 $ hg init sub |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
21 $ echo suba > sub/suba |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
22 $ hg --cwd sub ci -Am addsuba |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
23 adding suba |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
24 $ echo 'sub = sub' > .hgsub |
12279 | 25 $ hg ci -qAm0 |
26 $ echo one > a ; hg ci -m1 | |
27 $ echo two > a ; hg ci -m2 | |
28 $ hg up -q 1 | |
29 $ echo three > a ; hg ci -qm3 | |
30 $ hg up -q 0 | |
31 $ hg branch -q b1 | |
32 $ echo four > a ; hg ci -qm4 | |
33 $ echo five > a ; hg ci -qm5 | |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
34 |
12279 | 35 Initial repo state: |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
36 |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
20107
diff
changeset
|
37 $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n' |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
38 @ 5:ff252e8273df b1 |
12279 | 39 | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
40 o 4:d047485b3896 0:60829823a42a b1 |
12279 | 41 | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
42 | o 3:6efa171f091b 1:0786582aa4b1 |
12279 | 43 | | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
44 | | o 2:bd10386d478c |
12279 | 45 | |/ |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
46 | o 1:0786582aa4b1 |
12279 | 47 |/ |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
48 o 0:60829823a42a |
12279 | 49 |
50 | |
17773
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
51 Make sure update doesn't assume b1 is a repository if invoked from outside: |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
52 |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
53 $ cd .. |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
54 $ hg update b1 |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
55 abort: no repository found in '$TESTTMP' (.hg not found)! |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
56 [255] |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
57 $ cd b1 |
434e5bd615fc
commands: don't infer repo for commands like update (issue2748)
Siddharth Agarwal <sid0@fb.com>
parents:
17347
diff
changeset
|
58 |
12279 | 59 Test helper functions: |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
60 |
12279 | 61 $ revtest () { |
62 > msg=$1 | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
63 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' |
12279 | 64 > startrev=$3 |
65 > targetrev=$4 | |
66 > opt=$5 | |
67 > hg up -qC $startrev | |
68 > test $dirtyflag = dirty && echo dirty > foo | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
69 > test $dirtyflag = dirtysub && echo dirty > sub/suba |
12279 | 70 > hg up $opt $targetrev |
71 > hg parent --template 'parent={rev}\n' | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
72 > hg stat -S |
17347
2da47de36b6f
check-code: fix check for trailing whitespace on continued lines too
Mads Kiilerich <mads@kiilerich.com>
parents:
16491
diff
changeset
|
73 > } |
12279 | 74 |
75 $ norevtest () { | |
76 > msg=$1 | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
77 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' |
12279 | 78 > startrev=$3 |
79 > opt=$4 | |
80 > hg up -qC $startrev | |
81 > test $dirtyflag = dirty && echo dirty > foo | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
82 > test $dirtyflag = dirtysub && echo dirty > sub/suba |
12279 | 83 > hg up $opt |
84 > hg parent --template 'parent={rev}\n' | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
85 > hg stat -S |
17347
2da47de36b6f
check-code: fix check for trailing whitespace on continued lines too
Mads Kiilerich <mads@kiilerich.com>
parents:
16491
diff
changeset
|
86 > } |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
87 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
88 Test cases are documented in a table in the update function of merge.py. |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
89 Cases are run as shown in that table, row by row. |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
90 |
12279 | 91 $ norevtest 'none clean linear' clean 4 |
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
93 parent=5 | |
94 | |
95 $ norevtest 'none clean same' clean 2 | |
19798
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
18985
diff
changeset
|
96 abort: not a linear update |
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
18985
diff
changeset
|
97 (merge or update --check to force update) |
12279 | 98 parent=2 |
99 | |
100 | |
101 $ revtest 'none clean linear' clean 1 2 | |
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
103 parent=2 | |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
104 |
12279 | 105 $ revtest 'none clean same' clean 2 3 |
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
107 parent=3 | |
108 | |
109 $ revtest 'none clean cross' clean 3 4 | |
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
111 parent=4 | |
112 | |
113 | |
114 $ revtest 'none dirty linear' dirty 1 2 | |
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
116 parent=2 | |
117 M foo | |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
118 |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
119 $ revtest 'none dirtysub linear' dirtysub 1 2 |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
121 parent=2 |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
122 M sub/suba |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
123 |
12279 | 124 $ revtest 'none dirty same' dirty 2 3 |
19799
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
125 abort: uncommitted changes |
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
126 (commit or update --clean to discard changes) |
12279 | 127 parent=2 |
128 M foo | |
129 | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
130 $ revtest 'none dirtysub same' dirtysub 2 3 |
19799
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
131 abort: uncommitted changes |
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
132 (commit or update --clean to discard changes) |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
133 parent=2 |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
134 M sub/suba |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
135 |
12279 | 136 $ revtest 'none dirty cross' dirty 3 4 |
19799
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
137 abort: uncommitted changes |
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
138 (commit or update --clean to discard changes) |
12279 | 139 parent=3 |
140 M foo | |
141 | |
19800
4894e0d9462d
update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents:
19799
diff
changeset
|
142 $ norevtest 'none dirty cross' dirty 2 |
4894e0d9462d
update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents:
19799
diff
changeset
|
143 abort: uncommitted changes |
4894e0d9462d
update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents:
19799
diff
changeset
|
144 (commit and merge, or update --clean to discard changes) |
4894e0d9462d
update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents:
19799
diff
changeset
|
145 parent=2 |
4894e0d9462d
update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents:
19799
diff
changeset
|
146 M foo |
4894e0d9462d
update: improve error message for dirty non-linear update with rev
Siddharth Agarwal <sid0@fb.com>
parents:
19799
diff
changeset
|
147 |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
148 $ revtest 'none dirtysub cross' dirtysub 3 4 |
19799
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
149 abort: uncommitted changes |
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
150 (commit or update --clean to discard changes) |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
151 parent=3 |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
152 M sub/suba |
12279 | 153 |
154 $ revtest '-C dirty linear' dirty 1 2 -C | |
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
156 parent=2 | |
9716
ea8c207a0f78
update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff
changeset
|
157 |
12279 | 158 $ revtest '-c dirty linear' dirty 1 2 -c |
19801
41abe2e3e3b7
update: standardize error message for dirty update --check
Siddharth Agarwal <sid0@fb.com>
parents:
19800
diff
changeset
|
159 abort: uncommitted changes |
12279 | 160 parent=1 |
161 M foo | |
162 | |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
163 $ revtest '-c dirtysub linear' dirtysub 1 2 -c |
24473
0142b59f5743
update: replace workingctx.dirty and raising Abort by cmdutil.bailifchanged
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
22955
diff
changeset
|
164 abort: uncommitted changes in subrepository 'sub' |
16491
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
165 parent=1 |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
166 M sub/suba |
bfe89d65d651
update: make --check abort with dirty subrepos
Patrick Mezard <patrick@mezard.eu>
parents:
14485
diff
changeset
|
167 |
12279 | 168 $ norevtest '-c clean same' clean 2 -c |
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
170 parent=3 | |
171 | |
172 $ revtest '-cC dirty linear' dirty 1 2 -cC | |
173 abort: cannot specify both -c/--check and -C/--clean | |
174 parent=1 | |
175 M foo | |
176 | |
18985
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
177 Test obsolescence behavior |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
178 --------------------------------------------------------------------- |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
179 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
180 successors should be taken in account when checking head destination |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
181 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
182 $ cat << EOF >> $HGRCPATH |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
183 > [ui] |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
184 > logtemplate={rev}:{node|short} {desc|firstline} |
22955
fab9dda0f2a3
obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents:
20281
diff
changeset
|
185 > [experimental] |
fab9dda0f2a3
obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents:
20281
diff
changeset
|
186 > evolution=createmarkers |
18985
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
187 > EOF |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
188 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
189 Test no-argument update to a successor of an obsoleted changeset |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
190 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
191 $ hg log -G |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
192 o 5:ff252e8273df 5 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
193 | |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
194 o 4:d047485b3896 4 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
195 | |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
196 | o 3:6efa171f091b 3 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
197 | | |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
198 | | o 2:bd10386d478c 2 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
199 | |/ |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
200 | @ 1:0786582aa4b1 1 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
201 |/ |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
202 o 0:60829823a42a 0 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
203 |
20107
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
204 $ hg book bm -r 3 |
18985
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
205 $ hg status |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
206 M foo |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
207 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
208 We add simple obsolescence marker between 3 and 4 (indirect successors) |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
209 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
210 $ hg id --debug -i -r 3 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
211 6efa171f091b00a3c35edc15d48c52a498929953 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
212 $ hg id --debug -i -r 4 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
213 d047485b3896813b2a624e86201983520f003206 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
214 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
215 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
216 |
20107
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
217 Test that 5 is detected as a valid destination from 3 and also accepts moving |
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
218 the bookmark (issue4015) |
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
219 |
18985
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
220 $ hg up --quiet --hidden 3 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
221 $ hg up 5 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
20107
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
223 $ hg book bm |
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
224 moving bookmark 'bm' forward from 6efa171f091b |
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
225 $ hg bookmarks |
2ca325ea57fa
bookmarks: consider successor changesets when moving bookmark (issue4015)
Sean Farley <sean.michael.farley@gmail.com>
parents:
19801
diff
changeset
|
226 * bm 5:ff252e8273df |
18985
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
227 |
20281
67ee87a371b2
update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents:
20280
diff
changeset
|
228 Test that 4 is detected as the no-argument destination from 3 and also moves |
67ee87a371b2
update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents:
20280
diff
changeset
|
229 the bookmark with it |
20280
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
230 $ hg up --quiet 0 # we should be able to update to 3 directly |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
231 $ hg up --quiet --hidden 3 # but not implemented yet. |
20281
67ee87a371b2
update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents:
20280
diff
changeset
|
232 $ hg book -f bm |
20280
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
233 $ hg up |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
234 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
20281
67ee87a371b2
update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents:
20280
diff
changeset
|
235 updating bookmark bm |
67ee87a371b2
update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents:
20280
diff
changeset
|
236 $ hg book |
67ee87a371b2
update: consider successor changesets when moving active bookmark
Sean Farley <sean.michael.farley@gmail.com>
parents:
20280
diff
changeset
|
237 * bm 4:d047485b3896 |
20280
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
238 |
18985
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
239 Test that 5 is detected as a valid destination from 1 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
240 $ hg up --quiet 0 # we should be able to update to 3 directly |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
241 $ hg up --quiet --hidden 3 # but not implemented yet. |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
242 $ hg up 5 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
243 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
244 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
245 Test that 5 is not detected as a valid destination from 2 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
246 $ hg up --quiet 0 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
247 $ hg up --quiet 2 |
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
248 $ hg up 5 |
19799
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
249 abort: uncommitted changes |
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
250 (commit or update --clean to discard changes) |
18985
a59e575c6ff8
update: allow dirty update to foreground (successors)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
17773
diff
changeset
|
251 [255] |
20280
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
252 |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
253 Test that we don't crash when updating from a pruned changeset (i.e. has no |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
254 successors). Behavior should probably be that we update to the first |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
255 non-obsolete parent but that will be decided later. |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
256 $ hg id --debug -r 2 |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
257 bd10386d478cd5a9faf2e604114c8e6da62d3889 |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
258 $ hg up --quiet 0 |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
259 $ hg up --quiet 2 |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
260 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889 |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
261 $ hg up |
95b9c6149e17
merge: consider successor changesets for a bare update
Sean Farley <sean.michael.farley@gmail.com>
parents:
20117
diff
changeset
|
262 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
26713
a271925699d6
revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24473
diff
changeset
|
263 |
a271925699d6
revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24473
diff
changeset
|
264 Test experimental revset support |
a271925699d6
revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24473
diff
changeset
|
265 |
a271925699d6
revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24473
diff
changeset
|
266 $ hg log -r '_destupdate()' |
a271925699d6
revset: reintroduce and experimental revset for update destination
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24473
diff
changeset
|
267 2:bd10386d478c 2 (no-eol) |