89 |
The value can also be a regular expression or list of regular |
The value can also be a regular expression or list of regular |
90 |
expressions to match against the host name of a repository; then VC |
expressions to match against the host name of a repository; then VC |
91 |
only stays local for hosts that match it. Alternatively, the value |
only stays local for hosts that match it. Alternatively, the value |
92 |
can be a list of regular expressions where the first element is the |
can be a list of regular expressions where the first element is the |
93 |
symbol `except'; then VC always stays local except for hosts matched |
symbol `except'; then VC always stays local except for hosts matched |
94 |
by these regular expressions." |
by these regular expressions." |
95 |
:type '(choice (const :tag "Always stay local" t) |
:type '(choice (const :tag "Always stay local" t) |
96 |
(const :tag "Don't stay local" nil) |
(const :tag "Don't stay local" nil) |
97 |
(list :format "\nExamine hostname and %v" :tag "Examine hostname ..." |
(list :format "\nExamine hostname and %v" :tag "Examine hostname ..." |
98 |
(set :format "%v" :inline t (const :format "%t" :tag "don't" except)) |
(set :format "%v" :inline t (const :format "%t" :tag "don't" except)) |
99 |
(regexp :format " stay local,\n%t: %v" :tag "if it matches") |
(regexp :format " stay local,\n%t: %v" :tag "if it matches") |
100 |
(repeat :format "%v%i\n" :inline t (regexp :tag "or")))) |
(repeat :format "%v%i\n" :inline t (regexp :tag "or")))) |
152 |
;;; Internal variables |
;;; Internal variables |
153 |
;;; |
;;; |
154 |
|
|
|
(defvar vc-cvs-local-month-numbers |
|
|
'(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) |
|
|
("May" . 5) ("Jun" . 6) ("Jul" . 7) ("Aug" . 8) |
|
|
("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12)) |
|
|
"Local association list of month numbers.") |
|
|
|
|
155 |
|
|
156 |
;;; |
;;; |
157 |
;;; State-querying functions |
;;; State-querying functions |
584 |
(defun vc-cvs-annotate-command (file buffer &optional version) |
(defun vc-cvs-annotate-command (file buffer &optional version) |
585 |
"Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER. |
"Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER. |
586 |
Optional arg VERSION is a version to annotate from." |
Optional arg VERSION is a version to annotate from." |
587 |
(vc-cvs-command buffer 0 file "annotate" (if version (concat "-r" version)))) |
(vc-cvs-command buffer 0 file "annotate" (if version (concat "-r" version))) |
588 |
|
(with-current-buffer buffer |
589 |
|
(goto-char (point-min)) |
590 |
|
(re-search-forward "^[0-9]") |
591 |
|
(delete-region (point-min) (1- (point))))) |
592 |
|
|
593 |
(defun vc-cvs-annotate-current-time () |
(defun vc-cvs-annotate-current-time () |
594 |
"Return the current time, based at midnight of the current day, and |
"Return the current time, based at midnight of the current day, and |
599 |
(defun vc-cvs-annotate-time () |
(defun vc-cvs-annotate-time () |
600 |
"Return the time of the next annotation (as fraction of days) |
"Return the time of the next annotation (as fraction of days) |
601 |
systime, or nil if there is none." |
systime, or nil if there is none." |
602 |
(let ((time-stamp |
(let* ((bol (point)) |
603 |
"^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ")) |
(cache (get-text-property bol 'vc-cvs-annotate-time)) |
604 |
(if (looking-at time-stamp) |
buffer-read-only) |
605 |
(progn |
(cond |
606 |
(let* ((day (string-to-number (match-string 1))) |
(cache) |
607 |
(month (cdr (assoc (match-string 2) |
((looking-at |
608 |
vc-cvs-local-month-numbers))) |
"^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ") |
609 |
(year-tmp (string-to-number (match-string 3))) |
(let ((day (string-to-number (match-string 1))) |
610 |
;; Years 0..68 are 2000..2068. |
(month (cdr (assq (intern (match-string 2)) |
611 |
;; Years 69..99 are 1969..1999. |
'((Jan . 1) (Feb . 2) (Mar . 3) |
612 |
(year (+ (cond ((> 69 year-tmp) 2000) |
(Apr . 4) (May . 5) (Jun . 6) |
613 |
((> 100 year-tmp) 1900) |
(Jul . 7) (Aug . 8) (Sep . 9) |
614 |
(t 0)) |
(Oct . 10) (Nov . 11) (Dec . 12))))) |
615 |
year-tmp))) |
(year (let ((tmp (string-to-number (match-string 3)))) |
616 |
(goto-char (match-end 0)) ; Position at end makes for nicer overlay result |
;; Years 0..68 are 2000..2068. |
617 |
(vc-annotate-convert-time (encode-time 0 0 0 day month year)))) |
;; Years 69..99 are 1969..1999. |
618 |
;; If we did not look directly at an annotation, there might be |
(+ (cond ((> 69 tmp) 2000) |
619 |
;; some further down. This is the case if we are positioned at |
((> 100 tmp) 1900) |
620 |
;; the very top of the buffer, for instance. |
(t 0)) |
621 |
(if (re-search-forward time-stamp nil t) |
tmp)))) |
622 |
(progn |
(put-text-property |
623 |
(beginning-of-line nil) |
bol (1+ bol) 'vc-cvs-annotate-time |
624 |
(vc-cvs-annotate-time)))))) |
(setq cache (cons |
625 |
|
;; Position at end makes for nicer overlay result. |
626 |
|
(match-end 0) |
627 |
|
(vc-annotate-convert-time |
628 |
|
(encode-time 0 0 0 day month year)))))))) |
629 |
|
(when cache |
630 |
|
(goto-char (car cache)) ; fontify from here to eol |
631 |
|
(cdr cache)))) ; days (float) |
632 |
|
|
633 |
(defun vc-cvs-annotate-extract-revision-at-line () |
(defun vc-cvs-annotate-extract-revision-at-line () |
634 |
(save-excursion |
(save-excursion |
844 |
(let ((coding-system-for-read (or file-name-coding-system |
(let ((coding-system-for-read (or file-name-coding-system |
845 |
default-file-name-coding-system))) |
default-file-name-coding-system))) |
846 |
(vc-insert-file (expand-file-name "CVS/Entries" dir)))) |
(vc-insert-file (expand-file-name "CVS/Entries" dir)))) |
847 |
|
|
848 |
(defun vc-cvs-valid-symbolic-tag-name-p (tag) |
(defun vc-cvs-valid-symbolic-tag-name-p (tag) |
849 |
"Return non-nil if TAG is a valid symbolic tag name." |
"Return non-nil if TAG is a valid symbolic tag name." |
850 |
;; According to the CVS manual, a valid symbolic tag must start with |
;; According to the CVS manual, a valid symbolic tag must start with |
934 |
"\\(.*\\)")) ;Sticky tag |
"\\(.*\\)")) ;Sticky tag |
935 |
(vc-file-setprop file 'vc-workfile-version (match-string 1)) |
(vc-file-setprop file 'vc-workfile-version (match-string 1)) |
936 |
(vc-file-setprop file 'vc-cvs-sticky-tag |
(vc-file-setprop file 'vc-cvs-sticky-tag |
937 |
(vc-cvs-parse-sticky-tag (match-string 4) |
(vc-cvs-parse-sticky-tag (match-string 4) |
938 |
(match-string 5))) |
(match-string 5))) |
939 |
;; Compare checkout time and modification time. |
;; Compare checkout time and modification time. |
940 |
;; This is intentionally different from the algorithm that CVS uses |
;; This is intentionally different from the algorithm that CVS uses |