aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEric S. Raymond2014-12-01 18:54:28 -0500
committerEric S. Raymond2014-12-01 18:54:28 -0500
commitb7fd432d56e352e25e6db4eaf5b081ddc5a39367 (patch)
tree21144cae16931e5f390459e7e64ba9a8eb22994b /lisp
parentd788058c50783f6be19a578f5968d6eec129af0a (diff)
downloademacs-b7fd432d56e352e25e6db4eaf5b081ddc5a39367.tar.gz
emacs-b7fd432d56e352e25e6db4eaf5b081ddc5a39367.zip
Remove could-register from the set of public VC backend methods,
* vc/vc.el and all backends: API simplification; could-register is no longer a public method. (vc-cvs.el still has a private implementation.)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/vc/vc-bzr.el12
-rw-r--r--lisp/vc/vc-dav.el5
-rw-r--r--lisp/vc/vc-git.el1
-rw-r--r--lisp/vc/vc-hg.el12
-rw-r--r--lisp/vc/vc-mtn.el1
-rw-r--r--lisp/vc/vc-src.el3
-rw-r--r--lisp/vc/vc-svn.el4
-rw-r--r--lisp/vc/vc.el11
9 files changed, 7 insertions, 50 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 76590e12866..6c2b33ea566 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,14 @@
12014-12-01 Eric S. Raymond <esr@snark.thyrsus.com> 12014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
2 2
3 * vc/vc.el, and all backends: API cleanup; the backend diff method 3 * vc/vc.el and all backends: API simplification; could-register
4 is no longer a public method. (vc-cvs.el still has a private
5 implementation.)
6
7 * vc/vc.el and all backends: API cleanup; the backend diff method
4 takes an explicit async flag. This eliminates a particularly ugly 8 takes an explicit async flag. This eliminates a particularly ugly
5 global. 9 global.
6 10
7 vc-bzr.el: Restore vc-bzr-state-heuristic as a private method. 11 * vc-bzr.el: Restore vc-bzr-state-heuristic as a private method.
8 VC randomly/unpredictable fails without it; cause not yet established. 12 VC randomly/unpredictable fails without it; cause not yet established.
9 13
102014-12-01 Stefan Monnier <monnier@iro.umontreal.ca> 142014-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 48476dc9654..de6ae21dbfe 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -596,18 +596,6 @@ in the branch repository (or whose status not be determined)."
596The criterion is that there is a `.bzr' directory in the same 596The criterion is that there is a `.bzr' directory in the same
597or a superior directory.") 597or a superior directory.")
598 598
599(defun vc-bzr-could-register (file)
600 "Return non-nil if FILE could be registered under bzr."
601 (and (vc-bzr-responsible-p file) ; shortcut
602 (condition-case ()
603 (with-temp-buffer
604 (vc-bzr-command "add" t 0 file "--dry-run")
605 ;; The command succeeds with no output if file is
606 ;; registered (in bzr 0.8).
607 (goto-char (point-min))
608 (looking-at "added "))
609 (error))))
610
611(defun vc-bzr-unregister (file) 599(defun vc-bzr-unregister (file)
612 "Unregister FILE from bzr." 600 "Unregister FILE from bzr."
613 (vc-bzr-command "remove" nil 0 file "--keep")) 601 (vc-bzr-command "remove" nil 0 file "--keep"))
diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el
index 46aa027c6c5..4271cf7d1b3 100644
--- a/lisp/vc/vc-dav.el
+++ b/lisp/vc/vc-dav.el
@@ -145,11 +145,6 @@ It should return a status of either 0 (no differences found), or
145 ;; Check for DAV support on the web server. 145 ;; Check for DAV support on the web server.
146 t) 146 t)
147 147
148(defun vc-dav-could-register (url)
149 "Return non-nil if URL could be registered under this backend."
150 ;; Check for DAV support on the web server.
151 t)
152
153;;; Unimplemented functions 148;;; Unimplemented functions
154;; 149;;
155;; vc-dav-latest-on-branch-p(URL) 150;; vc-dav-latest-on-branch-p(URL)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 8fdea8c216b..93a129c1fc4 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -58,7 +58,6 @@
58;; * create-repo () OK 58;; * create-repo () OK
59;; * register (files &optional rev comment) OK 59;; * register (files &optional rev comment) OK
60;; - responsible-p (file) OK 60;; - responsible-p (file) OK
61;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD
62;; - receive-file (file rev) NOT NEEDED 61;; - receive-file (file rev) NOT NEEDED
63;; - unregister (file) OK 62;; - unregister (file) OK
64;; * checkin (files rev comment) OK 63;; * checkin (files rev comment) OK
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 0f636c01848..b5be8d5f04c 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -55,7 +55,6 @@
55;; * register (files &optional rev comment) OK 55;; * register (files &optional rev comment) OK
56;; * create-repo () OK 56;; * create-repo () OK
57;; - responsible-p (file) OK 57;; - responsible-p (file) OK
58;; - could-register (file) OK
59;; - receive-file (file rev) ?? PROBABLY NOT NEEDED 58;; - receive-file (file rev) ?? PROBABLY NOT NEEDED
60;; - unregister (file) OK 59;; - unregister (file) OK
61;; * checkin (files rev comment) OK 60;; * checkin (files rev comment) OK
@@ -450,17 +449,6 @@ Optional arg REVISION is a revision to annotate from."
450 449
451(defalias 'vc-hg-responsible-p 'vc-hg-root) 450(defalias 'vc-hg-responsible-p 'vc-hg-root)
452 451
453;; Modeled after the similar function in vc-bzr.el
454(defun vc-hg-could-register (file)
455 "Return non-nil if FILE could be registered under hg."
456 (and (vc-hg-responsible-p file) ; shortcut
457 (condition-case ()
458 (with-temp-buffer
459 (vc-hg-command t nil file "add" "--dry-run"))
460 ;; The command succeeds with no output if file is
461 ;; registered.
462 (error))))
463
464(defun vc-hg-unregister (file) 452(defun vc-hg-unregister (file)
465 "Unregister FILE from hg." 453 "Unregister FILE from hg."
466 (vc-hg-command nil 0 file "forget")) 454 (vc-hg-command nil 0 file "forget"))
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index e03d8551d6e..85aaf3dc542 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -180,7 +180,6 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
180 (vc-mtn-command nil 0 files "add")) 180 (vc-mtn-command nil 0 files "add"))
181 181
182(defun vc-mtn-responsible-p (file) (vc-mtn-root file)) 182(defun vc-mtn-responsible-p (file) (vc-mtn-root file))
183(defun vc-mtn-could-register (file) (vc-mtn-root file))
184 183
185(declare-function log-edit-extract-headers "log-edit" (headers string)) 184(declare-function log-edit-extract-headers "log-edit" (headers string))
186 185
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index 49c799c44e1..c93ff96fd29 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -43,7 +43,6 @@
43;; * register (files &optional rev comment) OK 43;; * register (files &optional rev comment) OK
44;; * create-repo () OK 44;; * create-repo () OK
45;; * responsible-p (file) OK 45;; * responsible-p (file) OK
46;; * could-register (file) OK
47;; - receive-file (file rev) NOT NEEDED 46;; - receive-file (file rev) NOT NEEDED
48;; - unregister (file) NOT NEEDED 47;; - unregister (file) NOT NEEDED
49;; * checkin (files comment) OK 48;; * checkin (files comment) OK
@@ -232,8 +231,6 @@ This function differs from vc-do-command in that it invokes `vc-src-program'."
232 file 231 file
233 (file-name-directory file))))) 232 (file-name-directory file)))))
234 233
235(defalias 'vc-could-register 'vc-src-responsible-p)
236
237(defun vc-src-checkin (files comment) 234(defun vc-src-checkin (files comment)
238 "SRC-specific version of `vc-backend-checkin'. 235 "SRC-specific version of `vc-backend-checkin'.
239REV is ignored." 236REV is ignored."
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 54b998df9d5..55b8f111e01 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -284,10 +284,6 @@ to the SVN command."
284 284
285(defalias 'vc-svn-responsible-p 'vc-svn-root) 285(defalias 'vc-svn-responsible-p 'vc-svn-root)
286 286
287(defalias 'vc-svn-could-register 'vc-svn-root
288 "Return non-nil if FILE could be registered in SVN.
289This is only possible if SVN is responsible for FILE's directory.")
290
291(defun vc-svn-checkin (files comment &optional _extra-args-ignored) 287(defun vc-svn-checkin (files comment &optional _extra-args-ignored)
292 "SVN-specific version of `vc-backend-checkin'." 288 "SVN-specific version of `vc-backend-checkin'."
293 (let ((status (apply 289 (let ((status (apply
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 121e32925da..40e4211c6e4 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -227,11 +227,6 @@
227;; like change log generation. The default implementation always 227;; like change log generation. The default implementation always
228;; returns nil. 228;; returns nil.
229;; 229;;
230;; - could-register (file)
231;;
232;; Return non-nil if FILE could be registered under this backend. The
233;; default implementation always returns t.
234;;
235;; - receive-file (file rev) 230;; - receive-file (file rev)
236;; 231;;
237;; Let this backend "receive" a file that is already registered under 232;; Let this backend "receive" a file that is already registered under
@@ -612,6 +607,7 @@
612;; call to it. A few older back ends retain versions for internal use in 607;; call to it. A few older back ends retain versions for internal use in
613;; their vc-state functions. 608;; their vc-state functions.
614;; 609;;
610;; could-register is no longer a public method. Only vc-cvs ever used it
615 611
616;;; Todo: 612;;; Todo:
617 613
@@ -2824,11 +2820,6 @@ log entries should be gathered."
2824The default is to return nil always." 2820The default is to return nil always."
2825 nil) 2821 nil)
2826 2822
2827(defun vc-default-could-register (_backend _file)
2828 "Return non-nil if BACKEND could be used to register FILE.
2829The default implementation returns t for all files."
2830 t)
2831
2832(defun vc-default-latest-on-branch-p (_backend _file) 2823(defun vc-default-latest-on-branch-p (_backend _file)
2833 "Return non-nil if FILE is the latest on its branch. 2824 "Return non-nil if FILE is the latest on its branch.
2834This default implementation always returns non-nil, which means that 2825This default implementation always returns non-nil, which means that