;;; Code:
+(require 'vc-rcs)
(eval-when-compile (require 'vc))
-(declare-function vc-branch-p "vc" (rev))
(declare-function vc-checkout "vc" (file &optional rev))
(declare-function vc-expand-dirs "vc" (file-or-dir-list backend))
(declare-function vc-read-revision "vc"
((string= first-revision "")
(setq status (vc-cvs-merge-news file)))
(t
- (if (not (vc-branch-p first-revision))
+ (if (not (vc-rcs-branch-p first-revision))
(setq second-revision
(vc-read-revision
"Second revision: "
(list file) 'CVS nil
- (concat (vc-branch-part first-revision) ".")))
+ (concat (vc-rcs-branch-part first-revision) ".")))
;; We want to merge an entire branch. Set revisions
;; accordingly, so that vc-cvs-merge understands us.
(setq second-revision first-revision)
;; first-revision must be the starting point of the branch
- (setq first-revision (vc-branch-part first-revision)))
+ (setq first-revision (vc-rcs-branch-part first-revision)))
(setq status (vc-cvs-merge file first-revision second-revision))))
status))
;;; History functions
;;;
-(declare-function vc-rcs-print-log-cleanup "vc-rcs" ())
;; Follows vc-cvs-command, which uses vc-do-command from vc-dispatcher.
(declare-function vc-exec-after "vc-dispatcher" (code))
(defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit)
"Print commit log associated with FILES into specified BUFFER.
Remaining arguments are ignored."
- (require 'vc-rcs)
;; It's just the catenation of the individual logs.
(vc-cvs-command
buffer
(require 'cl-lib)
(require 'vc))
-(declare-function vc-branch-p "vc" (rev))
(declare-function vc-read-revision "vc"
(prompt &optional files backend default initial-input))
(declare-function vc-buffer-context "vc-dispatcher" ())
(defun vc-rcs-dir-extra-headers (&rest _ignore))
+;; functions that operate on RCS revision numbers.
+(defun vc-rcs-branch-p (rev)
+ "Return t if REV is a branch revision."
+ (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev))))
+(define-obsolete-function-alias 'vc-branch-p #'vc-rcs-branch-p "28.1")
+
+(defun vc-rcs-branch-part (rev)
+ "Return the branch part of a revision number REV."
+ (let ((index (string-match "\\.[0-9]+\\'" rev)))
+ (when index
+ (substring rev 0 index))))
+(define-obsolete-function-alias 'vc-branch-part #'vc-rcs-branch-part "28.1")
+
(defun vc-rcs-working-revision (file)
"RCS-specific version of `vc-working-revision'."
(or (and vc-consult-headers
;; If we are not on the trunk, we need to examine the
;; whole current branch.
(vc-insert-file (vc-master-name file) "^desc")
- (vc-rcs-find-most-recent-rev (vc-branch-part version))))))
+ (vc-rcs-find-most-recent-rev (vc-rcs-branch-part version))))))
(defun vc-rcs-workfile-unchanged-p (file)
"Has FILE remained unchanged since last checkout?"
(setq rev default-branch)
(setq switches (cons "-f" switches)))
(if (and (not rev) old-version)
- (setq rev (vc-branch-part old-version)))
+ (setq rev (vc-rcs-branch-part old-version)))
(apply #'vc-do-command "*vc*" 0 "ci" (vc-master-name file)
;; if available, use the secure check-in option
(and (vc-rcs-release-p "5.6.4") "-j")
;; branch accordingly
(cond
((and old-version new-version
- (not (string= (vc-branch-part old-version)
- (vc-branch-part new-version))))
+ (not (string= (vc-rcs-branch-part old-version)
+ (vc-rcs-branch-part new-version))))
(vc-rcs-set-default-branch file
(if (vc-rcs-trunk-p new-version) nil
- (vc-branch-part new-version)))
+ (vc-rcs-branch-part new-version)))
;; If this is an old (pre-1992!) RCS release, we might have
;; to remove a remaining lock.
(if (not (vc-rcs-release-p "5.6.2"))
;; REV is t ...
(if (not (vc-rcs-trunk-p workrev))
;; ... go to head of current branch
- (vc-branch-part workrev)
+ (vc-rcs-branch-part workrev)
;; ... go to head of trunk
(vc-rcs-set-default-branch file
nil)
file
(if (vc-rcs-latest-on-branch-p file new-version)
(if (vc-rcs-trunk-p new-version) nil
- (vc-branch-part new-version))
+ (vc-rcs-branch-part new-version))
new-version)))))
(message "Checking out %s...done" file))))))
((string= first-revision "")
(error "A starting RCS revision is required"))
(t
- (if (not (vc-branch-p first-revision))
+ (if (not (vc-rcs-branch-p first-revision))
(setq second-revision
(vc-read-revision
"Second RCS revision: "
(list file) 'RCS nil
- (concat (vc-branch-part first-revision) ".")))
+ (concat (vc-rcs-branch-part first-revision) ".")))
;; We want to merge an entire branch. Set revisions
;; accordingly, so that vc-rcs-merge understands us.
(setq second-revision first-revision)
;; first-revision must be the starting point of the branch
- (setq first-revision (vc-branch-part first-revision)))))
+ (setq first-revision (vc-rcs-branch-part first-revision)))))
(vc-rcs-merge file first-revision second-revision)))
(defun vc-rcs-merge (file first-version &optional second-version)
;; Find which branches (if any) must be included in the edits.
(let ((par revision)
bpt kids)
- (while (setq bpt (vc-branch-part par)
- par (vc-branch-part bpt))
+ (while (setq bpt (vc-rcs-branch-part par)
+ par (vc-rcs-branch-part bpt))
(setq kids (cdr (assq 'branches (cdr (assoc par revisions)))))
;; A branchpoint may have multiple children. Find the right one.
- (while (not (string= bpt (vc-branch-part (car kids))))
+ (while (not (string= bpt (vc-rcs-branch-part (car kids))))
(setq kids (cdr kids)))
(push (cons par (car kids)) nbls)))
;; Start with the full text.
or nil if there is no previous revision. This default
implementation works for MAJOR.MINOR-style revision numbers as
used by RCS and CVS."
- (let ((branch (vc-branch-part rev))
+ (let ((branch (vc-rcs-branch-part rev))
(minor-num (string-to-number (vc-rcs-minor-part rev))))
(when branch
(if (> minor-num 1)
nil
;; we are at the beginning of a branch --
;; return revision of starting point
- (vc-branch-part branch))))))
+ (vc-rcs-branch-part branch))))))
(defun vc-rcs-next-revision (file rev)
"Return the revision number immediately following REV for FILE,
works for MAJOR.MINOR-style revision numbers as used by RCS
and CVS."
(when (not (string= rev (vc-working-revision file)))
- (let ((branch (vc-branch-part rev))
+ (let ((branch (vc-rcs-branch-part rev))
(minor-num (string-to-number (vc-rcs-minor-part rev))))
(concat branch "." (number-to-string (1+ minor-num))))))
(setq latest-rev rev)
(setq value (match-string 1)))))
(or value
- (vc-branch-part branch))))
+ (vc-rcs-branch-part branch))))
(defun vc-rcs-fetch-master-state (file &optional working-revision)
"Compute the master file's idea of the state of FILE.