diff options
| author | André Spiegel | 2002-01-05 17:21:06 +0000 |
|---|---|---|
| committer | André Spiegel | 2002-01-05 17:21:06 +0000 |
| commit | 7735770bb44ab660e1d1c3c3e05335afb6eb715b (patch) | |
| tree | b9de48b835321af652265f40af7fc136d06b63f3 | |
| parent | 869131a59320d279fa9f18585e93eee125f550d9 (diff) | |
| download | emacs-7735770bb44ab660e1d1c3c3e05335afb6eb715b.tar.gz emacs-7735770bb44ab660e1d1c3c3e05335afb6eb715b.zip | |
(vc-rcs-steal-lock): Do a real checkout after stealing the lock, so
that we see expanded headers.
(vc-rcs-trunk-p, vc-rcs-branch-part, vc-rcs-branch-p,
vc-rcs-minor-part, vc-rcs-previous-version): Removed. These are
available from vc.el. Updated all callers.
| -rw-r--r-- | lisp/vc-rcs.el | 58 |
1 files changed, 14 insertions, 44 deletions
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el index f703b680482..b6d6521b268 100644 --- a/lisp/vc-rcs.el +++ b/lisp/vc-rcs.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: FSF (see vc.el for full credits) | 5 | ;; Author: FSF (see vc.el for full credits) |
| 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
| 7 | 7 | ||
| 8 | ;; $Id: vc-rcs.el,v 1.20 2001/07/16 12:22:59 pj Exp $ | 8 | ;; $Id: vc-rcs.el,v 1.21 2001/08/28 17:05:12 spiegel Exp $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -204,7 +204,7 @@ When VERSION is given, perform check for that version." | |||
| 204 | (unless version (setq version (vc-workfile-version file))) | 204 | (unless version (setq version (vc-workfile-version file))) |
| 205 | (with-temp-buffer | 205 | (with-temp-buffer |
| 206 | (string= version | 206 | (string= version |
| 207 | (if (vc-rcs-trunk-p version) | 207 | (if (vc-trunk-p version) |
| 208 | (progn | 208 | (progn |
| 209 | ;; Compare VERSION to the head version number. | 209 | ;; Compare VERSION to the head version number. |
| 210 | (vc-insert-file (vc-name file) "^[0-9]") | 210 | (vc-insert-file (vc-name file) "^[0-9]") |
| @@ -212,7 +212,7 @@ When VERSION is given, perform check for that version." | |||
| 212 | ;; If we are not on the trunk, we need to examine the | 212 | ;; If we are not on the trunk, we need to examine the |
| 213 | ;; whole current branch. | 213 | ;; whole current branch. |
| 214 | (vc-insert-file (vc-name file) "^desc") | 214 | (vc-insert-file (vc-name file) "^desc") |
| 215 | (vc-rcs-find-most-recent-rev (vc-rcs-branch-part version)))))) | 215 | (vc-rcs-find-most-recent-rev (vc-branch-part version)))))) |
| 216 | 216 | ||
| 217 | (defun vc-rcs-checkout-model (file) | 217 | (defun vc-rcs-checkout-model (file) |
| 218 | "RCS-specific version of `vc-checkout-model'." | 218 | "RCS-specific version of `vc-checkout-model'." |
| @@ -365,11 +365,11 @@ whether to remove it." | |||
| 365 | ;; branch accordingly | 365 | ;; branch accordingly |
| 366 | (cond | 366 | (cond |
| 367 | ((and old-version new-version | 367 | ((and old-version new-version |
| 368 | (not (string= (vc-rcs-branch-part old-version) | 368 | (not (string= (vc-branch-part old-version) |
| 369 | (vc-rcs-branch-part new-version)))) | 369 | (vc-branch-part new-version)))) |
| 370 | (vc-rcs-set-default-branch file | 370 | (vc-rcs-set-default-branch file |
| 371 | (if (vc-rcs-trunk-p new-version) nil | 371 | (if (vc-trunk-p new-version) nil |
| 372 | (vc-rcs-branch-part new-version))) | 372 | (vc-branch-part new-version))) |
| 373 | ;; If this is an old RCS release, we might have | 373 | ;; If this is an old RCS release, we might have |
| 374 | ;; to remove a remaining lock. | 374 | ;; to remove a remaining lock. |
| 375 | (if (not (vc-rcs-release-p "5.6.2")) | 375 | (if (not (vc-rcs-release-p "5.6.2")) |
| @@ -450,8 +450,8 @@ whether to remove it." | |||
| 450 | (vc-rcs-set-default-branch | 450 | (vc-rcs-set-default-branch |
| 451 | file | 451 | file |
| 452 | (if (vc-rcs-latest-on-branch-p file new-version) | 452 | (if (vc-rcs-latest-on-branch-p file new-version) |
| 453 | (if (vc-rcs-trunk-p new-version) nil | 453 | (if (vc-trunk-p new-version) nil |
| 454 | (vc-rcs-branch-part new-version)) | 454 | (vc-branch-part new-version)) |
| 455 | new-version)))))) | 455 | new-version)))))) |
| 456 | (message "Checking out %s...done" filename))))) | 456 | (message "Checking out %s...done" filename))))) |
| 457 | 457 | ||
| @@ -500,8 +500,10 @@ The changes are between FIRST-VERSION and SECOND-VERSION." | |||
| 500 | (defun vc-rcs-steal-lock (file &optional rev) | 500 | (defun vc-rcs-steal-lock (file &optional rev) |
| 501 | "Steal the lock on the current workfile for FILE and revision REV. | 501 | "Steal the lock on the current workfile for FILE and revision REV. |
| 502 | Needs RCS 5.6.2 or later for -M." | 502 | Needs RCS 5.6.2 or later for -M." |
| 503 | (vc-do-command nil 0 "rcs" (vc-name file) "-M" | 503 | (vc-do-command nil 0 "rcs" (vc-name file) "-M" (concat "-u" rev)) |
| 504 | (concat "-u" rev) (concat "-l" rev))) | 504 | ;; 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))) | ||
| 505 | 507 | ||
| 506 | 508 | ||
| 507 | 509 | ||
| @@ -593,38 +595,6 @@ Needs RCS 5.6.2 or later for -M." | |||
| 593 | ;;; Internal functions | 595 | ;;; Internal functions |
| 594 | ;;; | 596 | ;;; |
| 595 | 597 | ||
| 596 | (defun vc-rcs-trunk-p (rev) | ||
| 597 | "Return t if REV is an RCS revision on the trunk." | ||
| 598 | (not (eq nil (string-match "\\`[0-9]+\\.[0-9]+\\'" rev)))) | ||
| 599 | |||
| 600 | (defun vc-rcs-branch-part (rev) | ||
| 601 | "Return the branch part of an RCS revision number REV" | ||
| 602 | (substring rev 0 (string-match "\\.[0-9]+\\'" rev))) | ||
| 603 | |||
| 604 | (defun vc-rcs-branch-p (rev) | ||
| 605 | "Return t if REV is an RCS branch revision" | ||
| 606 | (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev)))) | ||
| 607 | |||
| 608 | (defun vc-rcs-minor-part (rev) | ||
| 609 | "Return the minor version number of an RCS revision number REV." | ||
| 610 | (string-match "[0-9]+\\'" rev) | ||
| 611 | (substring rev (match-beginning 0) (match-end 0))) | ||
| 612 | |||
| 613 | (defun vc-rcs-previous-version (rev) | ||
| 614 | "Guess the previous RCS version number" | ||
| 615 | (let ((branch (vc-rcs-branch-part rev)) | ||
| 616 | (minor-num (string-to-number (vc-rcs-minor-part rev)))) | ||
| 617 | (if (> minor-num 1) | ||
| 618 | ;; version does probably not start a branch or release | ||
| 619 | (concat branch "." (number-to-string (1- minor-num))) | ||
| 620 | (if (vc-rcs-trunk-p rev) | ||
| 621 | ;; we are at the beginning of the trunk -- | ||
| 622 | ;; don't know anything to return here | ||
| 623 | "" | ||
| 624 | ;; we are at the beginning of a branch -- | ||
| 625 | ;; return version of starting point | ||
| 626 | (vc-rcs-branch-part branch))))) | ||
| 627 | |||
| 628 | (defun vc-rcs-workfile-is-newer (file) | 598 | (defun vc-rcs-workfile-is-newer (file) |
| 629 | "Return non-nil if FILE is newer than its RCS master. | 599 | "Return non-nil if FILE is newer than its RCS master. |
| 630 | This likely means that FILE has been changed with respect | 600 | This likely means that FILE has been changed with respect |
| @@ -647,7 +617,7 @@ to its master version." | |||
| 647 | (setq latest-rev rev) | 617 | (setq latest-rev rev) |
| 648 | (setq value (match-string 1))))) | 618 | (setq value (match-string 1))))) |
| 649 | (or value | 619 | (or value |
| 650 | (vc-rcs-branch-part branch)))) | 620 | (vc-branch-part branch)))) |
| 651 | 621 | ||
| 652 | (defun vc-rcs-fetch-master-state (file &optional workfile-version) | 622 | (defun vc-rcs-fetch-master-state (file &optional workfile-version) |
| 653 | "Compute the master file's idea of the state of FILE. | 623 | "Compute the master file's idea of the state of FILE. |