Page MenuHomePhabricator

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

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


Summary 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

rHG Mercurial
Lint Skipped
Unit Tests Skipped

Event Timeline

spectral created this revision.Nov 7 2018, 6:45 PM
yuja added a subscriber: yuja.Nov 8 2018, 6:45 AM
  • with repo.wvfs(f) as fobj:
  • fdata =

+ try:
+ with repo.wvfs(f) as fobj:
+ fdata =
+ 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

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

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

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

spectral updated this revision to Diff 13298.Jan 16 2019, 3:49 PM

Alright that test seems a bit ridiculous now that I'm looking at it in the diff, but it's at least thorough? :)

yuja added a comment.Jan 17 2019, 8:17 AM

Queued, thanks.

Replaced all [[ -f ]] with [ -f ]. `[[]]` requires Bash.

This revision was automatically updated to reflect the committed changes.