comparison lisp/vc-hooks.el @ 12874:3afd71d56015

(vc-top-version): Renamed to vc-master-workfile-version. Updated all references.
author André Spiegel <spiegel@gnu.org>
date Thu, 17 Aug 1995 13:29:31 +0000
parents a771c59393e7
children f47248851f26
comparison
equal deleted inserted replaced
12873:03d3b7d60f67 12874:3afd71d56015
251 '("^locks\\([^;]+\\);" 1)) 251 '("^locks\\([^;]+\\);" 1))
252 file 252 file
253 '(vc-head-version 253 '(vc-head-version
254 vc-default-branch 254 vc-default-branch
255 vc-master-locks)) 255 vc-master-locks))
256 ;; determine vc-top-version: it is either the head version, 256 ;; determine vc-master-workfile-version: it is either the head
257 ;; or the tip of the default branch 257 ;; of the trunk, the head of the default branch, or the
258 ;; "default branch" itself, if that is a full revision number.
258 (let ((default-branch (vc-file-getprop file 'vc-default-branch))) 259 (let ((default-branch (vc-file-getprop file 'vc-default-branch)))
259 (cond 260 (cond
260 ;; no default branch 261 ;; no default branch
261 ((or (not default-branch) (string= "" default-branch)) 262 ((or (not default-branch) (string= "" default-branch))
262 (vc-file-setprop file 'vc-top-version 263 (vc-file-setprop file 'vc-master-workfile-version
263 (vc-file-getprop file 'vc-head-version))) 264 (vc-file-getprop file 'vc-head-version)))
264 ;; default branch is actually a revision 265 ;; default branch is actually a revision
265 ((string-match "^[0-9]+\\.[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*$" 266 ((string-match "^[0-9]+\\.[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*$"
266 default-branch) 267 default-branch)
267 (vc-file-setprop file 'vc-top-version default-branch)) 268 (vc-file-setprop file 'vc-master-workfile-version default-branch))
268 ;; else, search for the tip of the default branch 269 ;; else, search for the head of the default branch
269 (t (vc-insert-file (vc-name file) "^desc") 270 (t (vc-insert-file (vc-name file) "^desc")
270 (vc-parse-buffer (list (list 271 (vc-parse-buffer (list (list
271 (concat "^\\(" 272 (concat "^\\("
272 (regexp-quote default-branch) 273 (regexp-quote default-branch)
273 "\\.[0-9]+\\)\ndate[ \t]+\\([0-9.]+\\);") 1 2)) 274 "\\.[0-9]+\\)\ndate[ \t]+\\([0-9.]+\\);") 1 2))
274 file '(vc-top-version))))) 275 file '(vc-master-workfile-version)))))
275 ;; translate the locks 276 ;; translate the locks
276 (vc-parse-locks file (vc-file-getprop file 'vc-master-locks))) 277 (vc-parse-locks file (vc-file-getprop file 'vc-master-locks)))
277 278
278 ((eq (vc-backend file) 'CVS) 279 ((eq (vc-backend file) 'CVS)
279 ;; don't switch to the *vc-info* buffer before running the 280 ;; don't switch to the *vc-info* buffer before running the
569 ;; Return version level of the latest version of FILE checked in by you 570 ;; Return version level of the latest version of FILE checked in by you
570 (cond ((vc-file-getprop file 'vc-your-latest-version)) 571 (cond ((vc-file-getprop file 'vc-your-latest-version))
571 (t (vc-fetch-properties file) 572 (t (vc-fetch-properties file)
572 (vc-file-getprop file 'vc-your-latest-version)))) 573 (vc-file-getprop file 'vc-your-latest-version))))
573 574
574 (defun vc-top-version (file) 575 (defun vc-master-workfile-version (file)
575 ;; Return version level of the highest revision on the default branch 576 ;; Return the master file's idea of what is the current workfile version.
576 ;; If there is no default branch, return the highest version number
577 ;; on the trunk.
578 ;; This property is defined for RCS only. 577 ;; This property is defined for RCS only.
579 (cond ((vc-file-getprop file 'vc-top-version)) 578 (cond ((vc-file-getprop file 'vc-master-workfile-version))
580 (t (vc-fetch-master-properties file) 579 (t (vc-fetch-master-properties file)
581 (vc-file-getprop file 'vc-top-version)))) 580 (vc-file-getprop file 'vc-master-workfile-version))))
582 581
583 (defun vc-fetch-properties (file) 582 (defun vc-fetch-properties (file)
584 ;; Fetch vc-latest-version and vc-your-latest-version 583 ;; Fetch vc-latest-version and vc-your-latest-version
585 ;; if that wasn't already done. 584 ;; if that wasn't already done.
586 (cond 585 (cond
603 602
604 (defun vc-workfile-version (file) 603 (defun vc-workfile-version (file)
605 ;; Return version level of the current workfile FILE 604 ;; Return version level of the current workfile FILE
606 ;; This is attempted by first looking at the RCS keywords. 605 ;; This is attempted by first looking at the RCS keywords.
607 ;; If there are no keywords in the working file, 606 ;; If there are no keywords in the working file,
608 ;; vc-top-version is taken. 607 ;; vc-master-workfile-version is taken.
609 ;; Note that this property is cached, that is, it is only 608 ;; Note that this property is cached, that is, it is only
610 ;; looked up if it is nil. 609 ;; looked up if it is nil.
611 ;; For SCCS, this property is equivalent to vc-latest-version. 610 ;; For SCCS, this property is equivalent to vc-latest-version.
612 (cond ((vc-file-getprop file 'vc-workfile-version)) 611 (cond ((vc-file-getprop file 'vc-workfile-version))
613 ((eq (vc-backend file) 'SCCS) (vc-latest-version file)) 612 ((eq (vc-backend file) 'SCCS) (vc-latest-version file))
614 ((eq (vc-backend file) 'RCS) 613 ((eq (vc-backend file) 'RCS)
615 (if (vc-consult-rcs-headers file) 614 (if (vc-consult-rcs-headers file)
616 (vc-file-getprop file 'vc-workfile-version) 615 (vc-file-getprop file 'vc-workfile-version)
617 (let ((rev (cond ((vc-top-version file)) 616 (let ((rev (cond ((vc-master-workfile-version file))
618 ((vc-latest-version file))))) 617 ((vc-latest-version file)))))
619 (vc-file-setprop file 'vc-workfile-version rev) 618 (vc-file-setprop file 'vc-workfile-version rev)
620 rev))) 619 rev)))
621 ((eq (vc-backend file) 'CVS) 620 ((eq (vc-backend file) 'CVS)
622 (if (vc-consult-rcs-headers file) ;; CVS 621 (if (vc-consult-rcs-headers file) ;; CVS