Show More
@@ -298,10 +298,10 b' def _iother(repo, mynode, orig, fcd, fco' | |||||
298 | """Uses the other `p2()` version of files as the merged version.""" |
|
298 | """Uses the other `p2()` version of files as the merged version.""" | |
299 | if fco.isabsent(): |
|
299 | if fco.isabsent(): | |
300 | # local changed, remote deleted -- 'deleted' picked |
|
300 | # local changed, remote deleted -- 'deleted' picked | |
301 | repo.wvfs.unlinkpath(fcd.path()) |
|
301 | _underlyingfctxifabsent(fcd).remove() | |
302 | deleted = True |
|
302 | deleted = True | |
303 | else: |
|
303 | else: | |
304 |
|
|
304 | _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags()) | |
305 | deleted = False |
|
305 | deleted = False | |
306 | return 0, deleted |
|
306 | return 0, deleted | |
307 |
|
307 | |||
@@ -313,9 +313,19 b' def _ifail(repo, mynode, orig, fcd, fco,' | |||||
313 | used to resolve these conflicts.""" |
|
313 | used to resolve these conflicts.""" | |
314 | # for change/delete conflicts write out the changed version, then fail |
|
314 | # for change/delete conflicts write out the changed version, then fail | |
315 | if fcd.isabsent(): |
|
315 | if fcd.isabsent(): | |
316 |
|
|
316 | _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags()) | |
317 | return 1, False |
|
317 | return 1, False | |
318 |
|
318 | |||
|
319 | def _underlyingfctxifabsent(filectx): | |||
|
320 | """Sometimes when resolving, our fcd is actually an absentfilectx, but | |||
|
321 | we want to write to it (to do the resolve). This helper returns the | |||
|
322 | underyling workingfilectx in that case. | |||
|
323 | """ | |||
|
324 | if filectx.isabsent(): | |||
|
325 | return filectx.changectx()[filectx.path()] | |||
|
326 | else: | |||
|
327 | return filectx | |||
|
328 | ||||
319 | def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None): |
|
329 | def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None): | |
320 | tool, toolpath, binary, symlink = toolconf |
|
330 | tool, toolpath, binary, symlink = toolconf | |
321 | if symlink or fcd.isabsent() or fco.isabsent(): |
|
331 | if symlink or fcd.isabsent() or fco.isabsent(): |
General Comments 0
You need to be logged in to leave comments.
Login now