* 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:
parent
2e8b1f0015
commit
af857b4d50
1 changed files with 7 additions and 1 deletions
8
vc-p4.el
8
vc-p4.el
|
@ -331,7 +331,13 @@ comment COMMENT."
|
||||||
(defun vc-p4-revert (file contents-done)
|
(defun vc-p4-revert (file contents-done)
|
||||||
"Revert FILE in Perforce. Ignores CONTENTS-DONE."
|
"Revert FILE in Perforce. Ignores CONTENTS-DONE."
|
||||||
(let ((action (vc-file-getprop file 'vc-p4-action)))
|
(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")
|
(if (string= action "add")
|
||||||
(vc-file-clearprops file)
|
(vc-file-clearprops file)
|
||||||
(vc-p4-state file nil t))))
|
(vc-p4-state file nil t))))
|
||||||
|
|
Loading…
Reference in a new issue