]> git.eshelyaron.com Git - emacs.git/commitdiff
VC API simplification: remove ability to set initial revision.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 1 Dec 2014 11:23:10 +0000 (06:23 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 1 Dec 2014 11:23:10 +0000 (06:23 -0500)
This hasn't made any sense since RCS, and was a dumb stunt then.

* vc/vc.el and all backends: API simplification; init-revision is
gone, and vc-registered functions no longer take an initial-revision
argument.

12 files changed:
lisp/ChangeLog
lisp/vc/vc-arch.el
lisp/vc/vc-bzr.el
lisp/vc/vc-cvs.el
lisp/vc/vc-dav.el
lisp/vc/vc-git.el
lisp/vc/vc-hg.el
lisp/vc/vc-mtn.el
lisp/vc/vc-rcs.el
lisp/vc/vc-sccs.el
lisp/vc/vc-src.el
lisp/vc/vc.el

index 9f9b613642911694011a3a451a5d8c3daa5047fa..f775afec65e2fe163ee236bc7fcd42cc4074b13a 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-01  Eric S. Raymond  <esr@snark.thyrsus.com>
+
+       * vc/vc.el and all backends: API simplification; init-revision is
+       gone, and vc-registered functions no longer take an
+       initial-revision argument.
+
 2014-11-29  Glenn Morris  <rgm@gnu.org>
 
        * vc/vc-src.el (vc-src, vc-src-diff-switches)
index 53b8e35ff936b252f0f2bd0a29e16b3cd73fc7a9..6d2e47291dc217d8e427709e8ad59d46d27103e0 100644 (file)
@@ -231,8 +231,7 @@ Only the value `maybe' can be trusted :-(."
   "Return the administrative directory of FILE."
   (expand-file-name "{arch}" (vc-arch-root file)))
 
-(defun vc-arch-register (files &optional rev _comment)
-  (if rev (error "Explicit initial revision not supported for Arch"))
+(defun vc-arch-register (files &optional _comment)
   (dolist (file files)
     (let ((tagmet (vc-arch-tagging-method file)))
       (if (and (memq tagmet '(tagline implicit)) comment-start)
@@ -496,8 +495,6 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
   "A wrapper around `vc-do-command' for use in vc-arch.el."
   (apply 'vc-do-command (or buffer "*vc*") okstatus vc-arch-program file flags))
 
-(defun vc-arch-init-revision () nil)
-
 ;;; Completion of versions and revisions.
 
 (defun vc-arch--version-completion-table (root string)
index 7a1539bb7e369d15cc0226596bade057cae653a9..afe8770ec10efa9c4111f8c40750fae52c84ec76 100644 (file)
@@ -580,10 +580,6 @@ in the branch repository (or whose status not be determined)."
   "Create a new Bzr repository."
   (vc-bzr-command "init" nil 0 nil))
 
-(defun vc-bzr-init-revision (&optional _file)
-  "Always return nil, as Bzr cannot register explicit versions."
-  nil)
-
 (defun vc-bzr-previous-revision (_file rev)
   (if (string-match "\\`[0-9]+\\'" rev)
       (number-to-string (1- (string-to-number rev)))
@@ -594,11 +590,8 @@ in the branch repository (or whose status not be determined)."
       (number-to-string (1+ (string-to-number rev)))
     (error "Don't know how to compute the next revision of %s" rev)))
 
-(defun vc-bzr-register (files &optional rev _comment)
-  "Register FILES under bzr.
-Signal an error unless REV is nil.
-COMMENT is ignored."
-  (if rev (error "Can't register explicit revision with bzr"))
+(defun vc-bzr-register (files &optional _comment)
+  "Register FILES under bzr. COMMENT is ignored."
   (vc-bzr-command "add" nil 0 files))
 
 ;; Could run `bzr status' in the directory and see if it succeeds, but
index 4bce79c5d5bb6f7daa11be80d9a27077091df6f2..c938899a53051557d16d277ab8e529295d366b4b 100644 (file)
@@ -282,7 +282,7 @@ committed and support display of sticky tags."
 
 (autoload 'vc-switches "vc")
 
-(defun vc-cvs-register (files &optional _rev comment)
+(defun vc-cvs-register (files &optional comment)
   "Register FILES into the CVS version-control system.
 COMMENT can be used to provide an initial description of FILES.
 Passes either `vc-cvs-register-switches' or `vc-register-switches'
index df7801f63338b19ee2a4b5825547f1127c4f1d14..ff4d5e51b5c64225fb380ce43e98adf7806dda1c 100644 (file)
@@ -77,7 +77,7 @@ See `vc-checkout-model' for a list of possible values."
   "Return the current workfile version of URL."
   "Unknown")
 
-(defun vc-dav-register (url &optional rev comment)
+(defun vc-dav-register (url &optional comment)
   "Register URL in the DAV backend."
   ;; Do we need to do anything here?  FIXME?
   )
index 3a943132435d20d025075fe89fdfbff9ea367028..ae1b35636fd768d6187c376360ee35e34ecf7c7b 100644 (file)
@@ -605,7 +605,7 @@ The car of the list is the current branch."
   "Create a new Git repository."
   (vc-git-command nil 0 nil "init"))
 
-(defun vc-git-register (files &optional _rev _comment)
+(defun vc-git-register (files &optional _comment)
   "Register FILES into the git version-control system."
   (let (flist dlist)
     (dolist (crt files)
index d8cda912b61988be71c6a8708cd28537fe54b8c8..337107f2ef422d94a8ca299d6ddc532587dd9428 100644 (file)
@@ -441,10 +441,8 @@ Optional arg REVISION is a revision to annotate from."
   "Rename file from OLD to NEW using `hg mv'."
   (vc-hg-command nil 0 new "mv" old))
 
-(defun vc-hg-register (files &optional _rev _comment)
-  "Register FILES under hg.
-REV is ignored.
-COMMENT is ignored."
+(defun vc-hg-register (files &optional _comment)
+  "Register FILES under hg. COMMENT is ignored."
   (vc-hg-command nil 0 files "add"))
 
 (defun vc-hg-create-repo ()
index 145fdeb93d8c5659ad5b8d03b2cbd3e08b104796..f12ca0fd58154e5c3ae83b928cf57ab00a8b30e9 100644 (file)
@@ -179,7 +179,7 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
              (_ ?:))
            branch)))
 
-(defun vc-mtn-register (files &optional _rev _comment)
+(defun vc-mtn-register (files &optional _comment)
   (vc-mtn-command nil 0 files "add"))
 
 (defun vc-mtn-responsible-p (file) (vc-mtn-root file))
index 341a1d4fd7e3d77aba3b8b41476722e9b1ebef98..572a83e7a38230ce4b7401334ed538071bcfce30 100644 (file)
@@ -276,18 +276,15 @@ When VERSION is given, perform check for that version."
 
 (autoload 'vc-switches "vc")
 
-(defun vc-rcs-register (files &optional rev comment)
+(defun vc-rcs-register (files &optional comment)
   "Register FILES into the RCS version-control system.
-REV is the optional revision number for the files.  COMMENT can be used
-to provide an initial description for each FILES.
+COMMENT can be used to provide an initial description for each FILES.
 Passes either `vc-rcs-register-switches' or `vc-register-switches'
 to the RCS command.
 
 Automatically retrieve a read-only version of the file with keywords
 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
   (let (subdir name)
-    ;; When REV is specified, we need to force using "-t-".
-    (when rev (unless comment (setq comment "")))
     (dolist (file files)
       (and (not (file-exists-p
                 (setq subdir (expand-file-name "RCS"
@@ -299,7 +296,6 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
       (apply #'vc-do-command "*vc*" 0 "ci" file
             ;; if available, use the secure registering option
             (and (vc-rcs-release-p "5.6.4") "-i")
-            (concat (if vc-keep-workfiles "-u" "-r") rev)
             (and comment (concat "-t-" comment))
             (vc-switches 'RCS 'register))
       ;; parse output to find master file name and workfile version
@@ -336,7 +332,7 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
 (defun vc-rcs-receive-file (file rev)
   "Implementation of receive-file for RCS."
   (let ((checkout-model (vc-rcs-checkout-model (list file))))
-    (vc-rcs-register file rev "")
+    (vc-rcs-register file "")
     (when (eq checkout-model 'implicit)
       (vc-rcs-set-non-strict-locking file))
     (vc-rcs-set-default-branch file (concat rev ".1"))))
index 26aa49c296f3827291f76fc16a037f6ea0a8421c..46e191ad399b3fa0296eb50e57424c6d5403e6d5 100644 (file)
@@ -222,10 +222,9 @@ Optional string REV is a revision."
 
 (autoload 'vc-switches "vc")
 
-(defun vc-sccs-register (files &optional rev comment)
+(defun vc-sccs-register (files &optional comment)
   "Register FILES into the SCCS version-control system.
-REV is the optional revision number for the file.  COMMENT can be used
-to provide an initial description of FILES.
+COMMENT can be used to provide an initial description of FILES.
 Passes either `vc-sccs-register-switches' or `vc-register-switches'
 to the SCCS command.
 
@@ -239,7 +238,6 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
             (or project-file
                 (format (car vc-sccs-master-templates) dirname basename))))
        (apply 'vc-sccs-do-command nil 0 "admin" vc-master-name
-              (and rev (not (string= rev "")) (concat "-r" rev))
               "-fb"
               (concat "-i" (file-relative-name file))
               (and comment (concat "-y" comment))
index 61133684ef1dafad13332b5ffcec2b25213ea9d4..186f73f98909648677cc4c13b1259da3990c7582 100644 (file)
@@ -44,7 +44,6 @@
 ;; STATE-CHANGING FUNCTIONS
 ;; * register (files &optional rev comment)    OK
 ;; * create-repo ()                            OK
-;; - init-revision ()                          NOT NEEDED
 ;; * responsible-p (file)                      OK
 ;; * could-register (file)                     OK
 ;; - receive-file (file rev)                   NOT NEEDED
@@ -228,10 +227,8 @@ This function differs from vc-do-command in that it invokes `vc-src-program'."
 
 (autoload 'vc-switches "vc")
 
-(defun vc-src-register (files &optional _rev _comment)
-  "Register FILES under src.
-REV is ignored.
-COMMENT is ignored."
+(defun vc-src-register (files &optional _comment)
+  "Register FILES under src. COMMENT is ignored."
   (vc-src-command nil files "add"))
 
 (defun vc-src-responsible-p (file)
index bee1644472829dd430b731d4fa68cd577efc5e2c..62e68e221ee4969764c4e121d1723d355c518dc0 100644 (file)
 ;;   it so VC mode can add files to it.  For file-oriented systems, this
 ;;   need do no more than create a subdirectory with the right name.
 ;;
-;; * register (files &optional rev comment)
+;; * register (files &optional comment)
 ;;
-;;   Register FILES in this backend.  Optionally, an initial revision REV
-;;   and an initial description of the file, COMMENT, may be specified,
-;;   but it is not guaranteed that the backend will do anything with this.
-;;   The implementation should pass the value of vc-register-switches
-;;   to the backend command.  (Note: in older versions of VC, this
-;;   command took a single file argument and not a list.)
-;;   The REV argument is a historical leftover and is never used.
-;;
-;; - init-revision (file)
-;;
-;;   The initial revision to use when registering FILE if one is not
-;;   specified by the user.  If not provided, the variable
-;;   vc-default-init-revision is used instead.
+;;   Register FILES in this backend.  Optionally, an initial
+;;   description of the file, COMMENT, may be specified, but it is not
+;;   guaranteed that the backend will do anything with this.  The
+;;   implementation should pass the value of vc-register-switches to
+;;   the backend command.  (Note: in older versions of VC, this
+;;   command had an optional revision first argument that was
+;;   not used; in still older ones it took a single file argument and
+;;   not a list.)
 ;;
 ;; - responsible-p (file)
 ;;
 ;;   the project that contains DIR.
 ;;   FIXME: what should it do with non-text conflicts?
 
+;;; Changes from the pre-25.1 API:
+;;
+;; - The 'editable' optional argument of vc-checkout is gone. The
+;;   upper level assumes that all files are checked out editable. This
+;;   moves closer to emulating modern non-locking behavior even on very
+;;   old VCSes.
+;;
+;; - The init-revision function and the default-initial-revision
+;;   variable are gone.  These have't made sense on anything shipped
+;;   since RCS, and using them was a dumb stunt even on RCS.
+;;
+;; - The vc-register function and its backend implementations no longer
+;;   take a first optional revision argument, since on no system since
+;;   RCS has setting the initial revision been even possible, let alone
+;;   sane.
+
 ;;; Todo:
 
 ;; - Get rid of the "master file" terminology.
 
 (make-obsolete-variable 'vc-initial-comment "it has no effect." "23.2")
 
-(defcustom vc-default-init-revision "1.1"
-  "A string used as the default revision number when a new file is registered.
-This can be overridden by giving a prefix argument to \\[vc-register].  This
-can also be overridden by a particular VC backend."
-  :type 'string
-  :group 'vc
-  :version "20.3")
-
 (defcustom vc-checkin-switches nil
   "A string or list of strings specifying extra switches for checkin.
 These are passed to the checkin program by \\[vc-checkin]."
@@ -1294,12 +1297,11 @@ For old-style locking-based version control systems, like RCS:
 (declare-function vc-dir-move-to-goal-column "vc-dir" ())
 
 ;;;###autoload
-(defun vc-register (&optional set-revision vc-fileset comment)
+(defun vc-register (&optional vc-fileset comment)
   "Register into a version control system.
 If VC-FILESET is given, register the files in that fileset.
 Otherwise register the current file.
-With prefix argument SET-REVISION, allow user to specify initial revision
-level.  If COMMENT is present, use that as an initial comment.
+If COMMENT is present, use that as an initial comment.
 
 The version control system to use is found by cycling through the list
 `vc-handled-backends'.  The first backend in that list which declares
@@ -1331,11 +1333,7 @@ first backend that could register the file is used."
            (vc-buffer-sync)))))
     (message "Registering %s... " files)
     (mapc 'vc-file-clearprops files)
-    (vc-call-backend backend 'register files
-                    (if set-revision
-                        (read-string (format "Initial revision level for %s: " files))
-                      (vc-call-backend backend 'init-revision))
-                    comment)
+    (vc-call-backend backend 'register files comment)
     (mapc
      (lambda (file)
        (vc-file-setprop file 'vc-backend backend)
@@ -2839,8 +2837,6 @@ This default implementation always returns non-nil, which means that
 editing non-current revisions is not supported by default."
   t)
 
-(defun vc-default-init-revision (_backend) vc-default-init-revision)
-
 (defun vc-default-find-revision (backend file rev buffer)
   "Provide the new `find-revision' op based on the old `checkout' op.
 This is only for compatibility with old backends.  They should be updated