comparison mercurial/filemerge.py @ 21100:098a274764b3

filemerge: better handling of failing remove of temporary files We have seen some failures on Windows that could seem like the unlinks of temporary files were failing. That could perhaps be because the merge tool somehow still held the files open. Instead of the bare bone os.unlink, use our util.unlink with special rename/retry handling on Windows.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 17 Apr 2014 14:54:46 +0200
parents 89b2336e5ccf
children 20b8090d8125
comparison
equal deleted inserted replaced
21099:12c7cea6235c 21100:098a274764b3
332 if not needcheck: 332 if not needcheck:
333 if r: 333 if r:
334 if onfailure: 334 if onfailure:
335 ui.warn(onfailure % fd) 335 ui.warn(onfailure % fd)
336 else: 336 else:
337 os.unlink(back) 337 util.unlink(back)
338 338
339 os.unlink(b) 339 util.unlink(b)
340 os.unlink(c) 340 util.unlink(c)
341 return r 341 return r
342 342
343 if not r and (_toolbool(ui, tool, "checkconflicts") or 343 if not r and (_toolbool(ui, tool, "checkconflicts") or
344 'conflicts' in _toollist(ui, tool, "check")): 344 'conflicts' in _toollist(ui, tool, "check")):
345 if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(), 345 if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(),
366 366
367 if r: 367 if r:
368 if onfailure: 368 if onfailure:
369 ui.warn(onfailure % fd) 369 ui.warn(onfailure % fd)
370 else: 370 else:
371 os.unlink(back) 371 util.unlink(back)
372 372
373 os.unlink(b) 373 util.unlink(b)
374 os.unlink(c) 374 util.unlink(c)
375 return r 375 return r
376 376
377 # tell hggettext to extract docstrings from these functions: 377 # tell hggettext to extract docstrings from these functions:
378 i18nfunctions = internals.values() 378 i18nfunctions = internals.values()