aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond2014-12-01 23:49:35 -0500
committerEric S. Raymond2014-12-01 23:49:35 -0500
commit2fb8b146f74791d7cbe702292b8197913d437c75 (patch)
treef0f5b8d13ff9d2e94db08e398a8127b90b4b0b32
parentea99f8c1ab8e97a54116e50157dd4bd6f1247b91 (diff)
downloademacs-2fb8b146f74791d7cbe702292b8197913d437c75.tar.gz
emacs-2fb8b146f74791d7cbe702292b8197913d437c75.zip
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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/vc/vc-git.el1
-rw-r--r--lisp/vc/vc-hg.el1
-rw-r--r--lisp/vc/vc-rcs.el19
-rw-r--r--lisp/vc/vc-src.el1
-rw-r--r--lisp/vc/vc.el31
6 files changed, 23 insertions, 36 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6c2b33ea566..d005cbef920 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-12-02 Eric S. Raymond <esr@snark.thyrsus.com>
2
3 * vc/vc.el and all backends: API simplification; clear-headers
4 is no longer a public method. It is now local to the one place
5 it's used, in the RCS steal-lock method.
6
12014-12-01 Eric S. Raymond <esr@snark.thyrsus.com> 72014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
2 8
3 * vc/vc.el and all backends: API simplification; could-register 9 * vc/vc.el and all backends: API simplification; could-register
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 93c5ff805f6..3538f2c3828 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -95,7 +95,6 @@
95;; - previous-revision (file rev) OK 95;; - previous-revision (file rev) OK
96;; - next-revision (file rev) OK 96;; - next-revision (file rev) OK
97;; - check-headers () COULD BE SUPPORTED 97;; - check-headers () COULD BE SUPPORTED
98;; - clear-headers () NOT NEEDED
99;; - delete-file (file) OK 98;; - delete-file (file) OK
100;; - rename-file (old new) OK 99;; - rename-file (old new) OK
101;; - find-file-hook () OK 100;; - find-file-hook () OK
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index b5be8d5f04c..35f5354da65 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -85,7 +85,6 @@
85;; - previous-revision (file rev) OK 85;; - previous-revision (file rev) OK
86;; - next-revision (file rev) OK 86;; - next-revision (file rev) OK
87;; - check-headers () ?? 87;; - check-headers () ??
88;; - clear-headers () ??
89;; - delete-file (file) TEST IT 88;; - delete-file (file) TEST IT
90;; - rename-file (old new) OK 89;; - rename-file (old new) OK
91;; - find-file-hook () added for bug#10709 90;; - find-file-hook () added for bug#10709
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index c9e4d409924..40a102789b9 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -528,7 +528,22 @@ Needs RCS 5.6.2 or later for -M."
528 (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) "-M" (concat "-u" rev)) 528 (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) "-M" (concat "-u" rev))
529 ;; Do a real checkout after stealing the lock, so that we see 529 ;; Do a real checkout after stealing the lock, so that we see
530 ;; expanded headers. 530 ;; expanded headers.
531 (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" (concat "-l" rev)))) 531 (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" (concat "-l" rev))
532 ;; Must clear any headers here because they wouldn't
533 ;; show that the file is locked now.
534 (let* ((filename (or file buffer-file-name))
535 (visited (find-buffer-visiting filename)))
536 (if visited
537 (let ((context (vc-buffer-context)))
538 ;; save-excursion may be able to relocate point and mark
539 ;; properly. If it fails, vc-restore-buffer-context
540 ;; will give it a second try.
541 (save-excursion
542 (vc-rcs-clear-headers))
543 (vc-restore-buffer-context context))
544 (set-buffer (find-file-noselect filename))
545 (vc-rcs-clear-headers)
546 (kill-buffer filename)))))
532 547
533(defun vc-rcs-modify-change-comment (files rev comment) 548(defun vc-rcs-modify-change-comment (files rev comment)
534 "Modify the change comments change on FILES on a specified REV. If FILE is a 549 "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."
943\\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t))) 958\\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
944 959
945(defun vc-rcs-clear-headers () 960(defun vc-rcs-clear-headers ()
946 "Implementation of vc-clear-headers for RCS." 961 "Clear RCS header value parts."
947 (let ((case-fold-search nil)) 962 (let ((case-fold-search nil))
948 (goto-char (point-min)) 963 (goto-char (point-min))
949 (while (re-search-forward 964 (while (re-search-forward
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index c93ff96fd29..f3d0585b30c 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -73,7 +73,6 @@
73;; - previous-revision (file rev) ?? 73;; - previous-revision (file rev) ??
74;; - next-revision (file rev) ?? 74;; - next-revision (file rev) ??
75;; - check-headers () ?? 75;; - check-headers () ??
76;; - clear-headers () ??
77;; - delete-file (file) ?? 76;; - delete-file (file) ??
78;; * rename-file (old new) OK 77;; * rename-file (old new) OK
79;; - find-file-hook () NOT NEEDED 78;; - find-file-hook () NOT NEEDED
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 9e6b049e084..52deb13e4dd 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -514,15 +514,6 @@
514;; 514;;
515;; Return non-nil if the current buffer contains any version headers. 515;; Return non-nil if the current buffer contains any version headers.
516;; 516;;
517;; - clear-headers ()
518;;
519;; In the current buffer, reset all version headers to their unexpanded
520;; form. This function should be provided if the state-querying code
521;; for this backend uses the version headers to determine the state of
522;; a file. This function will then be called whenever VC changes the
523;; version control state in such a way that the headers would give
524;; wrong information.
525;;
526;; - delete-file (file) 517;; - delete-file (file)
527;; 518;;
528;; Delete FILE and mark it as deleted in the repository. If this 519;; 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:
1287 "Claim lock retaining changes? "))) 1278 "Claim lock retaining changes? ")))
1288 (progn (vc-call-backend backend 'steal-lock file) 1279 (progn (vc-call-backend backend 'steal-lock file)
1289 (clear-visited-file-modtime) 1280 (clear-visited-file-modtime)
1290 ;; Must clear any headers here because they wouldn't
1291 ;; show that the file is locked now.
1292 (vc-clear-headers file)
1293 (write-file buffer-file-name) 1281 (write-file buffer-file-name)
1294 (vc-mode-line file backend)) 1282 (vc-mode-line file backend))
1295 (if (not (yes-or-no-p 1283 (if (not (yes-or-no-p
@@ -2001,25 +1989,6 @@ the variable `vc-BACKEND-header'."
2001 (when (string-match (car f) buffer-file-name) 1989 (when (string-match (car f) buffer-file-name)
2002 (insert (format (cdr f) (car hdstrings))))))))))) 1990 (insert (format (cdr f) (car hdstrings)))))))))))
2003 1991
2004(defun vc-clear-headers (&optional file)
2005 "Clear all version headers in the current buffer (or FILE).
2006The headers are reset to their non-expanded form."
2007 (let* ((filename (or file buffer-file-name))
2008 (visited (find-buffer-visiting filename))
2009 (backend (vc-backend filename)))
2010 (when (vc-find-backend-function backend 'clear-headers)
2011 (if visited
2012 (let ((context (vc-buffer-context)))
2013 ;; save-excursion may be able to relocate point and mark
2014 ;; properly. If it fails, vc-restore-buffer-context
2015 ;; will give it a second try.
2016 (save-excursion
2017 (vc-call-backend backend 'clear-headers))
2018 (vc-restore-buffer-context context))
2019 (set-buffer (find-file-noselect filename))
2020 (vc-call-backend backend 'clear-headers)
2021 (kill-buffer filename)))))
2022
2023(defun vc-modify-change-comment (files rev oldcomment) 1992(defun vc-modify-change-comment (files rev oldcomment)
2024 "Edit the comment associated with the given files and revision." 1993 "Edit the comment associated with the given files and revision."
2025 ;; Less of a kluge than it looks like; log-view mode only passes 1994 ;; Less of a kluge than it looks like; log-view mode only passes