Commit b7fd432d authored by Eric S. Raymond's avatar Eric S. Raymond

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.)
parent d788058c
2014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
* vc/vc.el, and all backends: API cleanup; the backend diff method
* vc/vc.el and all backends: API simplification; could-register
is no longer a public method. (vc-cvs.el still has a private
implementation.)
* vc/vc.el and all backends: API cleanup; the backend diff method
takes an explicit async flag. This eliminates a particularly ugly
global.
vc-bzr.el: Restore vc-bzr-state-heuristic as a private method.
* vc-bzr.el: Restore vc-bzr-state-heuristic as a private method.
VC randomly/unpredictable fails without it; cause not yet established.
2014-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
......
......@@ -596,18 +596,6 @@ in the branch repository (or whose status not be determined)."
The criterion is that there is a `.bzr' directory in the same
or a superior directory.")
(defun vc-bzr-could-register (file)
"Return non-nil if FILE could be registered under bzr."
(and (vc-bzr-responsible-p file) ; shortcut
(condition-case ()
(with-temp-buffer
(vc-bzr-command "add" t 0 file "--dry-run")
;; The command succeeds with no output if file is
;; registered (in bzr 0.8).
(goto-char (point-min))
(looking-at "added "))
(error))))
(defun vc-bzr-unregister (file)
"Unregister FILE from bzr."
(vc-bzr-command "remove" nil 0 file "--keep"))
......
......@@ -145,11 +145,6 @@ It should return a status of either 0 (no differences found), or
;; Check for DAV support on the web server.
t)
(defun vc-dav-could-register (url)
"Return non-nil if URL could be registered under this backend."
;; Check for DAV support on the web server.
t)
;;; Unimplemented functions
;;
;; vc-dav-latest-on-branch-p(URL)
......
......@@ -58,7 +58,6 @@
;; * create-repo () OK
;; * register (files &optional rev comment) OK
;; - responsible-p (file) OK
;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD
;; - receive-file (file rev) NOT NEEDED
;; - unregister (file) OK
;; * checkin (files rev comment) OK
......
......@@ -55,7 +55,6 @@
;; * register (files &optional rev comment) OK
;; * create-repo () OK
;; - responsible-p (file) OK
;; - could-register (file) OK
;; - receive-file (file rev) ?? PROBABLY NOT NEEDED
;; - unregister (file) OK
;; * checkin (files rev comment) OK
......@@ -450,17 +449,6 @@ Optional arg REVISION is a revision to annotate from."
(defalias 'vc-hg-responsible-p 'vc-hg-root)
;; Modeled after the similar function in vc-bzr.el
(defun vc-hg-could-register (file)
"Return non-nil if FILE could be registered under hg."
(and (vc-hg-responsible-p file) ; shortcut
(condition-case ()
(with-temp-buffer
(vc-hg-command t nil file "add" "--dry-run"))
;; The command succeeds with no output if file is
;; registered.
(error))))
(defun vc-hg-unregister (file)
"Unregister FILE from hg."
(vc-hg-command nil 0 file "forget"))
......
......@@ -180,7 +180,6 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(vc-mtn-command nil 0 files "add"))
(defun vc-mtn-responsible-p (file) (vc-mtn-root file))
(defun vc-mtn-could-register (file) (vc-mtn-root file))
(declare-function log-edit-extract-headers "log-edit" (headers string))
......
......@@ -43,7 +43,6 @@
;; * register (files &optional rev comment) OK
;; * create-repo () OK
;; * responsible-p (file) OK
;; * could-register (file) OK
;; - receive-file (file rev) NOT NEEDED
;; - unregister (file) NOT NEEDED
;; * checkin (files comment) OK
......@@ -232,8 +231,6 @@ This function differs from vc-do-command in that it invokes `vc-src-program'."
file
(file-name-directory file)))))
(defalias 'vc-could-register 'vc-src-responsible-p)
(defun vc-src-checkin (files comment)
"SRC-specific version of `vc-backend-checkin'.
REV is ignored."
......
......@@ -284,10 +284,6 @@ to the SVN command."
(defalias 'vc-svn-responsible-p 'vc-svn-root)
(defalias 'vc-svn-could-register 'vc-svn-root
"Return non-nil if FILE could be registered in SVN.
This is only possible if SVN is responsible for FILE's directory.")
(defun vc-svn-checkin (files comment &optional _extra-args-ignored)
"SVN-specific version of `vc-backend-checkin'."
(let ((status (apply
......
......@@ -227,11 +227,6 @@
;; like change log generation. The default implementation always
;; returns nil.
;;
;; - could-register (file)
;;
;; Return non-nil if FILE could be registered under this backend. The
;; default implementation always returns t.
;;
;; - receive-file (file rev)
;;
;; Let this backend "receive" a file that is already registered under
......@@ -612,6 +607,7 @@
;; call to it. A few older back ends retain versions for internal use in
;; their vc-state functions.
;;
;; could-register is no longer a public method. Only vc-cvs ever used it
;;; Todo:
......@@ -2824,11 +2820,6 @@ log entries should be gathered."
The default is to return nil always."
nil)
(defun vc-default-could-register (_backend _file)
"Return non-nil if BACKEND could be used to register FILE.
The default implementation returns t for all files."
t)
(defun vc-default-latest-on-branch-p (_backend _file)
"Return non-nil if FILE is the latest on its branch.
This default implementation always returns non-nil, which means that
......
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