aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond2014-12-01 06:23:10 -0500
committerEric S. Raymond2014-12-01 06:23:10 -0500
commit2f4f92007956983e6f5cb5136a57ddaa0cd9428e (patch)
treecd6c7d910134fca65f02e58fa1cdfd72f2d2cd6c
parent7536c8645e9f82b74bd4da5d91c325ab92beb541 (diff)
downloademacs-2f4f92007956983e6f5cb5136a57ddaa0cd9428e.tar.gz
emacs-2f4f92007956983e6f5cb5136a57ddaa0cd9428e.zip
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 9f9b6136429..f775afec65e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-12-01 Eric S. Raymond <esr@snark.thyrsus.com>
2
3 * vc/vc.el and all backends: API simplification; init-revision is
4 gone, and vc-registered functions no longer take an
5 initial-revision argument.
6
12014-11-29 Glenn Morris <rgm@gnu.org> 72014-11-29 Glenn Morris <rgm@gnu.org>
2 8
3 * vc/vc-src.el (vc-src, vc-src-diff-switches) 9 * 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 53b8e35ff93..6d2e47291dc 100644
--- a/lisp/vc/vc-arch.el
+++ b/lisp/vc/vc-arch.el
@@ -231,8 +231,7 @@ Only the value `maybe' can be trusted :-(."
231 "Return the administrative directory of FILE." 231 "Return the administrative directory of FILE."
232 (expand-file-name "{arch}" (vc-arch-root file))) 232 (expand-file-name "{arch}" (vc-arch-root file)))
233 233
234(defun vc-arch-register (files &optional rev _comment) 234(defun vc-arch-register (files &optional _comment)
235 (if rev (error "Explicit initial revision not supported for Arch"))
236 (dolist (file files) 235 (dolist (file files)
237 (let ((tagmet (vc-arch-tagging-method file))) 236 (let ((tagmet (vc-arch-tagging-method file)))
238 (if (and (memq tagmet '(tagline implicit)) comment-start) 237 (if (and (memq tagmet '(tagline implicit)) comment-start)
@@ -496,8 +495,6 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
496 "A wrapper around `vc-do-command' for use in vc-arch.el." 495 "A wrapper around `vc-do-command' for use in vc-arch.el."
497 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-arch-program file flags)) 496 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-arch-program file flags))
498 497
499(defun vc-arch-init-revision () nil)
500
501;;; Completion of versions and revisions. 498;;; Completion of versions and revisions.
502 499
503(defun vc-arch--version-completion-table (root string) 500(defun vc-arch--version-completion-table (root string)
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 7a1539bb7e3..afe8770ec10 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)."
580 "Create a new Bzr repository." 580 "Create a new Bzr repository."
581 (vc-bzr-command "init" nil 0 nil)) 581 (vc-bzr-command "init" nil 0 nil))
582 582
583(defun vc-bzr-init-revision (&optional _file)
584 "Always return nil, as Bzr cannot register explicit versions."
585 nil)
586
587(defun vc-bzr-previous-revision (_file rev) 583(defun vc-bzr-previous-revision (_file rev)
588 (if (string-match "\\`[0-9]+\\'" rev) 584 (if (string-match "\\`[0-9]+\\'" rev)
589 (number-to-string (1- (string-to-number rev))) 585 (number-to-string (1- (string-to-number rev)))
@@ -594,11 +590,8 @@ in the branch repository (or whose status not be determined)."
594 (number-to-string (1+ (string-to-number rev))) 590 (number-to-string (1+ (string-to-number rev)))
595 (error "Don't know how to compute the next revision of %s" rev))) 591 (error "Don't know how to compute the next revision of %s" rev)))
596 592
597(defun vc-bzr-register (files &optional rev _comment) 593(defun vc-bzr-register (files &optional _comment)
598 "Register FILES under bzr. 594 "Register FILES under bzr. COMMENT is ignored."
599Signal an error unless REV is nil.
600COMMENT is ignored."
601 (if rev (error "Can't register explicit revision with bzr"))
602 (vc-bzr-command "add" nil 0 files)) 595 (vc-bzr-command "add" nil 0 files))
603 596
604;; Could run `bzr status' in the directory and see if it succeeds, but 597;; 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 4bce79c5d5b..c938899a530 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -282,7 +282,7 @@ committed and support display of sticky tags."
282 282
283(autoload 'vc-switches "vc") 283(autoload 'vc-switches "vc")
284 284
285(defun vc-cvs-register (files &optional _rev comment) 285(defun vc-cvs-register (files &optional comment)
286 "Register FILES into the CVS version-control system. 286 "Register FILES into the CVS version-control system.
287COMMENT can be used to provide an initial description of FILES. 287COMMENT can be used to provide an initial description of FILES.
288Passes either `vc-cvs-register-switches' or `vc-register-switches' 288Passes either `vc-cvs-register-switches' or `vc-register-switches'
diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el
index df7801f6333..ff4d5e51b5c 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."
77 "Return the current workfile version of URL." 77 "Return the current workfile version of URL."
78 "Unknown") 78 "Unknown")
79 79
80(defun vc-dav-register (url &optional rev comment) 80(defun vc-dav-register (url &optional comment)
81 "Register URL in the DAV backend." 81 "Register URL in the DAV backend."
82 ;; Do we need to do anything here? FIXME? 82 ;; Do we need to do anything here? FIXME?
83 ) 83 )
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3a943132435..ae1b35636fd 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."
605 "Create a new Git repository." 605 "Create a new Git repository."
606 (vc-git-command nil 0 nil "init")) 606 (vc-git-command nil 0 nil "init"))
607 607
608(defun vc-git-register (files &optional _rev _comment) 608(defun vc-git-register (files &optional _comment)
609 "Register FILES into the git version-control system." 609 "Register FILES into the git version-control system."
610 (let (flist dlist) 610 (let (flist dlist)
611 (dolist (crt files) 611 (dolist (crt files)
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index d8cda912b61..337107f2ef4 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."
441 "Rename file from OLD to NEW using `hg mv'." 441 "Rename file from OLD to NEW using `hg mv'."
442 (vc-hg-command nil 0 new "mv" old)) 442 (vc-hg-command nil 0 new "mv" old))
443 443
444(defun vc-hg-register (files &optional _rev _comment) 444(defun vc-hg-register (files &optional _comment)
445 "Register FILES under hg. 445 "Register FILES under hg. COMMENT is ignored."
446REV is ignored.
447COMMENT is ignored."
448 (vc-hg-command nil 0 files "add")) 446 (vc-hg-command nil 0 files "add"))
449 447
450(defun vc-hg-create-repo () 448(defun vc-hg-create-repo ()
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 145fdeb93d8..f12ca0fd581 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."
179 (_ ?:)) 179 (_ ?:))
180 branch))) 180 branch)))
181 181
182(defun vc-mtn-register (files &optional _rev _comment) 182(defun vc-mtn-register (files &optional _comment)
183 (vc-mtn-command nil 0 files "add")) 183 (vc-mtn-command nil 0 files "add"))
184 184
185(defun vc-mtn-responsible-p (file) (vc-mtn-root file)) 185(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 341a1d4fd7e..572a83e7a38 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."
276 276
277(autoload 'vc-switches "vc") 277(autoload 'vc-switches "vc")
278 278
279(defun vc-rcs-register (files &optional rev comment) 279(defun vc-rcs-register (files &optional comment)
280 "Register FILES into the RCS version-control system. 280 "Register FILES into the RCS version-control system.
281REV is the optional revision number for the files. COMMENT can be used 281COMMENT can be used to provide an initial description for each FILES.
282to provide an initial description for each FILES.
283Passes either `vc-rcs-register-switches' or `vc-register-switches' 282Passes either `vc-rcs-register-switches' or `vc-register-switches'
284to the RCS command. 283to the RCS command.
285 284
286Automatically retrieve a read-only version of the file with keywords 285Automatically retrieve a read-only version of the file with keywords
287expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile." 286expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
288 (let (subdir name) 287 (let (subdir name)
289 ;; When REV is specified, we need to force using "-t-".
290 (when rev (unless comment (setq comment "")))
291 (dolist (file files) 288 (dolist (file files)
292 (and (not (file-exists-p 289 (and (not (file-exists-p
293 (setq subdir (expand-file-name "RCS" 290 (setq subdir (expand-file-name "RCS"
@@ -299,7 +296,6 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
299 (apply #'vc-do-command "*vc*" 0 "ci" file 296 (apply #'vc-do-command "*vc*" 0 "ci" file
300 ;; if available, use the secure registering option 297 ;; if available, use the secure registering option
301 (and (vc-rcs-release-p "5.6.4") "-i") 298 (and (vc-rcs-release-p "5.6.4") "-i")
302 (concat (if vc-keep-workfiles "-u" "-r") rev)
303 (and comment (concat "-t-" comment)) 299 (and comment (concat "-t-" comment))
304 (vc-switches 'RCS 'register)) 300 (vc-switches 'RCS 'register))
305 ;; parse output to find master file name and workfile version 301 ;; 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."
336(defun vc-rcs-receive-file (file rev) 332(defun vc-rcs-receive-file (file rev)
337 "Implementation of receive-file for RCS." 333 "Implementation of receive-file for RCS."
338 (let ((checkout-model (vc-rcs-checkout-model (list file)))) 334 (let ((checkout-model (vc-rcs-checkout-model (list file))))
339 (vc-rcs-register file rev "") 335 (vc-rcs-register file "")
340 (when (eq checkout-model 'implicit) 336 (when (eq checkout-model 'implicit)
341 (vc-rcs-set-non-strict-locking file)) 337 (vc-rcs-set-non-strict-locking file))
342 (vc-rcs-set-default-branch file (concat rev ".1")))) 338 (vc-rcs-set-default-branch file (concat rev ".1"))))
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el
index 26aa49c296f..46e191ad399 100644
--- a/lisp/vc/vc-sccs.el
+++ b/lisp/vc/vc-sccs.el
@@ -222,10 +222,9 @@ Optional string REV is a revision."
222 222
223(autoload 'vc-switches "vc") 223(autoload 'vc-switches "vc")
224 224
225(defun vc-sccs-register (files &optional rev comment) 225(defun vc-sccs-register (files &optional comment)
226 "Register FILES into the SCCS version-control system. 226 "Register FILES into the SCCS version-control system.
227REV is the optional revision number for the file. COMMENT can be used 227COMMENT can be used to provide an initial description of FILES.
228to provide an initial description of FILES.
229Passes either `vc-sccs-register-switches' or `vc-register-switches' 228Passes either `vc-sccs-register-switches' or `vc-register-switches'
230to the SCCS command. 229to the SCCS command.
231 230
@@ -239,7 +238,6 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
239 (or project-file 238 (or project-file
240 (format (car vc-sccs-master-templates) dirname basename)))) 239 (format (car vc-sccs-master-templates) dirname basename))))
241 (apply 'vc-sccs-do-command nil 0 "admin" vc-master-name 240 (apply 'vc-sccs-do-command nil 0 "admin" vc-master-name
242 (and rev (not (string= rev "")) (concat "-r" rev))
243 "-fb" 241 "-fb"
244 (concat "-i" (file-relative-name file)) 242 (concat "-i" (file-relative-name file))
245 (and comment (concat "-y" comment)) 243 (and comment (concat "-y" comment))
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index 61133684ef1..186f73f9890 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -44,7 +44,6 @@
44;; STATE-CHANGING FUNCTIONS 44;; STATE-CHANGING FUNCTIONS
45;; * register (files &optional rev comment) OK 45;; * register (files &optional rev comment) OK
46;; * create-repo () OK 46;; * create-repo () OK
47;; - init-revision () NOT NEEDED
48;; * responsible-p (file) OK 47;; * responsible-p (file) OK
49;; * could-register (file) OK 48;; * could-register (file) OK
50;; - receive-file (file rev) NOT NEEDED 49;; - receive-file (file rev) NOT NEEDED
@@ -228,10 +227,8 @@ This function differs from vc-do-command in that it invokes `vc-src-program'."
228 227
229(autoload 'vc-switches "vc") 228(autoload 'vc-switches "vc")
230 229
231(defun vc-src-register (files &optional _rev _comment) 230(defun vc-src-register (files &optional _comment)
232 "Register FILES under src. 231 "Register FILES under src. COMMENT is ignored."
233REV is ignored.
234COMMENT is ignored."
235 (vc-src-command nil files "add")) 232 (vc-src-command nil files "add"))
236 233
237(defun vc-src-responsible-p (file) 234(defun vc-src-responsible-p (file)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index bee16444728..62e68e221ee 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -228,21 +228,16 @@
228;; it so VC mode can add files to it. For file-oriented systems, this 228;; it so VC mode can add files to it. For file-oriented systems, this
229;; need do no more than create a subdirectory with the right name. 229;; need do no more than create a subdirectory with the right name.
230;; 230;;
231;; * register (files &optional rev comment) 231;; * register (files &optional comment)
232;; 232;;
233;; Register FILES in this backend. Optionally, an initial revision REV 233;; Register FILES in this backend. Optionally, an initial
234;; and an initial description of the file, COMMENT, may be specified, 234;; description of the file, COMMENT, may be specified, but it is not
235;; but it is not guaranteed that the backend will do anything with this. 235;; guaranteed that the backend will do anything with this. The
236;; The implementation should pass the value of vc-register-switches 236;; implementation should pass the value of vc-register-switches to
237;; to the backend command. (Note: in older versions of VC, this 237;; the backend command. (Note: in older versions of VC, this
238;; command took a single file argument and not a list.) 238;; command had an optional revision first argument that was
239;; The REV argument is a historical leftover and is never used. 239;; not used; in still older ones it took a single file argument and
240;; 240;; not a list.)
241;; - init-revision (file)
242;;
243;; The initial revision to use when registering FILE if one is not
244;; specified by the user. If not provided, the variable
245;; vc-default-init-revision is used instead.
246;; 241;;
247;; - responsible-p (file) 242;; - responsible-p (file)
248;; 243;;
@@ -599,6 +594,22 @@
599;; the project that contains DIR. 594;; the project that contains DIR.
600;; FIXME: what should it do with non-text conflicts? 595;; FIXME: what should it do with non-text conflicts?
601 596
597;;; Changes from the pre-25.1 API:
598;;
599;; - The 'editable' optional argument of vc-checkout is gone. The
600;; upper level assumes that all files are checked out editable. This
601;; moves closer to emulating modern non-locking behavior even on very
602;; old VCSes.
603;;
604;; - The init-revision function and the default-initial-revision
605;; variable are gone. These have't made sense on anything shipped
606;; since RCS, and using them was a dumb stunt even on RCS.
607;;
608;; - The vc-register function and its backend implementations no longer
609;; take a first optional revision argument, since on no system since
610;; RCS has setting the initial revision been even possible, let alone
611;; sane.
612
602;;; Todo: 613;;; Todo:
603 614
604;; - Get rid of the "master file" terminology. 615;; - Get rid of the "master file" terminology.
@@ -715,14 +726,6 @@
715 726
716(make-obsolete-variable 'vc-initial-comment "it has no effect." "23.2") 727(make-obsolete-variable 'vc-initial-comment "it has no effect." "23.2")
717 728
718(defcustom vc-default-init-revision "1.1"
719 "A string used as the default revision number when a new file is registered.
720This can be overridden by giving a prefix argument to \\[vc-register]. This
721can also be overridden by a particular VC backend."
722 :type 'string
723 :group 'vc
724 :version "20.3")
725
726(defcustom vc-checkin-switches nil 729(defcustom vc-checkin-switches nil
727 "A string or list of strings specifying extra switches for checkin. 730 "A string or list of strings specifying extra switches for checkin.
728These are passed to the checkin program by \\[vc-checkin]." 731These are passed to the checkin program by \\[vc-checkin]."
@@ -1294,12 +1297,11 @@ For old-style locking-based version control systems, like RCS:
1294(declare-function vc-dir-move-to-goal-column "vc-dir" ()) 1297(declare-function vc-dir-move-to-goal-column "vc-dir" ())
1295 1298
1296;;;###autoload 1299;;;###autoload
1297(defun vc-register (&optional set-revision vc-fileset comment) 1300(defun vc-register (&optional vc-fileset comment)
1298 "Register into a version control system. 1301 "Register into a version control system.
1299If VC-FILESET is given, register the files in that fileset. 1302If VC-FILESET is given, register the files in that fileset.
1300Otherwise register the current file. 1303Otherwise register the current file.
1301With prefix argument SET-REVISION, allow user to specify initial revision 1304If COMMENT is present, use that as an initial comment.
1302level. If COMMENT is present, use that as an initial comment.
1303 1305
1304The version control system to use is found by cycling through the list 1306The version control system to use is found by cycling through the list
1305`vc-handled-backends'. The first backend in that list which declares 1307`vc-handled-backends'. The first backend in that list which declares
@@ -1331,11 +1333,7 @@ first backend that could register the file is used."
1331 (vc-buffer-sync))))) 1333 (vc-buffer-sync)))))
1332 (message "Registering %s... " files) 1334 (message "Registering %s... " files)
1333 (mapc 'vc-file-clearprops files) 1335 (mapc 'vc-file-clearprops files)
1334 (vc-call-backend backend 'register files 1336 (vc-call-backend backend 'register files comment)
1335 (if set-revision
1336 (read-string (format "Initial revision level for %s: " files))
1337 (vc-call-backend backend 'init-revision))
1338 comment)
1339 (mapc 1337 (mapc
1340 (lambda (file) 1338 (lambda (file)
1341 (vc-file-setprop file 'vc-backend backend) 1339 (vc-file-setprop file 'vc-backend backend)
@@ -2839,8 +2837,6 @@ This default implementation always returns non-nil, which means that
2839editing non-current revisions is not supported by default." 2837editing non-current revisions is not supported by default."
2840 t) 2838 t)
2841 2839
2842(defun vc-default-init-revision (_backend) vc-default-init-revision)
2843
2844(defun vc-default-find-revision (backend file rev buffer) 2840(defun vc-default-find-revision (backend file rev buffer)
2845 "Provide the new `find-revision' op based on the old `checkout' op. 2841 "Provide the new `find-revision' op based on the old `checkout' op.
2846This is only for compatibility with old backends. They should be updated 2842This is only for compatibility with old backends. They should be updated