* vc-p4.el (vc-p4-revert): Fix revert of unopened files.

[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7486]
This commit is contained in:
Magnus Henoch 2009-11-17 08:06:39 -08:00
parent 2e8b1f0015
commit af857b4d50

View file

@ -331,7 +331,13 @@ comment COMMENT."
(defun vc-p4-revert (file contents-done)
"Revert FILE in Perforce. Ignores CONTENTS-DONE."
(let ((action (vc-file-getprop file 'vc-p4-action)))
(p4-lowlevel-revert file)
(cond
((null action)
;; If Perforce doesn't believe that we edited the file, we have
;; to use sync instead of revert.
(p4-lowlevel-sync file (vc-working-revision file) t))
(t
(p4-lowlevel-revert file)))
(if (string= action "add")
(vc-file-clearprops file)
(vc-p4-state file nil t))))