From 1391eebeb5dbcc5afa8e020e4c0c6f40abbb1a2b Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Wed, 27 May 2009 05:53:57 -0800 Subject: [PATCH] (vc-p4-dir-status): Initial implementation. [git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7232] --- vc-p4.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vc-p4.el b/vc-p4.el index 4fbd9de..00aa4d0 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -310,6 +310,23 @@ Perforce and sets the appropriate VC properties." (not (string= this-action "delete"))) (vc-p4-state this-file this-list))))) +(defun vc-p4-dir-status (dir update-function) + "Find information for `vc-dir'." + ;; XXX: this should be asynchronous. + (let ((lists (p4-lowlevel-fstat (format "%s/*" (expand-file-name dir)) nil t))) + (when (stringp (caar lists)) + (setq lists (list lists))) + (dolist (this-list lists) + (let ((this-file (cdr (assoc "clientFile" this-list))) + (this-action (cdr (assoc "action" this-list)))) + (when this-action + (funcall update-function + (list + (list (file-relative-name this-file dir) + (intern this-action))) + t)))) + (funcall update-function nil nil))) + (defun vc-p4-workfile-version (file) "Returns the Perforce version of FILE." (vc-p4-state file)