Mercurial > emacs
comparison lisp/vc-cvs.el @ 95425:72ac0c4a8ecd
(vc-cvs-state-heuristic, vc-cvs-parse-status): Try and
return `unregistered' when applicable.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 30 May 2008 16:21:49 +0000 |
parents | f362398714d9 |
children | 3a41427d46d9 |
comparison
equal
deleted
inserted
replaced
95424:f03be7461a37 | 95425:72ac0c4a8ecd |
---|---|
229 (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) | 229 (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) |
230 (lastmod (nth 5 (file-attributes file)))) | 230 (lastmod (nth 5 (file-attributes file)))) |
231 (cond | 231 (cond |
232 ((equal checkout-time lastmod) 'up-to-date) | 232 ((equal checkout-time lastmod) 'up-to-date) |
233 ((string= (vc-working-revision file) "0") 'added) | 233 ((string= (vc-working-revision file) "0") 'added) |
234 ((null checkout-time) 'unregistered) | |
234 (t 'edited)))) | 235 (t 'edited)))) |
235 | 236 |
236 (defun vc-cvs-working-revision (file) | 237 (defun vc-cvs-working-revision (file) |
237 "CVS-specific version of `vc-working-revision'." | 238 "CVS-specific version of `vc-working-revision'." |
238 ;; There is no need to consult RCS headers under CVS, because we | 239 ;; There is no need to consult RCS headers under CVS, because we |
798 (goto-char (match-end 0))) | 799 (goto-char (match-end 0))) |
799 (cond | 800 (cond |
800 ((re-search-forward "\\=\\([^ \t]+\\)" nil t) | 801 ((re-search-forward "\\=\\([^ \t]+\\)" nil t) |
801 (setq file (expand-file-name (match-string 1))) | 802 (setq file (expand-file-name (match-string 1))) |
802 (vc-file-setprop file 'vc-backend 'CVS) | 803 (vc-file-setprop file 'vc-backend 'CVS) |
803 (if (not (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)) | 804 (setq status(if (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t) |
804 (setq status "Unknown") | 805 (match-string 1) "Unknown")) |
805 (setq status (match-string 1))) | |
806 (when (and full | 806 (when (and full |
807 (re-search-forward | 807 (re-search-forward |
808 "\\(RCS Version\\|RCS Revision\\|Repository revision\\):\ | 808 "\\(RCS Version\\|RCS Revision\\|Repository revision\\):\ |
809 \[\t ]+\\([0-9.]+\\)" | 809 \[\t ]+\\([0-9.]+\\)" |
810 nil t)) | 810 nil t)) |
821 ((string-match "Needs \\(Checkout\\|Patch\\)" status) | 821 ((string-match "Needs \\(Checkout\\|Patch\\)" status) |
822 (if missing 'missing 'needs-update)) | 822 (if missing 'missing 'needs-update)) |
823 ((string-match "Locally Added" status) 'added) | 823 ((string-match "Locally Added" status) 'added) |
824 ((string-match "Locally Removed" status) 'removed) | 824 ((string-match "Locally Removed" status) 'removed) |
825 ((string-match "File had conflicts " status) 'conflict) | 825 ((string-match "File had conflicts " status) 'conflict) |
826 ((string-match "Unknown" status) 'unregistered) | |
826 (t 'edited)))))))) | 827 (t 'edited)))))))) |
827 | 828 |
828 (defun vc-cvs-after-dir-status (update-function) | 829 (defun vc-cvs-after-dir-status (update-function) |
829 ;; Heavily inspired by vc-cvs-parse-status. AKA a quick hack. | 830 ;; Heavily inspired by vc-cvs-parse-status. AKA a quick hack. |
830 ;; This needs a lot of testing. | 831 ;; This needs a lot of testing. |