Show More
@@ -313,16 +313,15 b' class _mergestate_base(object):' | |||||
313 | """return extras stored with the mergestate for the given filename""" |
|
313 | """return extras stored with the mergestate for the given filename""" | |
314 | return self._stateextras[filename] |
|
314 | return self._stateextras[filename] | |
315 |
|
315 | |||
316 |
def _resolve(self, |
|
316 | def _resolve(self, dfile, wctx): | |
317 | """rerun merge process for file path `dfile`. |
|
317 | """rerun merge process for file path `dfile`. | |
318 | Returns whether the merge was completed and the return value of merge |
|
318 | Returns the return value of merge obtained from filemerge._filemerge(). | |
319 | obtained from filemerge._filemerge(). |
|
|||
320 | """ |
|
319 | """ | |
321 | if self[dfile] in ( |
|
320 | if self[dfile] in ( | |
322 | MERGE_RECORD_RESOLVED, |
|
321 | MERGE_RECORD_RESOLVED, | |
323 | LEGACY_RECORD_DRIVER_RESOLVED, |
|
322 | LEGACY_RECORD_DRIVER_RESOLVED, | |
324 | ): |
|
323 | ): | |
325 |
return |
|
324 | return 0 | |
326 | stateentry = self._state[dfile] |
|
325 | stateentry = self._state[dfile] | |
327 | state, localkey, lfile, afile, anode, ofile, onode, flags = stateentry |
|
326 | state, localkey, lfile, afile, anode, ofile, onode, flags = stateentry | |
328 | octx = self._repo[self._other] |
|
327 | octx = self._repo[self._other] | |
@@ -341,33 +340,31 b' class _mergestate_base(object):' | |||||
341 | fla = fca.flags() |
|
340 | fla = fca.flags() | |
342 | if b'x' in flags + flo + fla and b'l' not in flags + flo + fla: |
|
341 | if b'x' in flags + flo + fla and b'l' not in flags + flo + fla: | |
343 | if fca.rev() == nullrev and flags != flo: |
|
342 | if fca.rev() == nullrev and flags != flo: | |
344 |
|
|
343 | self._repo.ui.warn( | |
345 |
|
|
344 | _( | |
346 | _( |
|
345 | b'warning: cannot merge flags for %s ' | |
347 |
|
|
346 | b'without common ancestor - keeping local flags\n' | |
348 | b'without common ancestor - keeping local flags\n' |
|
|||
349 | ) |
|
|||
350 | % afile |
|
|||
351 | ) |
|
347 | ) | |
|
348 | % afile | |||
|
349 | ) | |||
352 | elif flags == fla: |
|
350 | elif flags == fla: | |
353 | flags = flo |
|
351 | flags = flo | |
354 |
|
|
352 | # restore local | |
355 | # restore local |
|
353 | if localkey != self._repo.nodeconstants.nullhex: | |
356 | if localkey != self._repo.nodeconstants.nullhex: |
|
354 | self._restore_backup(wctx[dfile], localkey, flags) | |
357 | self._restore_backup(wctx[dfile], localkey, flags) |
|
|||
358 | else: |
|
|||
359 | wctx[dfile].remove(ignoremissing=True) |
|
|||
360 | complete, merge_ret, deleted = filemerge.premerge( |
|
|||
361 | self._repo, |
|
|||
362 | wctx, |
|
|||
363 | self._local, |
|
|||
364 | lfile, |
|
|||
365 | fcd, |
|
|||
366 | fco, |
|
|||
367 | fca, |
|
|||
368 | labels=self._labels, |
|
|||
369 | ) |
|
|||
370 | else: |
|
355 | else: | |
|
356 | wctx[dfile].remove(ignoremissing=True) | |||
|
357 | complete, merge_ret, deleted = filemerge.premerge( | |||
|
358 | self._repo, | |||
|
359 | wctx, | |||
|
360 | self._local, | |||
|
361 | lfile, | |||
|
362 | fcd, | |||
|
363 | fco, | |||
|
364 | fca, | |||
|
365 | labels=self._labels, | |||
|
366 | ) | |||
|
367 | if not complete: | |||
371 | complete, merge_ret, deleted = filemerge.filemerge( |
|
368 | complete, merge_ret, deleted = filemerge.filemerge( | |
372 | self._repo, |
|
369 | self._repo, | |
373 | wctx, |
|
370 | wctx, | |
@@ -406,16 +403,13 b' class _mergestate_base(object):' | |||||
406 | # else: regular merges (no action necessary) |
|
403 | # else: regular merges (no action necessary) | |
407 | self._results[dfile] = merge_ret, action |
|
404 | self._results[dfile] = merge_ret, action | |
408 |
|
405 | |||
409 |
return |
|
406 | return merge_ret | |
410 |
|
407 | |||
411 | def resolve(self, dfile, wctx): |
|
408 | def resolve(self, dfile, wctx): | |
412 | """run merge process for dfile |
|
409 | """run merge process for dfile | |
413 |
|
410 | |||
414 | Returns the exit code of the merge.""" |
|
411 | Returns the exit code of the merge.""" | |
415 |
|
|
412 | return self._resolve(dfile, wctx) | |
416 | if not complete: |
|
|||
417 | r = self._resolve(False, dfile, wctx)[1] |
|
|||
418 | return r |
|
|||
419 |
|
413 | |||
420 | def counts(self): |
|
414 | def counts(self): | |
421 | """return counts for updated, merged and removed files in this |
|
415 | """return counts for updated, merged and removed files in this |
General Comments 0
You need to be logged in to leave comments.
Login now