diff options
| author | André Spiegel | 1995-08-17 14:10:09 +0000 |
|---|---|---|
| committer | André Spiegel | 1995-08-17 14:10:09 +0000 |
| commit | e163b283fe8af7f77ad0d89aec7b1786abb953e4 (patch) | |
| tree | 878e5b640f2edb1e35edf73d84a926613b162579 | |
| parent | 7d88be52791c8ddb18a49c34c132c64bf29faa35 (diff) | |
| download | emacs-e163b283fe8af7f77ad0d89aec7b1786abb953e4.tar.gz emacs-e163b283fe8af7f77ad0d89aec7b1786abb953e4.zip | |
(vc-next-action-on-file): Moved the setting of the default branch to
vc-backend-checkout, where it belongs.
(vc-backend-checkout): If an explicit version was specified, adjust
the default branch accordingly.
| -rw-r--r-- | lisp/vc.el | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index 12762a38f67..8698e302e14 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -526,11 +526,8 @@ to an optional list of FLAGS." | |||
| 526 | ) | 526 | ) |
| 527 | (if verbose | 527 | (if verbose |
| 528 | (if (not (eq vc-type 'SCCS)) | 528 | (if (not (eq vc-type 'SCCS)) |
| 529 | (let ((rev (read-string "Branch or version to move to: "))) | 529 | (vc-checkout file nil |
| 530 | (if (eq vc-type 'RCS) | 530 | (read-string "Branch or version to move to: ")) |
| 531 | (vc-do-command nil 0 "rcs" file 'MASTER | ||
| 532 | (concat "-b" rev))) | ||
| 533 | (vc-checkout file nil rev)) | ||
| 534 | (error "Sorry, this is not implemented for SCCS.")) | 531 | (error "Sorry, this is not implemented for SCCS.")) |
| 535 | (if (vc-latest-on-branch-p file) | 532 | (if (vc-latest-on-branch-p file) |
| 536 | (vc-checkout-writable-buffer file) | 533 | (vc-checkout-writable-buffer file) |
| @@ -1725,7 +1722,12 @@ From a program, any arguments are passed to the `rcs2log' script." | |||
| 1725 | vc-checkout-switches) | 1722 | vc-checkout-switches) |
| 1726 | (setq failed nil)) | 1723 | (setq failed nil)) |
| 1727 | (and failed (file-exists-p filename) (delete-file filename)))) | 1724 | (and failed (file-exists-p filename) (delete-file filename)))) |
| 1728 | (progn | 1725 | (let (new-version) |
| 1726 | ;; if we should go to the head of the trunk, | ||
| 1727 | ;; clear the default branch first | ||
| 1728 | (and rev (string= rev "") | ||
| 1729 | (vc-do-command nil 0 "rcs" file 'MASTER "-b")) | ||
| 1730 | ;; now do the checkout | ||
| 1729 | (apply 'vc-do-command | 1731 | (apply 'vc-do-command |
| 1730 | nil 0 "co" file 'MASTER | 1732 | nil 0 "co" file 'MASTER |
| 1731 | (if writable "-l") | 1733 | (if writable "-l") |
| @@ -1736,15 +1738,22 @@ From a program, any arguments are passed to the `rcs2log' script." | |||
| 1736 | (if workrev (concat "-r" workrev) | 1738 | (if workrev (concat "-r" workrev) |
| 1737 | nil))) | 1739 | nil))) |
| 1738 | vc-checkout-switches) | 1740 | vc-checkout-switches) |
| 1741 | ;; determine the new workfile version | ||
| 1739 | (save-excursion | 1742 | (save-excursion |
| 1740 | (set-buffer "*vc*") | 1743 | (set-buffer "*vc*") |
| 1741 | (goto-char (point-min)) | 1744 | (goto-char (point-min)) |
| 1742 | (if (re-search-forward "^revision \\([0-9.]+\\).*\n" nil t) | 1745 | (setq new-version |
| 1743 | (vc-file-setprop file 'vc-workfile-version | 1746 | (if (re-search-forward "^revision \\([0-9.]+\\).*\n" nil t) |
| 1744 | (buffer-substring (match-beginning 1) | 1747 | (buffer-substring (match-beginning 1) (match-end 1))))) |
| 1745 | (match-end 1))) | 1748 | (vc-file-setprop file 'vc-workfile-version new-version) |
| 1746 | (vc-file-setprop file 'vc-workfile-version nil))))) | 1749 | ;; if necessary, adjust the default branch |
| 1747 | (if workfile;; CVS | 1750 | (and rev (not (string= rev "")) |
| 1751 | (vc-do-command nil 0 "rcs" file 'MASTER | ||
| 1752 | (concat "-b" (if (vc-latest-on-branch-p file) | ||
| 1753 | (if (vc-trunk-p new-version) nil | ||
| 1754 | (vc-branch-part new-version)) | ||
| 1755 | new-version)))))) | ||
| 1756 | (if workfile ;; CVS | ||
| 1748 | ;; CVS is much like RCS | 1757 | ;; CVS is much like RCS |
| 1749 | (let ((failed t)) | 1758 | (let ((failed t)) |
| 1750 | (unwind-protect | 1759 | (unwind-protect |