(vc-context-matches-p): New function.
(vc-restore-buffer-context): Restore point and mark only if they don't match the context. (vc-revert-buffer1, vc-clear-headers): Use save-excursion to relocate point and mark, and vc-restore-buffer-context as a backup. (vc-resynch-buffer): When operating on the current buffer, don't use save-excursion, because that would undo the effects of the above functions. (vc-resynch-window): Deleted code that removed vc-find-file-hook temporarily. This was unnecessary, because find-file-hooks are not called when the buffer is reverted. (vc-register): Added comment for prev change.
Showing with 42 additions and 23 deletions