summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-12-01 06:23:10 -0500
committerEric S. Raymond <esr@thyrsus.com>2014-12-01 06:23:10 -0500
commit2f4f92007956983e6f5cb5136a57ddaa0cd9428e (patch)
treecd6c7d910134fca65f02e58fa1cdfd72f2d2cd6c
parent7536c8645e9f82b74bd4da5d91c325ab92beb541 (diff)
VC API simplification: remove ability to set initial revision.
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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/vc/vc-arch.el5
-rw-r--r--lisp/vc/vc-bzr.el11
-rw-r--r--lisp/vc/vc-cvs.el2
-rw-r--r--lisp/vc/vc-dav.el2
-rw-r--r--lisp/vc/vc-git.el2
-rw-r--r--lisp/vc/vc-hg.el6
-rw-r--r--lisp/vc/vc-mtn.el2
-rw-r--r--lisp/vc/vc-rcs.el10
-rw-r--r--lisp/vc/vc-sccs.el6
-rw-r--r--lisp/vc/vc-src.el7
-rw-r--r--lisp/vc/vc.el60
12 files changed, 50 insertions, 69 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9f9b613642..f775afec65 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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)
diff --git a/lisp/vc/vc-arch.el b/lisp/vc/vc-arch.el
index 53b8e35ff9..6d2e47291d 100644
--- a/lisp/vc/vc-arch.el
+++ b/lisp/vc/vc-arch.el
@@ -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)
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 7a1539bb7e..afe8770ec1 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -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
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index 4bce79c5d5..c938899a53 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -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'
diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el
index df7801f633..ff4d5e51b5 100644
--- a/lisp/vc/vc-dav.el
+++ b/lisp/vc/vc-dav.el
@@ -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?
)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3a94313243..ae1b35636f 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -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)
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index d8cda912b6..337107f2ef 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -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 ()
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 145fdeb93d..f12ca0fd58 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -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))
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 341a1d4fd7..572a83e7a3 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -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"))))
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el
index 26aa49c296..46e191ad39 100644
--- a/lisp/vc/vc-sccs.el
+++ b/lisp/vc/vc-sccs.el
@@ -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))
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index 61133684ef..186f73f989 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -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)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index bee1644472..62e68e221e 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -228,21 +228,16 @@
;; 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)
;;
@@ -599,6 +594,22 @@
;; 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.
@@ -715,14 +726,6 @@
(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