CJQZS55XMIRTZLR36D3LWIBGXW7AV4AX5ANSB44RHXADDMAEMFVQC
((or (null rev) (eq rev t) (equal rev "")) nil)
((not off-by-one)
(cond
((vc-darcs-hash-p rev) rev)
(t (car (last (vc-darcs-changes files "--patch" rev))))))
(t
(let ((flags
(if (vc-darcs-hash-p rev)
(list "--from-match" (concat "hash " rev))
(list "--from-patch" rev))))
(let ((changes (apply #'vc-darcs-changes files flags)))
(and (cdr changes) (car (last changes 2))))))))
((or (null rev) (eq rev t) (equal rev "")) nil)
((not off-by-one)
(cond
((vc-darcs-hash-p rev) rev)
(t (car (last (vc-darcs-changes files "--patch" rev))))))
(t
(let ((flags
(if (vc-darcs-hash-p rev)
(list "--from-match" (concat "hash " rev))
(list "--from-patch" rev))))
(let ((changes (apply #'vc-darcs-changes files flags)))
(and (cdr changes) (car (last changes 2))))))))
((vc-darcs-special-file-p file)
;; If vc-directory-exclusion-list is set incorrectly, vc-dired will
;; query us for all the files under _darcs. Get rid of them quickly.
nil)
(t
(when (vc-darcs-root file)
(let* ((file (expand-file-name file))
(root (vc-darcs-root file))
(default-directory (file-name-directory file)))
(with-temp-buffer
(catch 'found
(condition-case nil
(vc-do-command t nil vc-darcs-program-name
nil "show" "files")
(error (throw 'found nil)))
(goto-char (point-min))
(while (looking-at "[^\n]+")
;; Darcs always prints relative to the root
(let ((file2 (expand-file-name (match-string 0) root)))
(when (equal file2 file)
(throw 'found t))
(forward-line)))
nil)))))))
((vc-darcs-special-file-p file)
;; If vc-directory-exclusion-list is set incorrectly, vc-dired will
;; query us for all the files under _darcs. Get rid of them quickly.
nil)
(t
(when (vc-darcs-root file)
(let* ((file (expand-file-name file))
(root (vc-darcs-root file))
(default-directory (file-name-directory file)))
(with-temp-buffer
(catch 'found
(condition-case nil
(vc-do-command t nil vc-darcs-program-name
nil "show" "files")
(error (throw 'found nil)))
(goto-char (point-min))
(while (looking-at "[^\n]+")
;; Darcs always prints relative to the root
(let ((file2 (expand-file-name (match-string 0) root)))
(when (equal file2 file)
(throw 'found t))
(forward-line)))
nil)))))))
((looking-at "No changes")
(if (vc-darcs-registered file) 'up-to-date 'unregistered))
((looking-at "\\([A-Z]\\)!? ")
(vc-darcs-parse-summary (match-string 1)))
((looking-at " * \\([^ \n]+\\) *-> *\\([^ \n]+\\)")
;; The paths printed by Darcs are relative to the root
(let* ((root (vc-darcs-root file))
(f (expand-file-name file))
(f1 (expand-file-name (match-string 1) root))
(f2 (expand-file-name (match-string 2) root)))
(cond
((equal f f1) 'removed)
((equal f f2) 'added)
(t nil))))
(t nil))))
((looking-at "No changes")
(if (vc-darcs-registered file) 'up-to-date 'unregistered))
((looking-at "\\([A-Z]\\)!? ")
(vc-darcs-parse-summary (match-string 1)))
((looking-at " * \\([^ \n]+\\) *-> *\\([^ \n]+\\)")
;; The paths printed by Darcs are relative to the root
(let* ((root (vc-darcs-root file))
(f (expand-file-name file))
(f1 (expand-file-name (match-string 1) root))
(f2 (expand-file-name (match-string 2) root)))
(cond
((equal f f1) 'removed)
((equal f f2) 'added)
(t nil))))
(t nil))))
(doit #'(lambda (file status)
;; The paths printed by Darcs are relative to the root
(let ((path (file-relative-name
(expand-file-name file root))))
(unless (file-directory-p path)
(push (list path status nil) l)
(setq files (delete path files)))))))
(doit #'(lambda (file status)
;; The paths printed by Darcs are relative to the root
(let ((path (file-relative-name
(expand-file-name file root))))
(unless (file-directory-p path)
(push (list path status nil) l)
(setq files (delete path files)))))))
((looking-at "\\([A-Z]\\)!? \\([^ \n]+\\)")
(funcall doit (match-string 2)
(vc-darcs-parse-summary (match-string 1))))
((looking-at " * \\([^ \n]+\\) *-> *\\([^ \n]+\\)")
(funcall doit (match-string 1) 'removed)
(funcall doit (match-string 2) 'added)))
(forward-line))
((looking-at "\\([A-Z]\\)!? \\([^ \n]+\\)")
(funcall doit (match-string 2)
(vc-darcs-parse-summary (match-string 1))))
((looking-at " * \\([^ \n]+\\) *-> *\\([^ \n]+\\)")
(funcall doit (match-string 1) 'removed)
(funcall doit (match-string 2) 'added)))
(forward-line))
(require 'add-log)
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-file-re) "\\`a\\`")
(set (make-local-variable 'log-view-message-re)
"^ \\* \\(.+\\)")
(set (make-local-variable 'log-view-font-lock-keywords)
'(("^\\([A-Z][a-z][a-z] .*[0-9]\\) \\([^<>]+\\) \\(<[^<>]+>\\)"
(1 'change-log-date)
(2 'change-log-name)
(3 'change-log-email))))
)
(require 'add-log)
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-file-re) "\\`a\\`")
(set (make-local-variable 'log-view-message-re)
"^ \\* \\(.+\\)")
(set (make-local-variable 'log-view-font-lock-keywords)
'(("^\\([A-Z][a-z][a-z] .*[0-9]\\) \\([^<>]+\\) \\(<[^<>]+>\\)"
(1 'change-log-date)
(2 'change-log-name)
(3 'change-log-email))))
)
((equal rev (car (vc-darcs-changes log-view-vc-fileset "--max-count" "1")))
(goto-char (point-min))
(re-search-forward log-view-message-re)
(beginning-of-line))
(t
nil)))
((equal rev (car (vc-darcs-changes log-view-vc-fileset "--max-count" "1")))
(goto-char (point-min))
(re-search-forward log-view-message-re)
(beginning-of-line))
(t
nil)))
(with-temp-buffer
(vc-do-command t 0 vc-darcs-program-name file
"changes" "--xml"
"--from-match" (concat "hash " rev)
"--to-match" (concat "hash " rev))
(xml-parse-region 1 (point-max))))
(patch
(if (not (eq 'changelog (caar xml)))
(error "Unexpected output from darcs changes --xml")
(nth 3 (car xml)))))
(with-temp-buffer
(vc-do-command t 0 vc-darcs-program-name file
"changes" "--xml"
"--from-match" (concat "hash " rev)
"--to-match" (concat "hash " rev))
(xml-parse-region 1 (point-max))))
(patch
(if (not (eq 'changelog (caar xml)))
(error "Unexpected output from darcs changes --xml")
(nth 3 (car xml)))))
(goto-char (point-min))
(while (looking-at "^\\([-0-9a-f]+\\)\\.gz | \\(.*\\)$")
(push (cons (match-string 1) (match-string 2)) output)
(forward-line 1))
(nreverse output)))))
(goto-char (point-min))
(while (looking-at "^\\([-0-9a-f]+\\)\\.gz | \\(.*\\)$")
(push (cons (match-string 1) (match-string 2)) output)
(forward-line 1))
(nreverse output)))))
(and (fboundp 'make-progress-reporter)
(make-progress-reporter "Annotating..."
1 (length data))))
(count 0)
(now (vc-annotate-convert-time (current-time)))
(cache '()))
(and (fboundp 'make-progress-reporter)
(make-progress-reporter "Annotating..."
1 (length data))))
(count 0)
(now (vc-annotate-convert-time (current-time)))
(cache '()))
(let* ((rev (car e))
(line (cdr e))
(alist (or (cdr (assoc rev cache))
(let ((a (vc-darcs-alist-from-rev file rev)))
(push (cons rev a) cache)
a)))
(author (cdr (assoc 'author alist)))
(date (cdr (assoc 'date alist)))
(year (substring date 0 4))
(month (substring date 4 6))
(day (substring date 6 8))
(hour (substring date 8 10))
(min (substring date 10 12))
(sec (substring date 12 14))
(time (vc-annotate-convert-time
(encode-time
(vc-darcs-parse-integer sec)
(vc-darcs-parse-integer min)
(vc-darcs-parse-integer hour)
(vc-darcs-parse-integer day)
(vc-darcs-parse-integer month)
(vc-darcs-parse-integer year))))
(begin (point)))
(cond
((string-match "<\\([^ <>@]*\\)@.*>" author)
(setq author (match-string 1 author)))
((string-match "[^ <>@]*" author)
(setq author (match-string 0 author))))
(insert (format "%-7s "
(if (> (length author) 7)
(substring author 0 7)
author)))
(insert
(if (> (- now time) 0.9)
(format "%s/%s/%s " day month (substring year 2 4))
(format "%s:%s:%s " hour min sec)))
(insert line)
(insert "\n")
(add-text-properties
begin (point)
(list 'vc-darcs-annotate (cons rev time))))
(setq count (+ count 1))
(when reporter
(progress-reporter-update reporter count)))
(when reporter
(progress-reporter-done reporter))))))
(let* ((rev (car e))
(line (cdr e))
(alist (or (cdr (assoc rev cache))
(let ((a (vc-darcs-alist-from-rev file rev)))
(push (cons rev a) cache)
a)))
(author (cdr (assoc 'author alist)))
(date (cdr (assoc 'date alist)))
(year (substring date 0 4))
(month (substring date 4 6))
(day (substring date 6 8))
(hour (substring date 8 10))
(min (substring date 10 12))
(sec (substring date 12 14))
(time (vc-annotate-convert-time
(encode-time
(vc-darcs-parse-integer sec)
(vc-darcs-parse-integer min)
(vc-darcs-parse-integer hour)
(vc-darcs-parse-integer day)
(vc-darcs-parse-integer month)
(vc-darcs-parse-integer year))))
(begin (point)))
(cond
((string-match "<\\([^ <>@]*\\)@.*>" author)
(setq author (match-string 1 author)))
((string-match "[^ <>@]*" author)
(setq author (match-string 0 author))))
(insert (format "%-7s "
(if (> (length author) 7)
(substring author 0 7)
author)))
(insert
(if (> (- now time) 0.9)
(format "%s/%s/%s " day month (substring year 2 4))
(format "%s:%s:%s " hour min sec)))
(insert line)
(insert "\n")
(add-text-properties
begin (point)
(list 'vc-darcs-annotate (cons rev time))))
(setq count (+ count 1))
(when reporter
(progress-reporter-update reporter count)))
(when reporter
(progress-reporter-done reporter))))))
(open-instead
(find-alternate-file candidate))
(t
(setq buffer-read-only t)
(push '(:propertize "_DARCS-FILE:" face font-lock-warning-face)
mode-line-buffer-identification)))))))
(open-instead
(find-alternate-file candidate))
(t
(setq buffer-read-only t)
(push '(:propertize "_DARCS-FILE:" face font-lock-warning-face)
mode-line-buffer-identification)))))))