Commit 2fb8b146 authored by Eric S. Raymond's avatar Eric S. Raymond

Remove clear-headers from VC's public method set.

* vc/vc.el and all backends: API simplification; clear-headers is no
longer a public method.  It is now local to the one place it's used,
in the RCS steal-lock method.
parent ea99f8c1
2014-12-02 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc.el and all backends: API simplification; clear-headers
is no longer a public method. It is now local to the one place
it's used, in the RCS steal-lock method.
2014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc.el and all backends: API simplification; could-register
......
......@@ -95,7 +95,6 @@
;; - previous-revision (file rev) OK
;; - next-revision (file rev) OK
;; - check-headers () COULD BE SUPPORTED
;; - clear-headers () NOT NEEDED
;; - delete-file (file) OK
;; - rename-file (old new) OK
;; - find-file-hook () OK
......
......@@ -85,7 +85,6 @@
;; - previous-revision (file rev) OK
;; - next-revision (file rev) OK
;; - check-headers () ??
;; - clear-headers () ??
;; - delete-file (file) TEST IT
;; - rename-file (old new) OK
;; - find-file-hook () added for bug#10709
......
......@@ -528,7 +528,22 @@ Needs RCS 5.6.2 or later for -M."
(vc-do-command "*vc*" 0 "rcs" (vc-master-name file) "-M" (concat "-u" rev))
;; Do a real checkout after stealing the lock, so that we see
;; expanded headers.
(vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" (concat "-l" rev))))
(vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" (concat "-l" rev))
;; Must clear any headers here because they wouldn't
;; show that the file is locked now.
(let* ((filename (or file buffer-file-name))
(visited (find-buffer-visiting filename)))
(if visited
(let ((context (vc-buffer-context)))
;; save-excursion may be able to relocate point and mark
;; properly. If it fails, vc-restore-buffer-context
;; will give it a second try.
(save-excursion
(vc-rcs-clear-headers))
(vc-restore-buffer-context context))
(set-buffer (find-file-noselect filename))
(vc-rcs-clear-headers)
(kill-buffer filename)))))
(defun vc-rcs-modify-change-comment (files rev comment)
"Modify the change comments change on FILES on a specified REV. If FILE is a
......@@ -943,7 +958,7 @@ Uses `rcs2log' which only works for RCS and CVS."
\\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
(defun vc-rcs-clear-headers ()
"Implementation of vc-clear-headers for RCS."
"Clear RCS header value parts."
(let ((case-fold-search nil))
(goto-char (point-min))
(while (re-search-forward
......
......@@ -73,7 +73,6 @@
;; - previous-revision (file rev) ??
;; - next-revision (file rev) ??
;; - check-headers () ??
;; - clear-headers () ??
;; - delete-file (file) ??
;; * rename-file (old new) OK
;; - find-file-hook () NOT NEEDED
......
......@@ -514,15 +514,6 @@
;;
;; Return non-nil if the current buffer contains any version headers.
;;
;; - clear-headers ()
;;
;; In the current buffer, reset all version headers to their unexpanded
;; form. This function should be provided if the state-querying code
;; for this backend uses the version headers to determine the state of
;; a file. This function will then be called whenever VC changes the
;; version control state in such a way that the headers would give
;; wrong information.
;;
;; - delete-file (file)
;;
;; Delete FILE and mark it as deleted in the repository. If this
......@@ -1287,9 +1278,6 @@ For old-style locking-based version control systems, like RCS:
"Claim lock retaining changes? ")))
(progn (vc-call-backend backend 'steal-lock file)
(clear-visited-file-modtime)
;; Must clear any headers here because they wouldn't
;; show that the file is locked now.
(vc-clear-headers file)
(write-file buffer-file-name)
(vc-mode-line file backend))
(if (not (yes-or-no-p
......@@ -2001,25 +1989,6 @@ the variable `vc-BACKEND-header'."
(when (string-match (car f) buffer-file-name)
(insert (format (cdr f) (car hdstrings)))))))))))
(defun vc-clear-headers (&optional file)
"Clear all version headers in the current buffer (or FILE).
The headers are reset to their non-expanded form."
(let* ((filename (or file buffer-file-name))
(visited (find-buffer-visiting filename))
(backend (vc-backend filename)))
(when (vc-find-backend-function backend 'clear-headers)
(if visited
(let ((context (vc-buffer-context)))
;; save-excursion may be able to relocate point and mark
;; properly. If it fails, vc-restore-buffer-context
;; will give it a second try.
(save-excursion
(vc-call-backend backend 'clear-headers))
(vc-restore-buffer-context context))
(set-buffer (find-file-noselect filename))
(vc-call-backend backend 'clear-headers)
(kill-buffer filename)))))
(defun vc-modify-change-comment (files rev oldcomment)
"Edit the comment associated with the given files and revision."
;; Less of a kluge than it looks like; log-view mode only passes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment