comparison tests/test-up-local-change.t @ 23478:30b602168c3b stable

update: don't overwrite untracked ignored files on update When looking for untracked files that would conflict with a tracked file in the target revision (or the remote side of a merge), we explcitly exclude ignored files. The code was added in 7e30f5f2285f (merge: refactor unknown file conflict checking, 2012-02-09), but it seems like only unknown, not ignored, files were considered since the beginning of time. Although ignored files are mostly build outputs and backup files, we should still not overwrite them. Fix by simply removing the explicit check.
author Martin von Zweigbergk <martinvonz@google.com>
date Sun, 16 Nov 2014 23:41:44 -0800
parents 689540e6007e
children 406dfc63a1ad
comparison
equal deleted inserted replaced
23477:689540e6007e 23478:30b602168c3b
229 [255] 229 [255]
230 $ rm b 230 $ rm b
231 231
232 test conflicting untracked ignored file 232 test conflicting untracked ignored file
233 233
234 BROKEN: the ignored file gets overwritten by the remote version
235
236 $ hg up -qC 0 234 $ hg up -qC 0
237 $ echo ignored > .hgignore 235 $ echo ignored > .hgignore
238 $ hg add .hgignore 236 $ hg add .hgignore
239 $ hg ci -m 'add .hgignore' 237 $ hg ci -m 'add .hgignore'
240 created new head 238 created new head
244 242
245 $ hg up -q 'desc("add .hgignore")' 243 $ hg up -q 'desc("add .hgignore")'
246 $ echo untracked > ignored 244 $ echo untracked > ignored
247 $ hg st 245 $ hg st
248 $ hg up 'desc("add ignored file")' 246 $ hg up 'desc("add ignored file")'
249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 247 ignored: untracked file differs
250 $ cat ignored 248 abort: untracked files in working directory differ from files in requested revision
251 ignored 249 [255]
252 250
253 test a local add 251 test a local add
254 252
255 $ cd .. 253 $ cd ..
256 $ hg init a 254 $ hg init a