comparison tests/test-up-local-change.t @ 23477:689540e6007e stable

update: add tests for untracked local file We don't seem to have any tests for updating to another revision when there are untracked files on the local side that conflict with the those on the remote side, so let's add tests. This shows how we overwrite untracked ignored files when updating to a revision that tracks the file.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 02 Dec 2014 17:11:01 -0800
parents cb15835456cb
children 30b602168c3b
comparison
equal deleted inserted replaced
23440:57d35d3c1cf1 23477:689540e6007e
214 +++ b/a 214 +++ b/a
215 @@ -1,1 +1,1 @@ 215 @@ -1,1 +1,1 @@
216 -a2 216 -a2
217 +abc 217 +abc
218 218
219
220 test conflicting untracked files
221
222 $ hg up -qC 0
223 $ echo untracked > b
224 $ hg st
225 ? b
226 $ hg up 1
227 b: untracked file differs
228 abort: untracked files in working directory differ from files in requested revision
229 [255]
230 $ rm b
231
232 test conflicting untracked ignored file
233
234 BROKEN: the ignored file gets overwritten by the remote version
235
236 $ hg up -qC 0
237 $ echo ignored > .hgignore
238 $ hg add .hgignore
239 $ hg ci -m 'add .hgignore'
240 created new head
241 $ echo ignored > ignored
242 $ hg add ignored
243 $ hg ci -m 'add ignored file'
244
245 $ hg up -q 'desc("add .hgignore")'
246 $ echo untracked > ignored
247 $ hg st
248 $ hg up 'desc("add ignored file")'
249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 $ cat ignored
251 ignored
219 252
220 test a local add 253 test a local add
221 254
222 $ cd .. 255 $ cd ..
223 $ hg init a 256 $ hg init a