Continuously update state on opened files
Automatically checking out files is all well and good, but there’s a problem; frequently
in the course of working on files, before you commit, files will go through a number of different
states. You may edit a file, then delete it, and then re-add it unchanged all before trying to commit.
At the end of the process in the case above nothing should happen, but if you edit a file
and never revisit it you are stuck with that initial edit.
Pulse now runs a non-destructive revert on files when it receives an event notification. This resets
the working state so that if there is a major change (from edit -> delete) we can properly catch it and
tell the system. It also is handy for dealing with added files that you then delete.
There are edge cases with this code that I’m confident are not handled correctly. The good news is
nothing should be destructive; the worse that happens is you revert -k everything and re-run reconcile.