From af857b4d5007444d901b6825b5c2a8027036406e Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Tue, 17 Nov 2009 08:06:39 -0800 Subject: [PATCH] * 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] --- vc-p4.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vc-p4.el b/vc-p4.el index 3c47d05..e1d88bf 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -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))))