comparison tests/test-copies-in-changeset.t @ 42859:2b869a515ba6

context: filter out invalid copies from workingctx.p[12]copies() workingctx normally gets its lists of modified, added, removed files etc. based on the dirstate status. Its constructor also accepts a "changes" argument to override the status from the dirstate. This is used for partial commits. If a "changed" argument was passed, we should clearly also filter out copies to those paths, which I had previously missed. This patch adds that filtering and fixes the bugs demonstrated in the previous patch. Differential Revision: https://phab.mercurial-scm.org/D6750
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 19 Aug 2019 15:43:27 -0700
parents 170b070ec6a5
children 6f0273558c4b
comparison
equal deleted inserted replaced
42858:170b070ec6a5 42859:2b869a515ba6
195 $ echo b > b 195 $ echo b > b
196 $ hg ci -Aqm 'add a and b' 196 $ hg ci -Aqm 'add a and b'
197 $ echo a2 > a 197 $ echo a2 > a
198 $ hg mv b c 198 $ hg mv b c
199 $ hg ci -m 'modify a, move b to c' 199 $ hg ci -m 'modify a, move b to c'
200 $ (hg --config ui.interactive=yes split 2>&1 | grep mercurial.error) <<EOF 200 $ hg --config ui.interactive=yes split <<EOF
201 > y 201 > y
202 > y 202 > y
203 > n 203 > n
204 > y 204 > y
205 > EOF 205 > EOF
206 mercurial.error.ProgrammingError: some copy targets missing from file list 206 diff --git a/a b/a
207 1 hunks, 1 lines changed
208 examine changes to 'a'?
209 (enter ? for help) [Ynesfdaq?] y
210
211 @@ -1,1 +1,1 @@
212 -a
213 +a2
214 record this change to 'a'?
215 (enter ? for help) [Ynesfdaq?] y
216
217 diff --git a/b b/c
218 rename from b
219 rename to c
220 examine changes to 'b' and 'c'?
221 (enter ? for help) [Ynesfdaq?] n
222
223 created new head
224 diff --git a/b b/c
225 rename from b
226 rename to c
227 examine changes to 'b' and 'c'?
228 (enter ? for help) [Ynesfdaq?] y
229
230 saved backup bundle to $TESTTMP/split/.hg/strip-backup/9a396d463e04-2d9e6864-split.hg
207 $ cd .. 231 $ cd ..
208 232
209 Test committing half a rename 233 Test committing half a rename
210 234
211 $ hg init partial 235 $ hg init partial
212 $ cd partial 236 $ cd partial
213 $ echo a > a 237 $ echo a > a
214 $ hg ci -Aqm 'add a' 238 $ hg ci -Aqm 'add a'
215 $ hg mv a b 239 $ hg mv a b
216 $ hg ci -m 'remove a' a 2>&1 | grep mercurial.error 240 $ hg ci -m 'remove a' a
217 mercurial.error.ProgrammingError: some copy targets missing from file list 241 $ cd ..
218 $ cd ..