error: add a structured exception for unsupported merge records
We're going to use this in summary to print a better error message.
dirstate: back out
502b56a9e897
Superseded by the parent of this commit.
osutil: make statfiles check for interrupts periodically
This is a simpler and faster fix for
issue4878 than the contortions
performed in
502b56a9e897.
osutil: don't leak on statfiles error
Found using the power of the mighty eyeball.
histedit: extracts _isdirtywc function
Checking if working copy is dirty was done in few places, this
patch extracts it in _isdirtywc procedure.
node: add 'nullhex', hex-encoded nullid
We're going to need this for upcoming changes, because the merge state stores
nodes as hex strings.
filemerge: introduce class whose objects represent files not in a context
Most code is going to barf at the return values here (particularly from data
and size), so we restrict it to the filemerge code.
This is already somewhat supported via:
ctx.filectx(f, fileid=nullid)
Indeed, for add/add conflicts (ancestor doesn't have the file) we use precisely
that. However, that is broken in subtle ways:
- The cmp() function in filectx returns False (identical) for such a filectx
when compared to a zero-length file.
- size() returns 0 rather than some sort of value indicating that the file isn't
present.
- data() returns '' rather than some sort of value indicating that the file isn't
present.
Given the relatively niche use of such filectxes, this seems to be the simplest
way to fix all these issues.