aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/vc-arch.el37
2 files changed, 42 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3ac0b618b6d..417f689726b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-10-16 Magnus Henoch <mange@freemail.hu>
2
3 * vc-arch.el (vc-arch-dir-status): New function.
4 (vc-arch-after-dir-status): New function.
5
12008-10-16 Glenn Morris <rgm@gnu.org> 62008-10-16 Glenn Morris <rgm@gnu.org>
2 7
3 * man.el (Man-getpage-in-background): Force recent `man's to output 8 * man.el (Man-getpage-in-background): Force recent `man's to output
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index cc8c8ae3c1e..c4f2c9dfc35 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -288,6 +288,43 @@ Return non-nil if FILE is unchanged."
288 'up-to-date 288 'up-to-date
289 'edited))))))))) 289 'edited)))))))))
290 290
291(defun vc-arch-dir-status (dir callback)
292 "Run 'tla inventory' for DIR and pass results to CALLBACK.
293CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
294`vc-dir-refresh'."
295 (let ((default-directory dir))
296 (vc-arch-command t 'async nil "changes"))
297 ;; The updating could be done asynchronously.
298 (vc-exec-after
299 `(vc-arch-after-dir-status ',callback)))
300
301(defun vc-arch-after-dir-status (callback)
302 (let* ((state-map '(("M " . edited)
303 ("Mb" . edited) ;binary
304 ("D " . removed)
305 ("D/" . removed) ;directory
306 ("A " . added)
307 ("A/" . added) ;directory
308 ("=>" . renamed)
309 ("/>" . renamed) ;directory
310 ("lf" . symlink-to-file)
311 ("fl" . file-to-symlink)
312 ("--" . permissions-changed)
313 ("-/" . permissions-changed) ;directory
314 ))
315 (state-map-regexp (regexp-opt (mapcar 'car state-map) t))
316 (entry-regexp (concat "^" state-map-regexp " \\(.*\\)$"))
317 result)
318 (goto-char (point-min))
319 ;;(message "Got %s" (buffer-string))
320 (while (re-search-forward entry-regexp nil t)
321 (let* ((state-string (match-string 1))
322 (state (cdr (assoc state-string state-map)))
323 (filename (match-string 2)))
324 (push (list filename state) result)))
325
326 (funcall callback result nil)))
327
291(defun vc-arch-working-revision (file) 328(defun vc-arch-working-revision (file)
292 (let* ((root (expand-file-name "{arch}" (vc-arch-root file))) 329 (let* ((root (expand-file-name "{arch}" (vc-arch-root file)))
293 (defbranch (vc-arch-default-version file))) 330 (defbranch (vc-arch-default-version file)))