aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/emacs/maintaining.texi2
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/vc/vc-git.el1
-rw-r--r--lisp/vc/vc-hg.el1
-rw-r--r--lisp/vc/vc-hooks.el8
-rw-r--r--lisp/vc/vc-mtn.el3
-rw-r--r--lisp/vc/vc-rcs.el37
-rw-r--r--lisp/vc/vc-sccs.el16
-rw-r--r--lisp/vc/vc-src.el1
-rw-r--r--lisp/vc/vc.el78
10 files changed, 20 insertions, 133 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 5fb15513ea0..63cd1ae3e44 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1018,8 +1018,6 @@ Revert the work file(s) in the current VC fileset to the last revision
1018(@code{vc-revert}). 1018(@code{vc-revert}).
1019@end table 1019@end table
1020 1020
1021@c `C-x v c' (vc-rollback) was removed, since it's RCS/SCCS specific.
1022
1023@kindex C-x v u 1021@kindex C-x v u
1024@findex vc-revert 1022@findex vc-revert
1025@vindex vc-revert-show-diff 1023@vindex vc-revert-show-diff
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 452f4c3e4a9..5916f2996e3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-12-12 Eric S. Raymond <esr@snark.thyrsus.com>
2
3 * vc/vc.el, vc/vc-hg.el, vc/vc-git.el, vc/vc-hooks.el,
4 vc/vc-mtn.el, vc/vc-rcs.el, vc/vc-sccs.el, vc/vc-src.el: rrollback
5 method removed, to be replaced in the future by uncommit.
6
12014-12-11 Michael Albinus <michael.albinus@gmx.de> 72014-12-11 Michael Albinus <michael.albinus@gmx.de>
2 8
3 * vc/vc-hg.el (vc-hg-state): Make FILE absolute. Handle the case 9 * vc/vc-hg.el (vc-hg-state): Make FILE absolute. Handle the case
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 048857b605d..b5e92bb50ac 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -65,7 +65,6 @@
65;; * find-revision (file rev buffer) OK 65;; * find-revision (file rev buffer) OK
66;; * checkout (file &optional rev) OK 66;; * checkout (file &optional rev) OK
67;; * revert (file &optional contents-done) OK 67;; * revert (file &optional contents-done) OK
68;; - rollback (files) COULD BE SUPPORTED
69;; - merge-file (file rev1 rev2) It would be possible to merge 68;; - merge-file (file rev1 rev2) It would be possible to merge
70;; changes into a single file, but 69;; changes into a single file, but
71;; when committing they wouldn't 70;; when committing they wouldn't
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index e049aab4316..90370839921 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -60,7 +60,6 @@
60;; * find-revision (file rev buffer) OK 60;; * find-revision (file rev buffer) OK
61;; * checkout (file &optional rev) OK 61;; * checkout (file &optional rev) OK
62;; * revert (file &optional contents-done) OK 62;; * revert (file &optional contents-done) OK
63;; - rollback (files) ?? PROBABLY NOT NEEDED
64;; - merge (file rev1 rev2) NEEDED 63;; - merge (file rev1 rev2) NEEDED
65;; - merge-news (file) NEEDED 64;; - merge-news (file) NEEDED
66;; - steal-lock (file &optional revision) NOT NEEDED 65;; - steal-lock (file &optional revision) NOT NEEDED
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 0ffca5645e2..5448f38f042 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -868,7 +868,6 @@ current, and kill the buffer that visits the link."
868 (let ((map (make-sparse-keymap))) 868 (let ((map (make-sparse-keymap)))
869 (define-key map "a" 'vc-update-change-log) 869 (define-key map "a" 'vc-update-change-log)
870 (define-key map "b" 'vc-switch-backend) 870 (define-key map "b" 'vc-switch-backend)
871 (define-key map "c" 'vc-rollback)
872 (define-key map "d" 'vc-dir) 871 (define-key map "d" 'vc-dir)
873 (define-key map "g" 'vc-annotate) 872 (define-key map "g" 'vc-annotate)
874 (define-key map "G" 'vc-ignore) 873 (define-key map "G" 'vc-ignore)
@@ -938,13 +937,6 @@ current, and kill the buffer that visits the link."
938 '(menu-item "Insert Header" vc-insert-headers 937 '(menu-item "Insert Header" vc-insert-headers
939 :help "Insert headers into a file for use with a version control system. 938 :help "Insert headers into a file for use with a version control system.
940")) 939"))
941 (bindings--define-key map [undo]
942 '(menu-item "Undo Last Check-In" vc-rollback
943 :enable (let ((backend (if buffer-file-name
944 (vc-backend buffer-file-name))))
945 (or (not backend)
946 (vc-find-backend-function backend 'rollback)))
947 :help "Remove the most recent changeset committed to the repository"))
948 (bindings--define-key map [vc-revert] 940 (bindings--define-key map [vc-revert]
949 '(menu-item "Revert to Base Version" vc-revert 941 '(menu-item "Revert to Base Version" vc-revert
950 :help "Revert working copies of the selected file set to their repository contents")) 942 :help "Revert working copies of the selected file set to their repository contents"))
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 57225f5f9ef..7d2f7349897 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -202,9 +202,6 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
202 (unless contents-done 202 (unless contents-done
203 (vc-mtn-command nil 0 file "revert"))) 203 (vc-mtn-command nil 0 file "revert")))
204 204
205;; (defun vc-mtn-rollback (files)
206;; )
207
208(defun vc-mtn-print-log (files buffer &optional _shortlog start-revision limit) 205(defun vc-mtn-print-log (files buffer &optional _shortlog start-revision limit)
209 "Print commit logs associated with FILES into specified BUFFER. 206 "Print commit logs associated with FILES into specified BUFFER.
210_SHORTLOG is ignored. 207_SHORTLOG is ignored.
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 9bb9af1ab47..8866bdbad96 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -432,43 +432,6 @@ attempt the checkout for all registered files beneath it."
432 new-version))))) 432 new-version)))))
433 (message "Checking out %s...done" file)))))) 433 (message "Checking out %s...done" file))))))
434 434
435(defun vc-rcs-rollback (files)
436 "Roll back, undoing the most recent checkins of FILES. Directories are
437expanded to all registered subfiles in them."
438 (if (not files)
439 (error "RCS backend doesn't support directory-level rollback"))
440 (dolist (file (vc-expand-dirs files 'RCS))
441 (let* ((discard (vc-working-revision file))
442 (previous (if (vc-rcs-trunk-p discard) "" (vc-branch-part discard)))
443 (config (current-window-configuration))
444 (done nil))
445 (if (null (yes-or-no-p (format "Remove version %s from %s history? "
446 discard file)))
447 (error "Aborted"))
448 (message "Removing revision %s from %s." discard file)
449 (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) (concat "-o" discard))
450 ;; Check out the most recent remaining version. If it
451 ;; fails, because the whole branch got deleted, do a
452 ;; double-take and check out the version where the branch
453 ;; started.
454 (while (not done)
455 (condition-case err
456 (progn
457 (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f"
458 (concat "-u" previous))
459 (setq done t))
460 (error (set-buffer "*vc*")
461 (goto-char (point-min))
462 (if (search-forward "no side branches present for" nil t)
463 (progn (setq previous (vc-branch-part previous))
464 (vc-rcs-set-default-branch file previous)
465 ;; vc-do-command popped up a window with
466 ;; the error message. Get rid of it, by
467 ;; restoring the old window configuration.
468 (set-window-configuration config))
469 ;; No, it was some other error: re-signal it.
470 (signal (car err) (cdr err)))))))))
471
472(defun vc-rcs-revert (file &optional _contents-done) 435(defun vc-rcs-revert (file &optional _contents-done)
473 "Revert FILE to the version it was based on. If FILE is a directory, 436 "Revert FILE to the version it was based on. If FILE is a directory,
474revert all registered files beneath it." 437revert all registered files beneath it."
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el
index a8e122d6f93..63628647fd4 100644
--- a/lisp/vc/vc-sccs.el
+++ b/lisp/vc/vc-sccs.el
@@ -271,22 +271,6 @@ locked. REV is the revision to check out."
271 switches)))) 271 switches))))
272 (message "Checking out %s...done" file)))) 272 (message "Checking out %s...done" file))))
273 273
274(defun vc-sccs-rollback (files)
275 "Roll back, undoing the most recent checkins of FILES. Directories
276are expanded to all version-controlled subfiles."
277 (setq files (vc-expand-dirs files 'SCCS))
278 (if (not files)
279 (error "SCCS backend doesn't support directory-level rollback"))
280 (dolist (file files)
281 (let ((discard (vc-working-revision file)))
282 (if (null (yes-or-no-p (format "Remove version %s from %s history? "
283 discard file)))
284 (error "Aborted"))
285 (message "Removing revision %s from %s..." discard file)
286 (vc-sccs-do-command nil 0 "rmdel"
287 (vc-master-name file) (concat "-r" discard))
288 (vc-sccs-do-command nil 0 "get" (vc-master-name file) nil))))
289
290(defun vc-sccs-revert (file &optional _contents-done) 274(defun vc-sccs-revert (file &optional _contents-done)
291 "Revert FILE to the version it was based on. If FILE is a directory, 275 "Revert FILE to the version it was based on. If FILE is a directory,
292revert all subfiles." 276revert all subfiles."
diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el
index 36d6a20f9b1..6ba8b8c809f 100644
--- a/lisp/vc/vc-src.el
+++ b/lisp/vc/vc-src.el
@@ -48,7 +48,6 @@
48;; * find-revision (file rev buffer) OK 48;; * find-revision (file rev buffer) OK
49;; * checkout (file &optional rev) OK 49;; * checkout (file &optional rev) OK
50;; * revert (file &optional contents-done) OK 50;; * revert (file &optional contents-done) OK
51;; - rollback (files) NOT NEEDED
52;; - merge (file rev1 rev2) NOT NEEDED 51;; - merge (file rev1 rev2) NOT NEEDED
53;; - merge-news (file) NOT NEEDED 52;; - merge-news (file) NOT NEEDED
54;; - steal-lock (file &optional revision) NOT NEEDED 53;; - steal-lock (file &optional revision) NOT NEEDED
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 3ea48096fdd..c6721cb511f 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -46,7 +46,7 @@
46;; If you maintain a client of the mode or customize it in your .emacs, 46;; If you maintain a client of the mode or customize it in your .emacs,
47;; note that some backend functions which formerly took single file arguments 47;; note that some backend functions which formerly took single file arguments
48;; now take a list of files. These include: register, checkin, print-log, 48;; now take a list of files. These include: register, checkin, print-log,
49;; rollback, and diff. 49;; and diff.
50 50
51;;; Commentary: 51;;; Commentary:
52 52
@@ -276,15 +276,6 @@
276;; If FILE is in the `added' state it should be returned to the 276;; If FILE is in the `added' state it should be returned to the
277;; `unregistered' state. 277;; `unregistered' state.
278;; 278;;
279;; - rollback (files)
280;;
281;; Remove the tip revision of each of FILES from the repository. If
282;; this function is not provided, trying to cancel a revision is
283;; caught as an error. (Most backends don't provide it.) (Also
284;; note that older versions of this backend command were called
285;; 'cancel-version' and took a single file arg, not a list of
286;; files.)
287;;
288;; - merge-file (file rev1 rev2) 279;; - merge-file (file rev1 rev2)
289;; 280;;
290;; Merge the changes between REV1 and REV2 into the current working 281;; Merge the changes between REV1 and REV2 into the current working
@@ -599,17 +590,28 @@
599;; variable are gone. These have't made sense on anything shipped 590;; variable are gone. These have't made sense on anything shipped
600;; since RCS, and using them was a dumb stunt even on RCS. 591;; since RCS, and using them was a dumb stunt even on RCS.
601;; 592;;
602;; workfile-unchanged-p is no longer a public back-end method. It 593;; - workfile-unchanged-p is no longer a public back-end method. It
603;; was redundant with vc-state and usually implemented with a trivial 594;; was redundant with vc-state and usually implemented with a trivial
604;; call to it. A few older back ends retain versions for internal use in 595;; call to it. A few older back ends retain versions for internal use in
605;; their vc-state functions. 596;; their vc-state functions.
606;; 597;;
607;; could-register is no longer a public method. Only vc-cvs ever used it 598;; - could-register is no longer a public method. Only vc-cvs ever used it
599;;
600;; The vc-keep-workfiles configuration variable is gone. Used only by
601;; the RCS and SCCS backends, it was an invitation to shoot self in foot
602;; when set to the (non-default) value nil. The original justication
603;; for it (saving disk space) is long obsolete.
604;;
605;; - The rollback method (implemented by RCS and SCCS only) is gone. See
606;; the to-do note on uncommit.
608 607
609;;; Todo: 608;;; Todo:
610 609
611;;;; New Primitives: 610;;;; New Primitives:
612;; 611;;
612;; - uncommit: undo last checkin, leave changes in place in the workfile,
613;; stash the commit comment for re-use.
614;;
613;; - deal with push operations. 615;; - deal with push operations.
614;; 616;;
615;;;; Primitives that need changing: 617;;;; Primitives that need changing:
@@ -2428,58 +2430,6 @@ to the working revision (except for keyword expansion)."
2428 (message "Reverting %s...done" (vc-delistify files))))) 2430 (message "Reverting %s...done" (vc-delistify files)))))
2429 2431
2430;;;###autoload 2432;;;###autoload
2431(defun vc-rollback ()
2432 "Roll back (remove) the most recent changeset committed to the repository.
2433This may be either a file-level or a repository-level operation,
2434depending on the underlying version-control system."
2435 (interactive)
2436 (let* ((vc-fileset (vc-deduce-fileset))
2437 (backend (car vc-fileset))
2438 (files (cadr vc-fileset))
2439 (granularity (vc-call-backend backend 'revision-granularity)))
2440 (unless (vc-find-backend-function backend 'rollback)
2441 (error "Rollback is not supported in %s" backend))
2442 (when (and (not (eq granularity 'repository)) (/= (length files) 1))
2443 (error "Rollback requires a singleton fileset or repository versioning"))
2444 ;; FIXME: latest-on-branch-p should take the fileset.
2445 (when (not (vc-call-backend backend 'latest-on-branch-p (car files)))
2446 (error "Rollback is only possible at the tip revision"))
2447 ;; If any of the files is visited by the current buffer, make
2448 ;; sure buffer is saved. If the user says `no', abort since
2449 ;; we cannot show the changes and ask for confirmation to
2450 ;; discard them.
2451 (when (or (not files) (memq (buffer-file-name) files))
2452 (vc-buffer-sync nil))
2453 (dolist (file files)
2454 (when (buffer-modified-p (get-file-buffer file))
2455 (error "Please kill or save all modified buffers before rollback"))
2456 (when (not (vc-up-to-date-p file))
2457 (error "Please revert all modified workfiles before rollback")))
2458 ;; Accumulate changes associated with the fileset
2459 (vc-setup-buffer "*vc-diff*")
2460 (set-buffer-modified-p nil)
2461 (message "Finding changes...")
2462 (let* ((tip (vc-working-revision (car files)))
2463 ;; FIXME: `previous-revision' should take the fileset.
2464 (previous (vc-call-backend backend 'previous-revision
2465 (car files) tip)))
2466 (vc-diff-internal nil vc-fileset previous tip))
2467 ;; Display changes
2468 (unless (yes-or-no-p "Discard these revisions? ")
2469 (error "Rollback canceled"))
2470 (quit-windows-on "*vc-diff*")
2471 ;; Do the actual reversions
2472 (message "Rolling back %s..." (vc-delistify files))
2473 (with-vc-properties
2474 files
2475 (vc-call-backend backend 'rollback files)
2476 `((vc-state . ,'up-to-date)
2477 (vc-checkout-time . , (nth 5 (file-attributes file)))
2478 (vc-working-revision . nil)))
2479 (dolist (f files) (vc-resynch-buffer f t t))
2480 (message "Rolling back %s...done" (vc-delistify files))))
2481
2482;;;###autoload
2483(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1") 2433(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
2484 2434
2485;;;###autoload 2435;;;###autoload