emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b7fd432: Remove could-register from the set of publ


From: Eric S. Raymond
Subject: [Emacs-diffs] master b7fd432: Remove could-register from the set of public VC backend methods,
Date: Mon, 01 Dec 2014 23:58:37 +0000

branch: master
commit b7fd432d56e352e25e6db4eaf5b081ddc5a39367
Author: Eric S. Raymond <address@hidden>
Commit: Eric S. Raymond <address@hidden>

    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.)
---
 lisp/ChangeLog    |    8 ++++++--
 lisp/vc/vc-bzr.el |   12 ------------
 lisp/vc/vc-dav.el |    5 -----
 lisp/vc/vc-git.el |    1 -
 lisp/vc/vc-hg.el  |   12 ------------
 lisp/vc/vc-mtn.el |    1 -
 lisp/vc/vc-src.el |    3 ---
 lisp/vc/vc-svn.el |    4 ----
 lisp/vc/vc.el     |   11 +----------
 9 files changed, 7 insertions(+), 50 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 76590e1..6c2b33e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,14 @@
 2014-12-01  Eric S. Raymond  <address@hidden>
 
-       * 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  <address@hidden>
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 48476dc..de6ae21 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)."
 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"))
diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el
index 46aa027..4271cf7 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
   ;; 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)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 8fdea8c..93a129c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -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
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 0f636c0..b5be8d5 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -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"))
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index e03d855..85aaf3d 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."
   (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))
 
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index 49c799c..c93ff96 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -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."
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 54b998d..55b8f11 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -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
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 121e329..40e4211 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]