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 :)
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG183df3df6031: resolve: fix mark-check when a file was deleted on one side (issue6020)
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
- 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)
Comment Actions
(not sure when I'll get to the changes, but removing from Needs Review, sorry I delayed so long doing that)
Comment Actions
Alright that test seems a bit ridiculous now that I'm looking at it in the diff, but it's at least thorough? :)