2739 |
;; `registered' might have switched under us. |
;; `registered' might have switched under us. |
2740 |
(vc-switch-backend file old-backend) |
(vc-switch-backend file old-backend) |
2741 |
(let* ((rev (vc-workfile-version file)) |
(let* ((rev (vc-workfile-version file)) |
2742 |
(modified-file (and edited (make-temp-name file))) |
(modified-file (and edited (make-temp-file file))) |
2743 |
(unmodified-file (and modified-file (vc-version-backup-file file)))) |
(unmodified-file (and modified-file (vc-version-backup-file file)))) |
2744 |
;; Go back to the base unmodified file. |
;; Go back to the base unmodified file. |
2745 |
(unwind-protect |
(unwind-protect |
2746 |
(progn |
(progn |
2747 |
(when modified-file |
(when modified-file |
2748 |
(copy-file file modified-file) |
(copy-file file modified-file 'ok-if-already-exists) |
2749 |
;; If we have a local copy of the unmodified file, handle that |
;; If we have a local copy of the unmodified file, handle that |
2750 |
;; here and not in vc-revert-file because we don't want to |
;; here and not in vc-revert-file because we don't want to |
2751 |
;; delete that copy -- it is still useful for OLD-BACKEND. |
;; delete that copy -- it is still useful for OLD-BACKEND. |
2886 |
(let ((odefault default-directory) |
(let ((odefault default-directory) |
2887 |
(changelog (find-change-log)) |
(changelog (find-change-log)) |
2888 |
;; Presumably not portable to non-Unixy systems, along with rcs2log: |
;; Presumably not portable to non-Unixy systems, along with rcs2log: |
2889 |
(tempfile (funcall |
(tempfile (make-temp-file |
|
(if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name) |
|
2890 |
(expand-file-name "vc" |
(expand-file-name "vc" |
2891 |
(or small-temporary-file-directory |
(or small-temporary-file-directory |
2892 |
temporary-file-directory)))) |
temporary-file-directory)))) |