resolve: fix mark-check when a file was deleted on one side (issue6020)
Changes PlannedPublic

Authored by spectral on Wed, Nov 7, 6:45 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

wvfs.open raises an error if one of the files does not exist. Ignoring the error
if it's ENOENT is done in several other places in this code, so I'm in good
company :)

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped
spectral created this revision.Wed, Nov 7, 6:45 PM
yuja added a subscriber: yuja.Thu, Nov 8, 6:45 AM
  • with repo.wvfs(f) as fobj:
  • fdata = fobj.read() + try: + with repo.wvfs(f) as fobj: + fdata = fobj.read() + except (IOError, OSError) as inst: + if inst.errno != errno.ENOENT: + raise

'fdata' can be undefined here. Appears that the test doesn't go through this
case.

Perhaps, wvfs.tryread() can be used instead.

if filemerge.hasconflictmarkers(fdata) and \
    ms[f] != mergemod.MERGE_RECORD_RESOLVED:
    hasconflictmarkers.append(f)
spectral planned changes to this revision.Tue, Nov 13, 9:23 PM

(not sure when I'll get to the changes, but removing from Needs Review, sorry I delayed so long doing that)