204 |
(unless version (setq version (vc-workfile-version file))) |
(unless version (setq version (vc-workfile-version file))) |
205 |
(with-temp-buffer |
(with-temp-buffer |
206 |
(string= version |
(string= version |
207 |
(if (vc-rcs-trunk-p version) |
(if (vc-trunk-p version) |
208 |
(progn |
(progn |
209 |
;; Compare VERSION to the head version number. |
;; Compare VERSION to the head version number. |
210 |
(vc-insert-file (vc-name file) "^[0-9]") |
(vc-insert-file (vc-name file) "^[0-9]") |
212 |
;; If we are not on the trunk, we need to examine the |
;; If we are not on the trunk, we need to examine the |
213 |
;; whole current branch. |
;; whole current branch. |
214 |
(vc-insert-file (vc-name file) "^desc") |
(vc-insert-file (vc-name file) "^desc") |
215 |
(vc-rcs-find-most-recent-rev (vc-rcs-branch-part version)))))) |
(vc-rcs-find-most-recent-rev (vc-branch-part version)))))) |
216 |
|
|
217 |
(defun vc-rcs-checkout-model (file) |
(defun vc-rcs-checkout-model (file) |
218 |
"RCS-specific version of `vc-checkout-model'." |
"RCS-specific version of `vc-checkout-model'." |
365 |
;; branch accordingly |
;; branch accordingly |
366 |
(cond |
(cond |
367 |
((and old-version new-version |
((and old-version new-version |
368 |
(not (string= (vc-rcs-branch-part old-version) |
(not (string= (vc-branch-part old-version) |
369 |
(vc-rcs-branch-part new-version)))) |
(vc-branch-part new-version)))) |
370 |
(vc-rcs-set-default-branch file |
(vc-rcs-set-default-branch file |
371 |
(if (vc-rcs-trunk-p new-version) nil |
(if (vc-trunk-p new-version) nil |
372 |
(vc-rcs-branch-part new-version))) |
(vc-branch-part new-version))) |
373 |
;; If this is an old RCS release, we might have |
;; If this is an old RCS release, we might have |
374 |
;; to remove a remaining lock. |
;; to remove a remaining lock. |
375 |
(if (not (vc-rcs-release-p "5.6.2")) |
(if (not (vc-rcs-release-p "5.6.2")) |
450 |
(vc-rcs-set-default-branch |
(vc-rcs-set-default-branch |
451 |
file |
file |
452 |
(if (vc-rcs-latest-on-branch-p file new-version) |
(if (vc-rcs-latest-on-branch-p file new-version) |
453 |
(if (vc-rcs-trunk-p new-version) nil |
(if (vc-trunk-p new-version) nil |
454 |
(vc-rcs-branch-part new-version)) |
(vc-branch-part new-version)) |
455 |
new-version)))))) |
new-version)))))) |
456 |
(message "Checking out %s...done" filename))))) |
(message "Checking out %s...done" filename))))) |
457 |
|
|
500 |
(defun vc-rcs-steal-lock (file &optional rev) |
(defun vc-rcs-steal-lock (file &optional rev) |
501 |
"Steal the lock on the current workfile for FILE and revision REV. |
"Steal the lock on the current workfile for FILE and revision REV. |
502 |
Needs RCS 5.6.2 or later for -M." |
Needs RCS 5.6.2 or later for -M." |
503 |
(vc-do-command nil 0 "rcs" (vc-name file) "-M" |
(vc-do-command nil 0 "rcs" (vc-name file) "-M" (concat "-u" rev)) |
504 |
(concat "-u" rev) (concat "-l" rev))) |
;; Do a real checkout after stealing the lock, so that we see |
505 |
|
;; expanded headers. |
506 |
|
(vc-do-command nil 0 "co" (vc-name file) "-f" (concat "-l" rev))) |
507 |
|
|
508 |
|
|
509 |
|
|
595 |
;;; Internal functions |
;;; Internal functions |
596 |
;;; |
;;; |
597 |
|
|
|
(defun vc-rcs-trunk-p (rev) |
|
|
"Return t if REV is an RCS revision on the trunk." |
|
|
(not (eq nil (string-match "\\`[0-9]+\\.[0-9]+\\'" rev)))) |
|
|
|
|
|
(defun vc-rcs-branch-part (rev) |
|
|
"Return the branch part of an RCS revision number REV" |
|
|
(substring rev 0 (string-match "\\.[0-9]+\\'" rev))) |
|
|
|
|
|
(defun vc-rcs-branch-p (rev) |
|
|
"Return t if REV is an RCS branch revision" |
|
|
(not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev)))) |
|
|
|
|
|
(defun vc-rcs-minor-part (rev) |
|
|
"Return the minor version number of an RCS revision number REV." |
|
|
(string-match "[0-9]+\\'" rev) |
|
|
(substring rev (match-beginning 0) (match-end 0))) |
|
|
|
|
|
(defun vc-rcs-previous-version (rev) |
|
|
"Guess the previous RCS version number" |
|
|
(let ((branch (vc-rcs-branch-part rev)) |
|
|
(minor-num (string-to-number (vc-rcs-minor-part rev)))) |
|
|
(if (> minor-num 1) |
|
|
;; version does probably not start a branch or release |
|
|
(concat branch "." (number-to-string (1- minor-num))) |
|
|
(if (vc-rcs-trunk-p rev) |
|
|
;; we are at the beginning of the trunk -- |
|
|
;; don't know anything to return here |
|
|
"" |
|
|
;; we are at the beginning of a branch -- |
|
|
;; return version of starting point |
|
|
(vc-rcs-branch-part branch))))) |
|
|
|
|
598 |
(defun vc-rcs-workfile-is-newer (file) |
(defun vc-rcs-workfile-is-newer (file) |
599 |
"Return non-nil if FILE is newer than its RCS master. |
"Return non-nil if FILE is newer than its RCS master. |
600 |
This likely means that FILE has been changed with respect |
This likely means that FILE has been changed with respect |
617 |
(setq latest-rev rev) |
(setq latest-rev rev) |
618 |
(setq value (match-string 1))))) |
(setq value (match-string 1))))) |
619 |
(or value |
(or value |
620 |
(vc-rcs-branch-part branch)))) |
(vc-branch-part branch)))) |
621 |
|
|
622 |
(defun vc-rcs-fetch-master-state (file &optional workfile-version) |
(defun vc-rcs-fetch-master-state (file &optional workfile-version) |
623 |
"Compute the master file's idea of the state of FILE. |
"Compute the master file's idea of the state of FILE. |