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>
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"))
;; 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)
;; * 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
;; * 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
(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"))
(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))
;; * 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
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."
(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
;; 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
;; 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:
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