Function: vc-svn-after-dir-status

vc-svn-after-dir-status is a byte-compiled function defined in vc-svn.el.gz.

Signature

(vc-svn-after-dir-status CALLBACK &optional REMOTE)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-svn.el.gz
;; FIXME it would be better not to have the "remote" argument,
;; but to distinguish the two output formats based on content.
;; FIXME: the local format isn't used by the (sole) caller anymore.
(defun vc-svn-after-dir-status (callback &optional remote)
  (let ((state-map '((?A . added)
                     (?C . conflict)
                     (?I . ignored)
                     (?M . edited)
                     (?D . removed)
                     (?R . removed)
                     (?! . needs-update)
                     (?? . unregistered)
                     ;; This is what vc-svn-parse-status does.
                     (?~ . edited)))
	(re (if remote "^\\(.\\)\\(.\\).....? \\([ *]\\) +\\(?:[-0-9]+\\)?   \\(.*\\)$"
	      ;; Subexp 3 is a dummy in this case, so the numbers match.
	      "^\\(.\\)\\(.\\)...\\(.\\).? \\(.*\\)$"))
       result)
    (goto-char (point-min))
    (while (re-search-forward re nil t)
      (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
            (propstat (cdr (assq (aref (match-string 2) 0) state-map)))
            (filename (if (memq system-type '(windows-nt ms-dos))
                          (string-replace "\\" "/" (match-string 4))
                        (match-string 4))))
        (and (memq propstat '(conflict edited))
             (not (eq state 'conflict)) ; conflict always wins
             (setq state propstat))
	(and remote (string-equal (match-string 3) "*")
	     ;; FIXME are there other possible combinations?
	     (cond ((eq state 'edited) (setq state 'needs-merge))
		   ((not state) (setq state 'needs-update))))
	(when (and state (not (string= "." filename)))
         (setq result (cons (list filename state) result)))))
    (funcall callback result)))