Mercurial > emacs
annotate lisp/vc.el @ 105642:5baebf489b9e
Ulrich Mueller <ulm at gentoo.org>
(doctor-adverbp): Exclude some nouns. (Bug#4565)
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 17 Oct 2009 03:08:56 +0000 |
parents | 6e1befdc92ef |
children | 6f463ea7a91a |
rev | line source |
---|---|
33564
d8c822512b62
(vc-version-diff): Bind inhibit-read-only when inserting text.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
33562
diff
changeset
|
1 ;;; vc.el --- drive a version-control system from within Emacs |
904 | 2 |
64762
41bb365f41c4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64091
diff
changeset
|
3 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, |
100908 | 4 ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
87893
160807cd63a7
(vc-diff-sentinel): Do not write a footer if there were differences.
Glenn Morris <rgm@gnu.org>
parents:
87879
diff
changeset
|
5 ;; Free Software Foundation, Inc. |
904 | 6 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
7 ;; Author: FSF (see below for full credits) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
8 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
39117 | 9 ;; Keywords: tools |
904 | 10 |
11 ;; This file is part of GNU Emacs. | |
12 | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94652
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
904 | 14 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94652
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94652
diff
changeset
|
16 ;; (at your option) any later version. |
904 | 17 |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94652
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
904 | 25 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
26 ;;; Credits: |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
27 |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
28 ;; VC was initially designed and implemented by Eric S. Raymond |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
29 ;; <esr@thyrsus.com> in 1992. Over the years, many other people have |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
30 ;; contributed substantial amounts of work to VC. These include: |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
31 ;; |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
32 ;; Per Cederqvist <ceder@lysator.liu.se> |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
33 ;; Paul Eggert <eggert@twinsun.com> |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
34 ;; Sebastian Kremer <sk@thp.uni-koeln.de> |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
35 ;; Martin Lorentzson <martinl@gnu.org> |
32910 | 36 ;; Dave Love <fx@gnu.org> |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
37 ;; Stefan Monnier <monnier@cs.yale.edu> |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
38 ;; Thien-Thi Nguyen <ttn@gnu.org> |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
39 ;; Dan Nicolaescu <dann@ics.uci.edu> |
41071 | 40 ;; J.D. Smith <jdsmith@alum.mit.edu> |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
41 ;; Andre Spiegel <spiegel@gnu.org> |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
42 ;; Richard Stallman <rms@gnu.org> |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
43 ;; |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
44 ;; In July 2007 ESR returned and redesigned the mode to cope better |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
45 ;; with modern version-control systems that do commits by fileset |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
46 ;; rather than per individual file. |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
47 ;; |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
48 ;; If you maintain a client of the mode or customize it in your .emacs, |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
49 ;; note that some backend functions which formerly took single file arguments |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
50 ;; now take a list of files. These include: register, checkin, print-log, |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
51 ;; rollback, and diff. |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
52 |
904 | 53 ;;; Commentary: |
54 | |
2402
61e1f8813d03
(vc-comment-to-changelog): A useful vc-checkin hook, added.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2226
diff
changeset
|
55 ;; This mode is fully documented in the Emacs user's manual. |
61e1f8813d03
(vc-comment-to-changelog): A useful vc-checkin hook, added.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2226
diff
changeset
|
56 ;; |
78875
2568254b40a4
Mention all supported VC backends.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78822
diff
changeset
|
57 ;; Supported version-control systems presently include CVS, RCS, GNU |
94806
eedf64b515f0
Remove wash-log from the VC backend API.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94805
diff
changeset
|
58 ;; Arch, Subversion, Bzr, Git, Mercurial, Monotone and SCCS |
78875
2568254b40a4
Mention all supported VC backends.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78822
diff
changeset
|
59 ;; (or its free replacement, CSSC). |
12943
10d0f42db2da
(vc-directory): Kill existing vc-dired buffers for this directory.
André Spiegel <spiegel@gnu.org>
parents:
12926
diff
changeset
|
60 ;; |
2402
61e1f8813d03
(vc-comment-to-changelog): A useful vc-checkin hook, added.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2226
diff
changeset
|
61 ;; If your site uses the ChangeLog convention supported by Emacs, the |
86908
6e9e38d61817
* log-edit.el (log-edit-show-diff): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86503
diff
changeset
|
62 ;; function `log-edit-comment-to-change-log' could prove a useful checkin hook, |
6e9e38d61817
* log-edit.el (log-edit-show-diff): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86503
diff
changeset
|
63 ;; although you might prefer to use C-c C-a (i.e. `log-edit-insert-changelog') |
51369
91b1fb194872
(vc-directory-exclusion-list): Add MCVS and .svn.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51245
diff
changeset
|
64 ;; from the commit buffer instead or to set `log-edit-setup-invert'. |
2402
61e1f8813d03
(vc-comment-to-changelog): A useful vc-checkin hook, added.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2226
diff
changeset
|
65 ;; |
904 | 66 ;; The vc code maintains some internal state in order to reduce expensive |
67 ;; version-control operations to a minimum. Some names are only computed | |
62610
4f2f430bf7c3
(vc-trunk-p): Add autoload cookie. The function is used in vc-rcs.el
André Spiegel <spiegel@gnu.org>
parents:
61705
diff
changeset
|
68 ;; once. If you perform version control operations with the backend while |
904 | 69 ;; vc's back is turned, or move/rename master files while vc is running, |
70 ;; vc may get seriously confused. Don't do these things! | |
71 ;; | |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
72 ;; ADDING SUPPORT FOR OTHER BACKENDS |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
73 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
74 ;; VC can use arbitrary version control systems as a backend. To add |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
75 ;; support for a new backend named SYS, write a library vc-sys.el that |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
76 ;; contains functions of the form `vc-sys-...' (note that SYS is in lower |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
77 ;; case for the function and library names). VC will use that library if |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
78 ;; you put the symbol SYS somewhere into the list of |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
79 ;; `vc-handled-backends'. Then, for example, if `vc-sys-registered' |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
80 ;; returns non-nil for a file, all SYS-specific versions of VC commands |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
81 ;; will be available for that file. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
82 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
83 ;; VC keeps some per-file information in the form of properties (see |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
84 ;; vc-file-set/getprop in vc-hooks.el). The backend-specific functions |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
85 ;; do not generally need to be aware of these properties. For example, |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
86 ;; `vc-sys-working-revision' should compute the working revision and |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
87 ;; return it; it should not look it up in the property, and it needn't |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
88 ;; store it there either. However, if a backend-specific function does |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
89 ;; store a value in a property, that value takes precedence over any |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40850
diff
changeset
|
90 ;; value that the generic code might want to set (check for uses of |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
91 ;; the macro `with-vc-properties' in vc.el). |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
92 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
93 ;; In the list of functions below, each identifier needs to be prepended |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
94 ;; with `vc-sys-'. Some of the functions are mandatory (marked with a |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
95 ;; `*'), others are optional (`-'). |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
96 ;; |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
97 ;; BACKEND PROPERTIES |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
98 ;; |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
99 ;; * revision-granularity |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
100 ;; |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
101 ;; Takes no arguments. Returns either 'file or 'repository. Backends |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
102 ;; that return 'file have per-file revision numbering; backends |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
103 ;; that return 'repository have per-repository revision numbering, |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
104 ;; so a revision level implicitly identifies a changeset |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
105 ;; |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
106 ;; STATE-QUERYING FUNCTIONS |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
107 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
108 ;; * registered (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
109 ;; |
78085
a861d80cf88c
* log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
110 ;; Return non-nil if FILE is registered in this backend. Both this |
78158
8dcc6f809d32
Add more info about the vc-registered function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78085
diff
changeset
|
111 ;; function as well as `state' should be careful to fail gracefully |
8dcc6f809d32
Add more info about the vc-registered function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78085
diff
changeset
|
112 ;; in the event that the backend executable is absent. It is |
8dcc6f809d32
Add more info about the vc-registered function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78085
diff
changeset
|
113 ;; preferable that this function's body is autoloaded, that way only |
8dcc6f809d32
Add more info about the vc-registered function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78085
diff
changeset
|
114 ;; calling vc-registered does not cause the backend to be loaded |
8dcc6f809d32
Add more info about the vc-registered function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78085
diff
changeset
|
115 ;; (all the vc-FOO-registered functions are called to try to find |
8dcc6f809d32
Add more info about the vc-registered function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78085
diff
changeset
|
116 ;; the controlling backend for FILE. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
117 ;; |
40958
4b4504c5aa56
* vc.el (vc-print-log): Bind `inhibit-read-only' to t before and
Sam Steingold <sds@gnu.org>
parents:
40850
diff
changeset
|
118 ;; * state (file) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
119 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
120 ;; Return the current version control state of FILE. For a list of |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
121 ;; possible values, see `vc-state'. This function should do a full and |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
122 ;; reliable state computation; it is usually called immediately after |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
123 ;; C-x v v. If you want to use a faster heuristic when visiting a |
94521
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
124 ;; file, put that into `state-heuristic' below. Note that under most |
94729
bf91c987049c
Remove VC-Dired and backend dir-state methods.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94722
diff
changeset
|
125 ;; VCSes this won't be called at all, dir-status is used instead. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
126 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
127 ;; - state-heuristic (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
128 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
129 ;; If provided, this function is used to estimate the version control |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
130 ;; state of FILE at visiting time. It should be considerably faster |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
131 ;; than the implementation of `state'. For a list of possible values, |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
132 ;; see the doc string of `vc-state'. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
133 ;; |
94003
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
134 ;; - dir-status (dir update-function) |
91960
81890a88d53d
(dir-status): Add a brief description.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
91951
diff
changeset
|
135 ;; |
93461
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93459
diff
changeset
|
136 ;; Produce RESULT: a list of lists of the form (FILE VC-STATE EXTRA) |
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93459
diff
changeset
|
137 ;; for the files in DIR. |
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93459
diff
changeset
|
138 ;; EXTRA can be used for backend specific information about FILE. |
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93459
diff
changeset
|
139 ;; If a command needs to be run to compute this list, it should be |
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93459
diff
changeset
|
140 ;; run asynchronously using (current-buffer) as the buffer for the |
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93459
diff
changeset
|
141 ;; command. When RESULT is computed, it should be passed back by |
94003
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
142 ;; doing: (funcall UPDATE-FUNCTION RESULT nil). |
94173
f062aad7dc37
(vc-dir-menu-map, vc-dir-mode-map, vc-dir-tool-bar-map):
Sam Steingold <sds@gnu.org>
parents:
94113
diff
changeset
|
143 ;; If the backend uses a process filter, hence it produces partial results, |
93670
80757ac2da77
(vc-default-status-fileinfo-extra): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93461
diff
changeset
|
144 ;; they can be passed back by doing: |
94003
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
145 ;; (funcall UPDATE-FUNCTION RESULT t) |
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
146 ;; and then do a (funcall UPDATE-FUNCTION RESULT nil) |
93670
80757ac2da77
(vc-default-status-fileinfo-extra): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93461
diff
changeset
|
147 ;; when all the results have been computed. |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
148 ;; To provide more backend specific functionality for `vc-dir' |
99159
b0dce7f34dda
* vc.el: Rename VC methods that were missed when vc-status was
Dan Nicolaescu <dann@ics.uci.edu>
parents:
98388
diff
changeset
|
149 ;; the following functions might be needed: `dir-extra-headers', |
b0dce7f34dda
* vc.el: Rename VC methods that were missed when vc-status was
Dan Nicolaescu <dann@ics.uci.edu>
parents:
98388
diff
changeset
|
150 ;; `dir-printer', `extra-dir-menu' and `dir-status-files'. |
91960
81890a88d53d
(dir-status): Add a brief description.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
91951
diff
changeset
|
151 ;; |
94059
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
152 ;; - dir-status-files (dir files default-state update-function) |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
153 ;; |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
154 ;; This function is identical to dir-status except that it should |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
155 ;; only report status for the specified FILES. Also it needs to |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
156 ;; report on all requested files, including up-to-date or ignored |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
157 ;; files. If not provided, the default is to consider that the files |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
158 ;; are in DEFAULT-STATE. |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
159 ;; |
99159
b0dce7f34dda
* vc.el: Rename VC methods that were missed when vc-status was
Dan Nicolaescu <dann@ics.uci.edu>
parents:
98388
diff
changeset
|
160 ;; - dir-extra-headers (dir) |
93382
8e46096e0cb3
* vc.el (vc-status-menu-map, vc-status-mode-map): Bind vc-revert.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93367
diff
changeset
|
161 ;; |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
162 ;; Return a string that will be added to the *vc-dir* buffer header. |
93333
53eee5c271f4
* vc.el: Add new backend function 'status-extra-headers.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93273
diff
changeset
|
163 ;; |
99159
b0dce7f34dda
* vc.el: Rename VC methods that were missed when vc-status was
Dan Nicolaescu <dann@ics.uci.edu>
parents:
98388
diff
changeset
|
164 ;; - dir-printer (fileinfo) |
93425
8459d55c7312
Allow backends to display backend specific information in
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93382
diff
changeset
|
165 ;; |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
166 ;; Pretty print the `vc-dir-fileinfo' FILEINFO. |
93425
8459d55c7312
Allow backends to display backend specific information in
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93382
diff
changeset
|
167 ;; If a backend needs to show more information than the default FILE |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
168 ;; and STATE in the vc-dir listing, it can store that extra |
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
169 ;; information in `vc-dir-fileinfo->extra'. This function can be |
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
170 ;; used to display that extra information in the *vc-dir* buffer. |
93425
8459d55c7312
Allow backends to display backend specific information in
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93382
diff
changeset
|
171 ;; |
93670
80757ac2da77
(vc-default-status-fileinfo-extra): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93461
diff
changeset
|
172 ;; - status-fileinfo-extra (file) |
80757ac2da77
(vc-default-status-fileinfo-extra): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93461
diff
changeset
|
173 ;; |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
174 ;; Compute `vc-dir-fileinfo->extra' for FILE. |
93670
80757ac2da77
(vc-default-status-fileinfo-extra): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93461
diff
changeset
|
175 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
176 ;; * working-revision (file) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
177 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
178 ;; Return the working revision of FILE. This is the revision fetched |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
179 ;; by the last checkout or upate, not necessarily the same thing as the |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
180 ;; head or tip revision. Should return "0" for a file added but not yet |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
181 ;; committed. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
182 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
183 ;; - latest-on-branch-p (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
184 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
185 ;; Return non-nil if the working revision of FILE is the latest revision |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
186 ;; on its branch (many VCSes call this the 'tip' or 'head' revision). |
85059
062474ac8e41
Terminology sync, workfile version -> focus version.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85042
diff
changeset
|
187 ;; The default implementation always returns t, which means that |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
188 ;; working with non-current revisions is not supported by default. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
189 ;; |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
190 ;; * checkout-model (files) |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
191 ;; |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
192 ;; Indicate whether FILES need to be "checked out" before they can be |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
193 ;; edited. See `vc-checkout-model' for a list of possible values. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
194 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
195 ;; - workfile-unchanged-p (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
196 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
197 ;; Return non-nil if FILE is unchanged from the working revision. |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
198 ;; This function should do a brief comparison of FILE's contents |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
199 ;; with those of the repository master of the working revision. If |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
200 ;; the backend does not have such a brief-comparison feature, the |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
201 ;; default implementation of this function can be used, which |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
202 ;; delegates to a full vc-BACKEND-diff. (Note that vc-BACKEND-diff |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
203 ;; must not run asynchronously in this case, see variable |
85059
062474ac8e41
Terminology sync, workfile version -> focus version.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85042
diff
changeset
|
204 ;; `vc-disable-async-diff'.) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
205 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
206 ;; - mode-line-string (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
207 ;; |
82027
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81990
diff
changeset
|
208 ;; If provided, this function should return the VC-specific mode |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
209 ;; line string for FILE. The returned string should have a |
82027
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81990
diff
changeset
|
210 ;; `help-echo' property which is the text to be displayed as a |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81990
diff
changeset
|
211 ;; tooltip when the mouse hovers over the VC entry on the mode-line. |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81990
diff
changeset
|
212 ;; The default implementation deals well with all states that |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81990
diff
changeset
|
213 ;; `vc-state' can return. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
214 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
215 ;; STATE-CHANGING FUNCTIONS |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
216 ;; |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
217 ;; * create-repo (backend) |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
218 ;; |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
219 ;; Create an empty repository in the current directory and initialize |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
220 ;; it so VC mode can add files to it. For file-oriented systems, this |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
221 ;; need do no more than create a subdirectory with the right name. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
222 ;; |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
223 ;; * register (files &optional rev comment) |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
224 ;; |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
225 ;; Register FILES in this backend. Optionally, an initial revision REV |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
226 ;; and an initial description of the file, COMMENT, may be specified, |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
227 ;; but it is not guaranteed that the backend will do anything with this. |
40440
6edf1e051b27
Mention vc-*-switches in backend API documentation.
André Spiegel <spiegel@gnu.org>
parents:
40181
diff
changeset
|
228 ;; The implementation should pass the value of vc-register-switches |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
229 ;; to the backend command. (Note: in older versions of VC, this |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
230 ;; command took a single file argument and not a list.) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
231 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
232 ;; - init-revision (file) |
43450
2b50b9c69fde
Patch by Jonathan Kamens <jik@kamens.brookline.ma.us>.
André Spiegel <spiegel@gnu.org>
parents:
42548
diff
changeset
|
233 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
234 ;; The initial revision to use when registering FILE if one is not |
43450
2b50b9c69fde
Patch by Jonathan Kamens <jik@kamens.brookline.ma.us>.
André Spiegel <spiegel@gnu.org>
parents:
42548
diff
changeset
|
235 ;; specified by the user. If not provided, the variable |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
236 ;; vc-default-init-revision is used instead. |
43450
2b50b9c69fde
Patch by Jonathan Kamens <jik@kamens.brookline.ma.us>.
André Spiegel <spiegel@gnu.org>
parents:
42548
diff
changeset
|
237 ;; |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
238 ;; - responsible-p (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
239 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
240 ;; Return non-nil if this backend considers itself "responsible" for |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
241 ;; FILE, which can also be a directory. This function is used to find |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
242 ;; out what backend to use for registration of new files and for things |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
243 ;; like change log generation. The default implementation always |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
244 ;; returns nil. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
245 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
246 ;; - could-register (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
247 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
248 ;; Return non-nil if FILE could be registered under this backend. The |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
249 ;; default implementation always returns t. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
250 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
251 ;; - receive-file (file rev) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
252 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
253 ;; Let this backend "receive" a file that is already registered under |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
254 ;; another backend. The default implementation simply calls `register' |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
255 ;; for FILE, but it can be overridden to do something more specific, |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
256 ;; e.g. keep revision numbers consistent or choose editing modes for |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
257 ;; FILE that resemble those of the other backend. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
258 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
259 ;; - unregister (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
260 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
261 ;; Unregister FILE from this backend. This is only needed if this |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
262 ;; backend may be used as a "more local" backend for temporary editing. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
263 ;; |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
264 ;; * checkin (files rev comment) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
265 ;; |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
266 ;; Commit changes in FILES to this backend. If REV is non-nil, that |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
267 ;; should become the new revision number (not all backends do |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
268 ;; anything with it). COMMENT is used as a check-in comment. The |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
269 ;; implementation should pass the value of vc-checkin-switches to |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
270 ;; the backend command. (Note: in older versions of VC, this |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
271 ;; command took a single file argument and not a list.) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
272 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
273 ;; * find-revision (file rev buffer) |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
274 ;; |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
275 ;; Fetch revision REV of file FILE and put it into BUFFER. |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
276 ;; If REV is the empty string, fetch the head of the trunk. |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
277 ;; The implementation should pass the value of vc-checkout-switches |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
278 ;; to the backend command. |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
279 ;; |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
280 ;; * checkout (file &optional editable rev) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
281 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
282 ;; Check out revision REV of FILE into the working area. If EDITABLE |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
283 ;; is non-nil, FILE should be writable by the user and if locking is |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
284 ;; used for FILE, a lock should also be set. If REV is non-nil, that |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
285 ;; is the revision to check out (default is the working revision). |
48964
7bba5b5ff0d2
(vc-next-action-on-file): Use t argument to vc-checkout in
André Spiegel <spiegel@gnu.org>
parents:
48142
diff
changeset
|
286 ;; If REV is t, that means to check out the head of the current branch; |
7bba5b5ff0d2
(vc-next-action-on-file): Use t argument to vc-checkout in
André Spiegel <spiegel@gnu.org>
parents:
48142
diff
changeset
|
287 ;; if it is the empty string, check out the head of the trunk. |
7bba5b5ff0d2
(vc-next-action-on-file): Use t argument to vc-checkout in
André Spiegel <spiegel@gnu.org>
parents:
48142
diff
changeset
|
288 ;; The implementation should pass the value of vc-checkout-switches |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
289 ;; to the backend command. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
290 ;; |
39000
60cf6aee9fd1
(vc-revert-file): Call the backend even if the FILE's
André Spiegel <spiegel@gnu.org>
parents:
38726
diff
changeset
|
291 ;; * revert (file &optional contents-done) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
292 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
293 ;; Revert FILE back to the working revision. If optional |
39000
60cf6aee9fd1
(vc-revert-file): Call the backend even if the FILE's
André Spiegel <spiegel@gnu.org>
parents:
38726
diff
changeset
|
294 ;; arg CONTENTS-DONE is non-nil, then the contents of FILE have |
60cf6aee9fd1
(vc-revert-file): Call the backend even if the FILE's
André Spiegel <spiegel@gnu.org>
parents:
38726
diff
changeset
|
295 ;; already been reverted from a version backup, and this function |
60cf6aee9fd1
(vc-revert-file): Call the backend even if the FILE's
André Spiegel <spiegel@gnu.org>
parents:
38726
diff
changeset
|
296 ;; only needs to update the status of FILE within the backend. |
104614
92965f3f01f0
Document the desired behavior for reverted files in the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104597
diff
changeset
|
297 ;; If FILE is in the `added' state it should be returned to the |
92965f3f01f0
Document the desired behavior for reverted files in the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104597
diff
changeset
|
298 ;; `unregistered' state. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
299 ;; |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
300 ;; - rollback (files) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
301 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
302 ;; Remove the tip revision of each of FILES from the repository. If |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
303 ;; this function is not provided, trying to cancel a revision is |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
304 ;; caught as an error. (Most backends don't provide it.) (Also |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
305 ;; note that older versions of this backend command were called |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
306 ;; 'cancel-version' and took a single file arg, not a list of |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
307 ;; files.) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
308 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
309 ;; - merge (file rev1 rev2) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
310 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
311 ;; Merge the changes between REV1 and REV2 into the current working file. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
312 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
313 ;; - merge-news (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
314 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
315 ;; Merge recent changes from the current branch into FILE. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
316 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
317 ;; - steal-lock (file &optional revision) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
318 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
319 ;; Steal any lock on the working revision of FILE, or on REVISION if |
85059
062474ac8e41
Terminology sync, workfile version -> focus version.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85042
diff
changeset
|
320 ;; that is provided. This function is only needed if locking is |
062474ac8e41
Terminology sync, workfile version -> focus version.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85042
diff
changeset
|
321 ;; used for files under this backend, and if files can indeed be |
062474ac8e41
Terminology sync, workfile version -> focus version.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85042
diff
changeset
|
322 ;; locked by other users. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
323 ;; |
87432
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
324 ;; - modify-change-comment (files rev comment) |
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
325 ;; |
87596
0f01cefc5aa8
Fix typo in comment. Reported by Tom Tromey <tromey@redhat.com>.
Juanma Barranquero <lekktu@gmail.com>
parents:
87590
diff
changeset
|
326 ;; Modify the change comments associated with the files at the |
87432
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
327 ;; given revision. This is optional, many backends do not support it. |
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
328 ;; |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
329 ;; - mark-resolved (files) |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
330 ;; |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
331 ;; Mark conflicts as resolved. Some VC systems need to run a |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
332 ;; command to mark conflicts as resolved. |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
333 ;; |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
334 ;; HISTORY FUNCTIONS |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
335 ;; |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
336 ;; * print-log (files &optional buffer shortlog) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
337 ;; |
81963
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
338 ;; Insert the revision log for FILES into BUFFER, or the *vc* buffer |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
339 ;; if BUFFER is nil. (Note: older versions of this function expected |
535f90fff765
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81957
diff
changeset
|
340 ;; only a single file argument.) |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
341 ;; If SHORTLOG is true insert a short version of the log. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
342 ;; |
78085
a861d80cf88c
* log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
343 ;; - log-view-mode () |
a861d80cf88c
* log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
344 ;; |
a861d80cf88c
* log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
345 ;; Mode to use for the output of print-log. This defaults to |
a861d80cf88c
* log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
346 ;; `log-view-mode' and is expected to be changed (if at all) to a derived |
a861d80cf88c
* log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
347 ;; mode of `log-view-mode'. |
a861d80cf88c
* log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
348 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
349 ;; - show-log-entry (revision) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
350 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
351 ;; If provided, search the log entry for REVISION in the current buffer, |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
352 ;; and make sure it is displayed in the buffer's window. The default |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
353 ;; implementation of this function works for RCS-style logs. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
354 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
355 ;; - comment-history (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
356 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
357 ;; Return a string containing all log entries that were made for FILE. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
358 ;; This is used for transferring a file from one backend to another, |
95587
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
359 ;; retaining comment information. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
360 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
361 ;; - update-changelog (files) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
362 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
363 ;; Using recent log entries, create ChangeLog entries for FILES, or for |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
364 ;; all files at or below the default-directory if FILES is nil. The |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
365 ;; default implementation runs rcs2log, which handles RCS- and |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
366 ;; CVS-style logs. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
367 ;; |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
368 ;; * diff (files &optional rev1 rev2 buffer) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
369 ;; |
54463
4598019c5c85
Add new optional BUFFER argument to vc-BACKEND-print-log and
André Spiegel <spiegel@gnu.org>
parents:
54398
diff
changeset
|
370 ;; Insert the diff for FILE into BUFFER, or the *vc-diff* buffer if |
4598019c5c85
Add new optional BUFFER argument to vc-BACKEND-print-log and
André Spiegel <spiegel@gnu.org>
parents:
54398
diff
changeset
|
371 ;; BUFFER is nil. If REV1 and REV2 are non-nil, report differences |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
372 ;; from REV1 to REV2. If REV1 is nil, use the working revision (as |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
373 ;; found in the repository) as the older revision; if REV2 is nil, |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
374 ;; use the current working-copy contents as the newer revision. This |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
375 ;; function should pass the value of (vc-switches BACKEND 'diff) to |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
376 ;; the backend command. It should return a status of either 0 (no |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
377 ;; differences found), or 1 (either non-empty diff or the diff is |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
378 ;; run asynchronously). |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
379 ;; |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
380 ;; - revision-completion-table (files) |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
381 ;; |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
382 ;; Return a completion table for existing revisions of FILES. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
383 ;; The default is to not use any completion table. |
40124
9031427edfa3
(vc-diff-internal, vc-coding-system-for-diff, vc-default-diff-tree):
André Spiegel <spiegel@gnu.org>
parents:
39427
diff
changeset
|
384 ;; |
58321
f398ebfc07e2
Update annotation-related comments.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57906
diff
changeset
|
385 ;; - annotate-command (file buf &optional rev) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
386 ;; |
58321
f398ebfc07e2
Update annotation-related comments.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57906
diff
changeset
|
387 ;; If this function is provided, it should produce an annotated display |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
388 ;; of FILE in BUF, relative to revision REV. Annotation means each line |
58321
f398ebfc07e2
Update annotation-related comments.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57906
diff
changeset
|
389 ;; of FILE displayed is prefixed with version information associated with |
f398ebfc07e2
Update annotation-related comments.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57906
diff
changeset
|
390 ;; its addition (deleted lines leave no history) and that the text of the |
f398ebfc07e2
Update annotation-related comments.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57906
diff
changeset
|
391 ;; file is fontified according to age. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
392 ;; |
40170
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
393 ;; - annotate-time () |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
394 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
395 ;; Only required if `annotate-command' is defined for the backend. |
40170
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
396 ;; Return the time of the next line of annotation at or after point, |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
397 ;; as a floating point fractional number of days. The helper |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
398 ;; function `vc-annotate-convert-time' may be useful for converting |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
399 ;; multi-part times as returned by `current-time' and `encode-time' |
42205 | 400 ;; to this format. Return nil if no more lines of annotation appear |
40170
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
401 ;; in the buffer. You can safely assume that point is placed at the |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
402 ;; beginning of each line, starting at `point-min'. The buffer that |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
403 ;; point is placed in is the Annotate output, as defined by the |
57114
deddb5e7acc3
(annotate-time): Document point handling.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
56952
diff
changeset
|
404 ;; relevant backend. This function also affects how much of the line |
deddb5e7acc3
(annotate-time): Document point handling.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
56952
diff
changeset
|
405 ;; is fontified; where it leaves point is where fontification begins. |
40170
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
406 ;; |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
407 ;; - annotate-current-time () |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
408 ;; |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
409 ;; Only required if `annotate-command' is defined for the backend, |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
410 ;; AND you'd like the current time considered to be anything besides |
82232
58ac5a791dfa
* vc.el: Document new VC operation `extra-menu'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
82213
diff
changeset
|
411 ;; (vc-annotate-convert-time (current-time)) -- i.e. the current |
40170
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
412 ;; time with hours, minutes, and seconds included. Probably safe to |
115527dd1d27
Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40164
diff
changeset
|
413 ;; ignore. Return the current-time, in units of fractional days. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
414 ;; |
53630
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
415 ;; - annotate-extract-revision-at-line () |
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
416 ;; |
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
417 ;; Only required if `annotate-command' is defined for the backend. |
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
418 ;; Invoked from a buffer in vc-annotate-mode, return the revision |
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
419 ;; corresponding to the current line, or nil if there is no revision |
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
420 ;; corresponding to the current line. |
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
421 ;; |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
422 ;; TAG SYSTEM |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
423 ;; |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
424 ;; - create-tag (dir name branchp) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
425 ;; |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
426 ;; Attach the tag NAME to the state of the working copy. This |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
427 ;; should make sure that files are up-to-date before proceeding with |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
428 ;; the action. DIR can also be a file and if BRANCHP is specified, |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
429 ;; NAME should be created as a branch and DIR should be checked out |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
430 ;; under this new branch. The default implementation does not |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
431 ;; support branches but does a sanity check, a tree traversal and |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
432 ;; assigns the tag to each file. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
433 ;; |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
434 ;; - retrieve-tag (dir name update) |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
435 ;; |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
436 ;; Retrieve the version tagged by NAME of all registered files at or below DIR. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
437 ;; If UPDATE is non-nil, then update buffers of any files in the |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
438 ;; tag that are currently visited. The default implementation |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
439 ;; does a sanity check whether there aren't any uncommitted changes at |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
440 ;; or below DIR, and then performs a tree walk, using the `checkout' |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
441 ;; function to retrieve the corresponding revisions. |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
442 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
443 ;; MISCELLANEOUS |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
444 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
445 ;; - make-version-backups-p (file) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
446 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
447 ;; Return non-nil if unmodified repository revisions of FILE should be |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
448 ;; backed up locally. If this is done, VC can perform `diff' and |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
449 ;; `revert' operations itself, without calling the backend system. The |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
450 ;; default implementation always returns nil. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
451 ;; |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
452 ;; - root (file) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
453 ;; Return the root of the VC controlled hierarchy for file. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
454 ;; |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
455 ;; - repository-hostname (dirname) |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
456 ;; |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
457 ;; Return the hostname that the backend will have to contact |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
458 ;; in order to operate on a file in DIRNAME. If the return value |
56952
1e43327f7457
(vc-buffer-context, vc-restore-buffer-context): Disable obsolete code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55100
diff
changeset
|
459 ;; is nil, it means that the repository is local. |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
460 ;; This function is used in `vc-stay-local-p' which backends can use |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
461 ;; for their convenience. |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
462 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
463 ;; - previous-revision (file rev) |
42548
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
464 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
465 ;; Return the revision number that precedes REV for FILE, or nil if no such |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
466 ;; revision exists. |
53630
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
467 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
468 ;; - next-revision (file rev) |
53630
2f41b6c48585
* vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents:
53283
diff
changeset
|
469 ;; |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
470 ;; Return the revision number that follows REV for FILE, or nil if no such |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
471 ;; revision exists. |
42548
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
472 ;; |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
473 ;; - check-headers () |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
474 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
475 ;; Return non-nil if the current buffer contains any version headers. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
476 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
477 ;; - clear-headers () |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
478 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
479 ;; In the current buffer, reset all version headers to their unexpanded |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
480 ;; form. This function should be provided if the state-querying code |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
481 ;; for this backend uses the version headers to determine the state of |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
482 ;; a file. This function will then be called whenever VC changes the |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
483 ;; version control state in such a way that the headers would give |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
484 ;; wrong information. |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
485 ;; |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
486 ;; - delete-file (file) |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
487 ;; |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
488 ;; Delete FILE and mark it as deleted in the repository. If this |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
489 ;; function is not provided, the command `vc-delete-file' will |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
490 ;; signal an error. |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
491 ;; |
35199
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
492 ;; - rename-file (old new) |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
493 ;; |
aa38d1de35cb
Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents:
35131
diff
changeset
|
494 ;; Rename file OLD to NEW, both in the working area and in the |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
495 ;; repository. If this function is not provided, the renaming |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
496 ;; will be done by (vc-delete-file old) and (vc-register new). |
51627
1329f6a6c949
(vc-rename-file): Fix typo.
Luc Teirlinck <teirllm@auburn.edu>
parents:
51369
diff
changeset
|
497 ;; |
54398
2decd50569f3
Document new find-file-hook operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53874
diff
changeset
|
498 ;; - find-file-hook () |
2decd50569f3
Document new find-file-hook operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53874
diff
changeset
|
499 ;; |
54530
b217df9a35e0
Document new backend operation `find-file-not-found-hook'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54463
diff
changeset
|
500 ;; Operation called in current buffer when opening a file. This can |
54398
2decd50569f3
Document new find-file-hook operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53874
diff
changeset
|
501 ;; be used by the backend to setup some local variables it might need. |
82232
58ac5a791dfa
* vc.el: Document new VC operation `extra-menu'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
82213
diff
changeset
|
502 ;; |
78822
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
503 ;; - extra-menu () |
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
504 ;; |
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
505 ;; Return a menu keymap, the items in the keymap will appear at the |
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
506 ;; end of the Version Control menu. The goal is to allow backends |
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
507 ;; to specify extra menu items that appear in the VC menu. This way |
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
508 ;; you can provide menu entries for functionality that is specific |
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
509 ;; to your backend and which does not map to any of the VC generic |
1926a08e8926
* vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78599
diff
changeset
|
510 ;; concepts. |
91951
d42fe75822fe
* vc.el (vc-status-menu, vc-status-menu-map-filter): New functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
91944
diff
changeset
|
511 ;; |
99159
b0dce7f34dda
* vc.el: Rename VC methods that were missed when vc-status was
Dan Nicolaescu <dann@ics.uci.edu>
parents:
98388
diff
changeset
|
512 ;; - extra-dir-menu () |
91951
d42fe75822fe
* vc.el (vc-status-menu, vc-status-menu-map-filter): New functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
91944
diff
changeset
|
513 ;; |
92122
74bf6df13b6c
* vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92093
diff
changeset
|
514 ;; Return a menu keymap, the items in the keymap will appear at the |
74bf6df13b6c
* vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92093
diff
changeset
|
515 ;; end of the VC Status menu. The goal is to allow backends to |
74bf6df13b6c
* vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92093
diff
changeset
|
516 ;; specify extra menu items that appear in the VC Status menu. This |
74bf6df13b6c
* vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92093
diff
changeset
|
517 ;; makes it possible to provide menu entries for functionality that |
74bf6df13b6c
* vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92093
diff
changeset
|
518 ;; is specific to a backend and which does not map to any of the VC |
74bf6df13b6c
* vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92093
diff
changeset
|
519 ;; generic concepts. |
904 | 520 |
87743
c2a952d12e21
* smerge-mode.el (smerge-auto): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87739
diff
changeset
|
521 ;;; Todo: |
c2a952d12e21
* smerge-mode.el (smerge-auto): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87739
diff
changeset
|
522 |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
523 ;; - Get rid of the "master file" terminology. |
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
524 |
95269
1e9eb6106f5a
(vc-delete-file): Don't try to resynch the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95079
diff
changeset
|
525 ;; - Add key-binding for vc-delete-file. |
1e9eb6106f5a
(vc-delete-file): Don't try to resynch the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95079
diff
changeset
|
526 |
94861
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
527 ;;;; New Primitives: |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
528 ;; |
93362 | 529 ;; - deal with push/pull operations. |
530 ;; | |
94861
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
531 ;; - add a mechanism for editing the underlying VCS's list of files |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
532 ;; to be ignored, when that's possible. |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
533 ;; |
94883
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
534 ;;;; Primitives that need changing: |
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
535 ;; |
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
536 ;; - vc-update/vc-merge should deal with VC systems that don't |
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
537 ;; update/merge on a file basis, but on a whole repository basis. |
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
538 ;; vc-update and vc-merge assume the arguments are always files, |
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
539 ;; they don't deal with directories. Make sure the *vc-dir* buffer |
95587
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
540 ;; is updated after these operations. |
94883
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
541 ;; At least bzr, git and hg should benefit from this. |
b615f9b9d57e
Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94882
diff
changeset
|
542 ;; |
94861
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
543 ;;;; Improved branch and tag handling: |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
544 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
545 ;; - add a generic mechanism for remembering the current branch names, |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
546 ;; display the branch name in the mode-line. Replace |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
547 ;; vc-cvs-sticky-tag with that. |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
548 ;; |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
549 ;; - vc-create-tag and vc-retrieve-tag should update the |
94861
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
550 ;; buffers that might be visiting the affected files. |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
551 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
552 ;;;; Default Behavior: |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
553 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
554 ;; - vc-responsible-backend should not return RCS if no backend |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
555 ;; declares itself responsible. |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
556 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
557 ;;;; Internal cleanups: |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
558 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
559 ;; - backends that care about vc-stay-local should try to take it into |
95269
1e9eb6106f5a
(vc-delete-file): Don't try to resynch the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95079
diff
changeset
|
560 ;; account for vc-dir. Is this likely to be useful??? YES! |
94861
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
561 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
562 ;; - vc-expand-dirs should take a backend parameter and only look for |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
563 ;; files managed by that backend. |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
564 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
565 ;; - Another important thing: merge all the status-like backend operations. |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
566 ;; We should remove dir-status, state, and dir-status-files, and |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
567 ;; replace them with just `status' which takes a fileset and a continuation |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
568 ;; (like dir-status) and returns a buffer in which the process(es) are run |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
569 ;; (or nil if it worked synchronously). Hopefully we can define the old |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
570 ;; 4 operations in term of this one. |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
571 ;; |
142a56989604
Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94857
diff
changeset
|
572 ;;;; Other |
93362 | 573 ;; |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
574 ;; - when a file is in `conflict' state, turn on smerge-mode. |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
575 ;; |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
576 ;; - figure out what to do with conflicts that are not caused by the |
94569
c6ccf57e7e6e
Added to-do items.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94563
diff
changeset
|
577 ;; file contents, but by metadata or other causes. Example: File A |
c6ccf57e7e6e
Added to-do items.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94563
diff
changeset
|
578 ;; gets renamed to B in one branch and to C in another and you merge |
c6ccf57e7e6e
Added to-do items.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94563
diff
changeset
|
579 ;; the two branches. Or you locally add file FOO and then pull a |
c6ccf57e7e6e
Added to-do items.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94563
diff
changeset
|
580 ;; change that also adds a new file FOO, ... |
87743
c2a952d12e21
* smerge-mode.el (smerge-auto): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87739
diff
changeset
|
581 ;; |
93362 | 582 ;; - make it easier to write logs. Maybe C-x 4 a should add to the log |
583 ;; buffer, if one is present, instead of adding to the ChangeLog. | |
87743
c2a952d12e21
* smerge-mode.el (smerge-auto): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87739
diff
changeset
|
584 ;; |
94488
d3100c0eddb7
(vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94481
diff
changeset
|
585 ;; - When vc-next-action calls vc-checkin it could pre-fill the |
d3100c0eddb7
(vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94481
diff
changeset
|
586 ;; *VC-log* buffer with some obvious items: the list of files that |
d3100c0eddb7
(vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94481
diff
changeset
|
587 ;; were added, the list of files that were removed. If the diff is |
d3100c0eddb7
(vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94481
diff
changeset
|
588 ;; available, maybe it could even call something like |
d3100c0eddb7
(vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94481
diff
changeset
|
589 ;; `diff-add-change-log-entries-other-window' to create a detailed |
d3100c0eddb7
(vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94481
diff
changeset
|
590 ;; skeleton for the log... |
d3100c0eddb7
(vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94481
diff
changeset
|
591 ;; |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
592 ;; - most vc-dir backends need more work. They might need to |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
593 ;; provide custom headers, use the `extra' field and deal with all |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
594 ;; possible VC states. |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
595 ;; |
94836 | 596 ;; - add a function that calls vc-dir to `find-directory-functions'. |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
597 ;; |
92091
f6aa0a65fa82
(vc-exec-after): Move setting mode-line-process in the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92038
diff
changeset
|
598 ;; - vc-diff, vc-annotate, etc. need to deal better with unregistered |
f6aa0a65fa82
(vc-exec-after): Move setting mode-line-process in the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92038
diff
changeset
|
599 ;; files. Now that unregistered and ignored files are shown in |
94729
bf91c987049c
Remove VC-Dired and backend dir-state methods.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94722
diff
changeset
|
600 ;; vc-dir, it is possible that these commands are called |
92091
f6aa0a65fa82
(vc-exec-after): Move setting mode-line-process in the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92038
diff
changeset
|
601 ;; for unregistered/ignored files. |
f6aa0a65fa82
(vc-exec-after): Move setting mode-line-process in the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92038
diff
changeset
|
602 ;; |
96215 | 603 ;; - vc-next-action needs work in order to work with multiple |
604 ;; backends: `vc-state' returns the state for the default backend, | |
605 ;; not for the backend in the current *vc-dir* buffer. | |
94518
7bd70b5b8bda
Add items to TODO list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94510
diff
changeset
|
606 ;; |
96203 | 607 ;; - vc-dir-kill-dir-status-process should not be specific to dir-status, |
608 ;; it should work for other async commands done through vc-do-command | |
609 ;; as well, | |
610 ;; | |
611 ;; - vc-dir toolbar needs more icons. | |
612 ;; | |
96886 | 613 ;; - The backends should avoid using `vc-file-setprop' and `vc-file-getprop'. |
614 ;; | |
904 | 615 ;;; Code: |
616 | |
617 (require 'vc-hooks) | |
94571
61cca370b8f5
vc-dispatcher layer separation.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94570
diff
changeset
|
618 (require 'vc-dispatcher) |
92523
5da8fdae3248
(vc-status-tool-bar-map, vc-status-toggle-mark-file)
Jan Djärv <jan.h.d@swipnet.se>
parents:
92347
diff
changeset
|
619 |
94573
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
620 (eval-when-compile |
94582
8393f040d26d
Move VC-Dired code from vc.el to vc-dispatcher.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94579
diff
changeset
|
621 (require 'cl)) |
94573
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
622 |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
623 (unless (assoc 'vc-parent-buffer minor-mode-alist) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
624 (setq minor-mode-alist |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
625 (cons '(vc-parent-buffer vc-parent-buffer-name) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
626 minor-mode-alist))) |
904 | 627 |
628 ;; General customization | |
629 | |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
630 (defgroup vc nil |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
631 "Version-control system in Emacs." |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
632 :group 'tools) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
633 |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
634 (defcustom vc-initial-comment nil |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
635 "If non-nil, prompt for initial comment when a file is registered." |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
636 :type 'boolean |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
637 :group 'vc) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
638 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
639 (defcustom vc-default-init-revision "1.1" |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
640 "A string used as the default revision number when a new file is registered. |
43450
2b50b9c69fde
Patch by Jonathan Kamens <jik@kamens.brookline.ma.us>.
André Spiegel <spiegel@gnu.org>
parents:
42548
diff
changeset
|
641 This can be overridden by giving a prefix argument to \\[vc-register]. This |
2b50b9c69fde
Patch by Jonathan Kamens <jik@kamens.brookline.ma.us>.
André Spiegel <spiegel@gnu.org>
parents:
42548
diff
changeset
|
642 can also be overridden by a particular VC backend." |
20988
9a6179e6eff6
(vc-default-init-version): New variable.
André Spiegel <spiegel@gnu.org>
parents:
20977
diff
changeset
|
643 :type 'string |
21669
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21560
diff
changeset
|
644 :group 'vc |
9861518505cb
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21560
diff
changeset
|
645 :version "20.3") |
20988
9a6179e6eff6
(vc-default-init-version): New variable.
André Spiegel <spiegel@gnu.org>
parents:
20977
diff
changeset
|
646 |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
647 (defcustom vc-checkin-switches nil |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
648 "A string or list of strings specifying extra switches for checkin. |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
649 These are passed to the checkin program by \\[vc-checkin]." |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
650 :type '(choice (const :tag "None" nil) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
651 (string :tag "Argument String") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
652 (repeat :tag "Argument List" |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
653 :value ("") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
654 string)) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
655 :group 'vc) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
656 |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
657 (defcustom vc-checkout-switches nil |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
658 "A string or list of strings specifying extra switches for checkout. |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
659 These are passed to the checkout program by \\[vc-checkout]." |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
660 :type '(choice (const :tag "None" nil) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
661 (string :tag "Argument String") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
662 (repeat :tag "Argument List" |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
663 :value ("") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
664 string)) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
665 :group 'vc) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
666 |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
667 (defcustom vc-register-switches nil |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
668 "A string or list of strings; extra switches for registering a file. |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
669 These are passed to the checkin program by \\[vc-register]." |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
670 :type '(choice (const :tag "None" nil) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
671 (string :tag "Argument String") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
672 (repeat :tag "Argument List" |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
673 :value ("") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
674 string)) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
675 :group 'vc) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
676 |
35820
3cfa6e077b83
(vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
35199
diff
changeset
|
677 (defcustom vc-diff-switches nil |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
678 "A string or list of strings specifying switches for diff under VC. |
100187 | 679 When running diff under a given BACKEND, VC uses the first |
680 non-nil value of `vc-BACKEND-diff-switches', `vc-diff-switches', | |
681 and `diff-switches', in that order. Since nil means to check the | |
682 next variable in the sequence, either of the first two may use | |
683 the value t to mean no switches at all. `vc-diff-switches' | |
684 should contain switches that are specific to version control, but | |
685 not specific to any particular backend." | |
686 :type '(choice (const :tag "Unspecified" nil) | |
687 (const :tag "None" t) | |
35820
3cfa6e077b83
(vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
35199
diff
changeset
|
688 (string :tag "Argument String") |
100187 | 689 (repeat :tag "Argument List" :value ("") string)) |
35820
3cfa6e077b83
(vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
35199
diff
changeset
|
690 :group 'vc |
3cfa6e077b83
(vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
35199
diff
changeset
|
691 :version "21.1") |
3cfa6e077b83
(vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
35199
diff
changeset
|
692 |
71446
b0324f716b87
(vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents:
71228
diff
changeset
|
693 (defcustom vc-diff-knows-L nil |
100171 | 694 "Indicates whether diff understands the -L option. |
71446
b0324f716b87
(vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents:
71228
diff
changeset
|
695 The value is either `yes', `no', or nil. If it is nil, VC tries |
b0324f716b87
(vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents:
71228
diff
changeset
|
696 to use -L and sets this variable to remember whether it worked." |
b0324f716b87
(vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents:
71228
diff
changeset
|
697 :type '(choice (const :tag "Work out" nil) (const yes) (const no)) |
b0324f716b87
(vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents:
71228
diff
changeset
|
698 :group 'vc) |
b0324f716b87
(vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents:
71228
diff
changeset
|
699 |
59442
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
700 (defcustom vc-allow-async-revert nil |
81957
8f9991bf3b41
Generalize stay-local-p to operatre on lists of files.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81923
diff
changeset
|
701 "Specifies whether the diff during \\[vc-revert] may be asynchronous. |
59442
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
702 Enabling this option means that you can confirm a revert operation even |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
703 if the local changes in the file have not been found and displayed yet." |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
704 :type '(choice (const :tag "No" nil) |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
705 (const :tag "Yes" t)) |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
706 :group 'vc |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59442
diff
changeset
|
707 :version "22.1") |
59442
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
708 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
709 ;;;###autoload |
38606
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
710 (defcustom vc-checkout-hook nil |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
711 "Normal hook (list of functions) run after checking out a file. |
38606
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
712 See `run-hooks'." |
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
713 :type 'hook |
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
714 :group 'vc |
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
715 :version "21.1") |
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
716 |
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
717 ;;;###autoload |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
718 (defcustom vc-checkin-hook nil |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
719 "Normal hook (list of functions) run after commit or file checkin. |
51369
91b1fb194872
(vc-directory-exclusion-list): Add MCVS and .svn.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51245
diff
changeset
|
720 See also `log-edit-done-hook'." |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
721 :type 'hook |
51369
91b1fb194872
(vc-directory-exclusion-list): Add MCVS and .svn.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51245
diff
changeset
|
722 :options '(log-edit-comment-to-change-log) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
723 :group 'vc) |
2705
b4587e7ff4e5
(diff-switches): Define var here as well as in diff.el.
Richard M. Stallman <rms@gnu.org>
parents:
2692
diff
changeset
|
724 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
725 ;;;###autoload |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
726 (defcustom vc-before-checkin-hook nil |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
727 "Normal hook (list of functions) run before a commit or a file checkin. |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
728 See `run-hooks'." |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
729 :type 'hook |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
730 :group 'vc) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
731 |
904 | 732 ;; Header-insertion hair |
733 | |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
734 (defcustom vc-static-header-alist |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
735 '(("\\.c\\'" . |
904 | 736 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n#endif /* lint */\n")) |
100171 | 737 "Associate static header string templates with file types. |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
738 A \%s in the template is replaced with the first string associated with |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
739 the file's version control type in `vc-header-alist'." |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
740 :type '(repeat (cons :format "%v" |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
741 (regexp :tag "File Type") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
742 (string :tag "Header String"))) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
743 :group 'vc) |
2226
b2216b3b8f57
(vc-header-strings) Name changed to vc-header-alist, to match the
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2219
diff
changeset
|
744 |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
745 (defcustom vc-comment-alist |
904 | 746 '((nroff-mode ".\\\"" "")) |
100171 | 747 "Special comment delimiters for generating VC headers. |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
748 Add an entry in this list if you need to override the normal `comment-start' |
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
749 and `comment-end' variables. This will only be necessary if the mode language |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
750 is sensitive to blank lines." |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
751 :type '(repeat (list :format "%v" |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
752 (symbol :tag "Mode") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
753 (string :tag "Comment Start") |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
754 (string :tag "Comment End"))) |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
755 :group 'vc) |
904 | 756 |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
757 (defcustom vc-checkout-carefully (= (user-uid) 0) |
100171 | 758 "Non-nil means be extra-careful in checkout. |
5201
b27badfb4040
(vc-buffer-sync): Signal error if user says no.
Richard M. Stallman <rms@gnu.org>
parents:
5015
diff
changeset
|
759 Verify that the file really is not locked |
17672
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
760 and that its contents match what the master file says." |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
761 :type 'boolean |
3e14521699ff
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
17410
diff
changeset
|
762 :group 'vc) |
49619
b48f8839a782
(vc-annotate-display, vc-checkout-carefully): Add obsolescence declaration and
Juanma Barranquero <lekktu@gmail.com>
parents:
49597
diff
changeset
|
763 (make-obsolete-variable 'vc-checkout-carefully |
b48f8839a782
(vc-annotate-display, vc-checkout-carefully): Add obsolescence declaration and
Juanma Barranquero <lekktu@gmail.com>
parents:
49597
diff
changeset
|
764 "the corresponding checks are always done now." |
b48f8839a782
(vc-annotate-display, vc-checkout-carefully): Add obsolescence declaration and
Juanma Barranquero <lekktu@gmail.com>
parents:
49597
diff
changeset
|
765 "21.1") |
5201
b27badfb4040
(vc-buffer-sync): Signal error if user says no.
Richard M. Stallman <rms@gnu.org>
parents:
5015
diff
changeset
|
766 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
767 |
94576
7de38dedf0a6
Move the command-closure machinery to vc-dispatcher.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94573
diff
changeset
|
768 ;; Variables users don't need to see |
904 | 769 |
59442
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
770 (defvar vc-disable-async-diff nil |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
771 "VC sets this to t locally to disable some async diff operations. |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
772 Backends that offer asynchronous diffs should respect this variable |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
773 in their implementation of vc-BACKEND-diff.") |
37d47d9bf8b1
(vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents:
59011
diff
changeset
|
774 |
904 | 775 ;; File property caching |
776 | |
2580
a66f7ed76416
(vc-diff): Get proper error message when you run this with no prefix
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2558
diff
changeset
|
777 (defun vc-clear-context () |
51064
f2383fb5260e
(vc-log-mode-map, vc-maximum-comment-ring-size)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50926
diff
changeset
|
778 "Clear all cached file properties." |
2580
a66f7ed76416
(vc-diff): Get proper error message when you run this with no prefix
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2558
diff
changeset
|
779 (interactive) |
51064
f2383fb5260e
(vc-log-mode-map, vc-maximum-comment-ring-size)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50926
diff
changeset
|
780 (fillarray vc-file-prop-obarray 0)) |
2580
a66f7ed76416
(vc-diff): Get proper error message when you run this with no prefix
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2558
diff
changeset
|
781 |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
782 (defmacro with-vc-properties (files form settings) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
783 "Execute FORM, then maybe set per-file properties for FILES. |
41071 | 784 SETTINGS is an association list of property/value pairs. After |
785 executing FORM, set those properties from SETTINGS that have not yet | |
786 been updated to their corresponding values." | |
50894
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
787 (declare (debug t)) |
41395
0abfca935c80
(with-vc-properties): Don't bind `filename' locally.
André Spiegel <spiegel@gnu.org>
parents:
41071
diff
changeset
|
788 `(let ((vc-touched-properties (list t))) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
789 ,form |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
790 (dolist (file ,files) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
791 (dolist (setting ,settings) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
792 (let ((property (car setting))) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
793 (unless (memq property vc-touched-properties) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
794 (put (intern file vc-file-prop-obarray) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
795 property (cdr setting)))))))) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
796 |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
797 ;;; Code for deducing what fileset and backend to assume |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
798 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
799 (defun vc-responsible-backend (file &optional register) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
800 "Return the name of a backend system that is responsible for FILE. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
801 The optional argument REGISTER means that a backend suitable for |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
802 registration should be found. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
803 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
804 If REGISTER is nil, then if FILE is already registered, return the |
105591
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
805 backend of FILE. If FILE is not registered, then the |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
806 first backend in `vc-handled-backends' that declares itself |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
807 responsible for FILE is returned. If no backend declares itself |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
808 responsible, return the first backend. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
809 |
105591
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
810 If REGISTER is non-nil and FILE is a directory, create a VC |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
811 repository that can be used to register FILE. |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
812 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
813 If REGISTER is non-nil, return the first responsible backend under |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
814 which FILE is not yet registered. If there is no such backend, return |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
815 the first backend under which FILE is not yet registered, but could |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
816 be registered." |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
817 (when (not vc-handled-backends) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
818 (error "No handled backends")) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
819 (or (and (not (file-directory-p file)) (not register) (vc-backend file)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
820 (catch 'found |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
821 ;; First try: find a responsible backend. If this is for registration, |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
822 ;; it must be a backend under which FILE is not yet registered. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
823 (dolist (backend vc-handled-backends) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
824 (and (or (not register) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
825 (not (vc-call-backend backend 'registered file))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
826 (vc-call-backend backend 'responsible-p file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
827 (throw 'found backend))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
828 ;; no responsible backend |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
829 (if (not register) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
830 ;; if this is not for registration, the first backend must do |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
831 (car vc-handled-backends) |
105591
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
832 (if (file-directory-p file) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
833 (let* ((possible-backends |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
834 (let (pos) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
835 (dolist (crt vc-handled-backends) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
836 (when (vc-find-backend-function crt 'create-repo) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
837 (push crt pos))) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
838 pos)) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
839 (bk |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
840 (intern |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
841 ;; Read the VC backend from the user, only |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
842 ;; complete with the backends that have the |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
843 ;; 'create-repo method. |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
844 (completing-read |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
845 (format "%s is not in a version controlled directory.\nUse VC backend: " file) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
846 (mapcar 'symbol-name possible-backends) nil t))) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
847 (repo-dir |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
848 (file-name-as-directory |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
849 (let ((def-dir file)) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
850 ;; read the directory where to create the |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
851 ;; repository, make sure it's a parent of |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
852 ;; file. |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
853 (read-file-name |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
854 (format "create %s repository in: " bk) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
855 default-directory nil t nil |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
856 (lambda (arg) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
857 (and (file-directory-p arg) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
858 (vc-string-prefix-p (expand-file-name arg) def-dir)))))))) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
859 (let ((default-directory repo-dir)) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
860 (vc-call-backend bk 'create-repo)) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
861 (throw 'found bk)) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
862 |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
863 ;; FIXME: this case does not happen with the current code. |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
864 ;; Should we keep it? |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
865 ;; |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
866 ;; For registration, we need to find a new backend that |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
867 ;; could register FILE. |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
868 (dolist (backend vc-handled-backends) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
869 (and (not (vc-call-backend backend 'registered file)) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
870 (vc-call-backend backend 'could-register file) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
871 (throw 'found backend)))) |
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
872 (error "no backend that could register"))))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
873 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
874 (defun vc-expand-dirs (file-or-dir-list) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
875 "Expands directories in a file list specification. |
94886
9e19bca35d7f
Tell (vc-expand-dirs) not to throw out explicitly specified files.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94883
diff
changeset
|
876 Within directories, only files already under version control are noticed." |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
877 (let ((flattened '())) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
878 (dolist (node file-or-dir-list) |
95322
54121bb9b5ad
(Problems): Remove fixed issues.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95319
diff
changeset
|
879 (when (file-directory-p node) |
54121bb9b5ad
(Problems): Remove fixed issues.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95319
diff
changeset
|
880 (vc-file-tree-walk |
54121bb9b5ad
(Problems): Remove fixed issues.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95319
diff
changeset
|
881 node (lambda (f) (when (vc-backend f) (push f flattened))))) |
54121bb9b5ad
(Problems): Remove fixed issues.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95319
diff
changeset
|
882 (unless (file-directory-p node) (push node flattened))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
883 (nreverse flattened))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
884 |
96203 | 885 (defvar vc-dir-backend) |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
886 |
96203 | 887 (declare-function vc-dir-current-file "vc-dir" ()) |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
888 (declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files)) |
96203 | 889 |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
890 (defun vc-deduce-fileset (&optional observer allow-unregistered |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
891 state-model-only-files) |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
892 "Deduce a set of files and a backend to which to apply an operation. |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
893 |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
894 Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
895 If we're in VC-dir mode, the fileset is the list of marked files. |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
896 Otherwise, if we're looking at a buffer visiting a version-controlled file, |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
897 the fileset is a singleton containing this file. |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
898 If none of these conditions is met, but ALLOW_UNREGISTERED is on and the |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
899 visited file is not registered, return a singleton fileset containing it. |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
900 Otherwise, throw an error. |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
901 |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
902 STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
903 the FILESET-ONLY-FILES STATE and MODEL info. Otherwise, that |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
904 part may be skipped. |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
905 BEWARE: this function may change the |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
906 current buffer." |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
907 ;; FIXME: OBSERVER is unused. The name is not intuitive and is not |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
908 ;; documented. It's set to t when called from diff and print-log. |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
909 (let (backend) |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
910 (cond |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
911 ((derived-mode-p 'vc-dir-mode) |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
912 (vc-dir-deduce-fileset state-model-only-files)) |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
913 ((setq backend (vc-backend buffer-file-name)) |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
914 (if state-model-only-files |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
915 (list backend (list buffer-file-name) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
916 (list buffer-file-name) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
917 (vc-state buffer-file-name) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
918 (vc-checkout-model backend buffer-file-name)) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
919 (list backend (list buffer-file-name)))) |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
920 ((and (buffer-live-p vc-parent-buffer) |
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
921 ;; FIXME: Why this test? --Stef |
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
922 (or (buffer-file-name vc-parent-buffer) |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
923 (with-current-buffer vc-parent-buffer |
103553
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
924 (derived-mode-p 'vc-dir-mode)))) |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
925 (progn ;FIXME: Why not `with-current-buffer'? --Stef. |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
926 (set-buffer vc-parent-buffer) |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
927 (vc-deduce-fileset observer allow-unregistered state-model-only-files))) |
95946
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
928 ((not buffer-file-name) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
929 (error "Buffer %s is not associated with a file" (buffer-name))) |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
930 ((and allow-unregistered (not (vc-registered buffer-file-name))) |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
931 (if state-model-only-files |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
932 (list (vc-responsible-backend |
105591
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
933 (file-name-directory (buffer-file-name)) t) |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
934 (list buffer-file-name) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
935 (list buffer-file-name) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
936 (when state-model-only-files 'unregistered) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
937 nil) |
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
938 (list (vc-responsible-backend |
105591
6e1befdc92ef
(vc-responsible-backend): When a directory is passed for
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105590
diff
changeset
|
939 (file-name-directory (buffer-file-name)) t) |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
940 (list buffer-file-name)))) |
105170 | 941 (t (error "No fileset is available here"))))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
942 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
943 (defun vc-ensure-vc-buffer () |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
944 "Make sure that the current buffer visits a version-controlled file." |
87675
e4a11c2d5016
* vc.el (vc-status-headers): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87601
diff
changeset
|
945 (cond |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
946 ((derived-mode-p 'vc-dir-mode) |
94106
9294e3bd7d46
Rename vc-status to vc-dir and the vc-status var to vc-ewoc.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94095
diff
changeset
|
947 (set-buffer (find-file-noselect (vc-dir-current-file)))) |
87675
e4a11c2d5016
* vc.el (vc-status-headers): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87601
diff
changeset
|
948 (t |
87337
bad7c1eb5392
(vc-ensure-vc-buffer): Avoid infinite looping when
Martin Rudalics <rudalics@gmx.at>
parents:
87319
diff
changeset
|
949 (while (and vc-parent-buffer |
87601
2425b933f90a
(vc-ensure-vc-buffer): Check liveness of vc-parent-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87599
diff
changeset
|
950 (buffer-live-p vc-parent-buffer) |
87337
bad7c1eb5392
(vc-ensure-vc-buffer): Avoid infinite looping when
Martin Rudalics <rudalics@gmx.at>
parents:
87319
diff
changeset
|
951 ;; Avoid infinite looping when vc-parent-buffer and |
bad7c1eb5392
(vc-ensure-vc-buffer): Avoid infinite looping when
Martin Rudalics <rudalics@gmx.at>
parents:
87319
diff
changeset
|
952 ;; current buffer are the same buffer. |
bad7c1eb5392
(vc-ensure-vc-buffer): Avoid infinite looping when
Martin Rudalics <rudalics@gmx.at>
parents:
87319
diff
changeset
|
953 (not (eq vc-parent-buffer (current-buffer)))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
954 (set-buffer vc-parent-buffer)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
955 (if (not buffer-file-name) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
956 (error "Buffer %s is not associated with a file" (buffer-name)) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
957 (unless (vc-backend buffer-file-name) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
958 (error "File %s is not under version control" buffer-file-name)))))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
959 |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
960 ;;; Support for the C-x v v command. |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
961 ;; This is where all the single-file-oriented code from before the fileset |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
962 ;; rewrite lives. |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
963 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
964 (defsubst vc-editable-p (file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
965 "Return non-nil if FILE can be edited." |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
966 (let ((backend (vc-backend file))) |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
967 (and backend |
94563
a0bb8ca25a33
Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94556
diff
changeset
|
968 (or (eq (vc-checkout-model backend (list file)) 'implicit) |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
969 (memq (vc-state file) '(edited needs-merge conflict)))))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
970 |
87477
b5060e79eb98
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87450
diff
changeset
|
971 (defun vc-compatible-state (p q) |
b5060e79eb98
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87450
diff
changeset
|
972 "Controls which states can be in the same commit." |
b5060e79eb98
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87450
diff
changeset
|
973 (or |
b5060e79eb98
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87450
diff
changeset
|
974 (eq p q) |
b5060e79eb98
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87450
diff
changeset
|
975 (and (member p '(edited added removed)) (member q '(edited added removed))))) |
b5060e79eb98
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87450
diff
changeset
|
976 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
977 ;; Here's the major entry point. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
978 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
979 ;;;###autoload |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
980 (defun vc-next-action (verbose) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
981 "Do the next logical version control operation on the current fileset. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
982 This requires that all files in the fileset be in the same state. |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
983 |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
984 For locking systems: |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
985 If every file is not already registered, this registers each for version |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
986 control. |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
987 If every file is registered and not locked by anyone, this checks out |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
988 a writable and locked file of each ready for editing. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
989 If every file is checked out and locked by the calling user, this |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
990 first checks to see if each file has changed since checkout. If not, |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
991 it performs a revert on that file. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
992 If every file has been changed, this pops up a buffer for entry |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
993 of a log message; when the message has been entered, it checks in the |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
994 resulting changes along with the log message as change commentary. If |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
995 the variable `vc-keep-workfiles' is non-nil (which is its default), a |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
996 read-only copy of each changed file is left in place afterwards. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
997 If the affected file is registered and locked by someone else, you are |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
998 given the option to steal the lock(s). |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
999 |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1000 For merging systems: |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1001 If every file is not already registered, this registers each one for version |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1002 control. This does an add, but not a commit. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1003 If every file is added but not committed, each one is committed. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1004 If every working file is changed, but the corresponding repository file is |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1005 unchanged, this pops up a buffer for entry of a log message; when the |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1006 message has been entered, it checks in the resulting changes along |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1007 with the logmessage as change commentary. A writable file is retained. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1008 If the repository file is changed, you are asked if you want to |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1009 merge in the changes into your working copy." |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1010 (interactive "P") |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
1011 (let* ((vc-fileset (vc-deduce-fileset nil t 'state-model-only-files)) |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1012 (backend (car vc-fileset)) |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
1013 (files (nth 1 vc-fileset)) |
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
1014 (fileset-only-files (nth 2 vc-fileset)) |
94878 | 1015 ;; FIXME: We used to call `vc-recompute-state' here. |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
1016 (state (nth 3 vc-fileset)) |
94803
0c63a93bf877
(vc-deduce-fileset): Don't require the checkout-model and the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94796
diff
changeset
|
1017 ;; The backend should check that the checkout-model is consistent |
0c63a93bf877
(vc-deduce-fileset): Don't require the checkout-model and the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94796
diff
changeset
|
1018 ;; among all the `files'. |
96256
a56e02fe83fc
* vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96215
diff
changeset
|
1019 (model (nth 4 vc-fileset)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1020 revision) |
94803
0c63a93bf877
(vc-deduce-fileset): Don't require the checkout-model and the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94796
diff
changeset
|
1021 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1022 ;; Do the right thing |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1023 (cond |
94538
dc1cd59ce955
Better error message on missing files.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94536
diff
changeset
|
1024 ((eq state 'missing) |
105170 | 1025 (error "Fileset files are missing, so cannot be operated on")) |
94778
b9687393def1
Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94729
diff
changeset
|
1026 ((eq state 'ignored) |
105170 | 1027 (error "Fileset files are ignored by the version-control system")) |
95326
23822423eb64
(vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95325
diff
changeset
|
1028 ((or (null state) (eq state 'unregistered)) |
95946
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1029 (vc-register nil vc-fileset)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1030 ;; Files are up-to-date, or need a merge and user specified a revision |
94521
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1031 ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1032 (cond |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1033 (verbose |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1034 ;; go to a different revision |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1035 (setq revision (read-string "Branch, revision, or backend to move to: ")) |
102577
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1036 (let ((revision-downcase (downcase revision))) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1037 (if (member |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1038 revision-downcase |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1039 (mapcar (lambda (arg) (downcase (symbol-name arg))) vc-handled-backends)) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1040 (let ((vsym (intern-soft revision-downcase))) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1041 (dolist (file files) (vc-transfer-file file vsym))) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1042 (dolist (file files) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1043 (vc-checkout file (eq model 'implicit) revision))))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1044 ((not (eq model 'implicit)) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1045 ;; check the files out |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1046 (dolist (file files) (vc-checkout file t))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1047 (t |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1048 ;; do nothing |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1049 (message "Fileset is up-to-date")))) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1050 ;; Files have local changes |
87477
b5060e79eb98
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87450
diff
changeset
|
1051 ((vc-compatible-state state 'edited) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1052 (let ((ready-for-commit files)) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1053 ;; If files are edited but read-only, give user a chance to correct |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1054 (dolist (file files) |
87826
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1055 (unless (file-writable-p file) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1056 ;; Make the file+buffer read-write. |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1057 (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue?" file)) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1058 (error "Aborted")) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1059 (set-file-modes file (logior (file-modes file) 128)) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1060 (let ((visited (get-file-buffer file))) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1061 (when visited |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1062 (with-current-buffer visited |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1063 (toggle-read-only -1)))))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1064 ;; Allow user to revert files with no changes |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1065 (save-excursion |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1066 (dolist (file files) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1067 (let ((visited (get-file-buffer file))) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1068 ;; For files with locking, if the file does not contain |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1069 ;; any changes, just let go of the lock, i.e. revert. |
87826
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1070 (when (and (not (eq model 'implicit)) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1071 (vc-workfile-unchanged-p file) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1072 ;; If buffer is modified, that means the user just |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1073 ;; said no to saving it; in that case, don't revert, |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1074 ;; because the user might intend to save after |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1075 ;; finishing the log entry and committing. |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1076 (not (and visited (buffer-modified-p)))) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1077 (vc-revert-file file) |
97245
855f5155ed05
(vc-next-action): Update list var correctly after delete.
Chong Yidong <cyd@stupidchicken.com>
parents:
96886
diff
changeset
|
1078 (setq ready-for-commit (delete file ready-for-commit)))))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1079 ;; Remaining files need to be committed |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1080 (if (not ready-for-commit) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1081 (message "No files remain to be committed") |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
1082 (if (not verbose) |
102576
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1083 (vc-checkin ready-for-commit backend) |
102577
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1084 (setq revision (read-string "New revision or backend: ")) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1085 (let ((revision-downcase (downcase revision))) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1086 (if (member |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1087 revision-downcase |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1088 (mapcar (lambda (arg) (downcase (symbol-name arg))) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1089 vc-handled-backends)) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1090 (let ((vsym (intern revision-downcase))) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1091 (dolist (file files) (vc-transfer-file file vsym))) |
a4d2ede95fbd
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102576
diff
changeset
|
1092 (vc-checkin ready-for-commit backend revision))))))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1093 ;; locked by somebody else (locking VCSes only) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1094 ((stringp state) |
87938
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1095 ;; In the old days, we computed the revision once and used it on |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1096 ;; the single file. Then, for the 2007-2008 fileset rewrite, we |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1097 ;; computed the revision once (incorrectly, using a free var) and |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1098 ;; used it on all files. To fix the free var bug, we can either |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1099 ;; use `(car files)' or do what we do here: distribute the |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1100 ;; revision computation among `files'. Although this may be |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1101 ;; tedious for those backends where a "revision" is a trans-file |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1102 ;; concept, it is nonetheless correct for both those and (more |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1103 ;; importantly) for those where "revision" is a per-file concept. |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1104 ;; If the intersection of the former group and "locking VCSes" is |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1105 ;; non-empty [I vaguely doubt it --ttn], we can reinstate the |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1106 ;; pre-computation approach of yore. |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1107 (dolist (file files) |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1108 (vc-steal-lock |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1109 file (if verbose |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1110 (read-string (format "%s revision to steal: " file)) |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1111 (vc-working-revision file)) |
bcbe422dacdd
(vc-next-action): Fix two instances of "free-var file" bug:
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87931
diff
changeset
|
1112 state))) |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
1113 ;; conflict |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
1114 ((eq state 'conflict) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1115 ;; FIXME: Is it really the UI we want to provide? |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1116 ;; In my experience, the conflicted files should be marked as resolved |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1117 ;; one-by-one when saving the file after resolving the conflicts. |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1118 ;; I.e. stating explicitly that the conflicts are resolved is done |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1119 ;; very rarely. |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1120 (vc-mark-resolved backend files)) |
94521
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1121 ;; needs-update |
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1122 ((eq state 'needs-update) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1123 (dolist (file files) |
31565
de4e73d77734
(vc-dired-listing-switches): Fix :version.
Dave Love <fx@gnu.org>
parents:
31520
diff
changeset
|
1124 (if (yes-or-no-p (format |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1125 "%s is not up-to-date. Get latest revision? " |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1126 (file-name-nondirectory file))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1127 (vc-checkout file (eq model 'implicit) t) |
87826
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1128 (when (and (not (eq model 'implicit)) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1129 (yes-or-no-p "Lock this revision? ")) |
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1130 (vc-checkout file t))))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1131 ;; needs-merge |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1132 ((eq state 'needs-merge) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1133 (dolist (file files) |
87826
06bebff4deab
Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87785
diff
changeset
|
1134 (when (yes-or-no-p (format |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1135 "%s is not up-to-date. Merge in changes now? " |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1136 (file-name-nondirectory file))) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1137 (vc-maybe-resolve-conflicts |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1138 file (vc-call-backend backend 'merge-news file))))) |
32344
f91ef1141a75
(with-vc-file, edit-vc-file): Specify `indent-function' property.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
32310
diff
changeset
|
1139 |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1140 ;; unlocked-changes |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1141 ((eq state 'unlocked-changes) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1142 (dolist (file files) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1143 (when (not (equal buffer-file-name file)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1144 (find-file-other-window file)) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1145 (if (save-window-excursion |
95587
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
1146 (vc-diff-internal nil |
94778
b9687393def1
Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94729
diff
changeset
|
1147 (cons (car vc-fileset) (cons (cadr vc-fileset) (list file))) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1148 (vc-working-revision file) nil) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1149 (goto-char (point-min)) |
32059
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
1150 (let ((inhibit-read-only t)) |
41561
cfae9c0a0035
(vc-next-action-on-file): Use insert instead of insert-string.
Pavel Janík <Pavel@Janik.cz>
parents:
41556
diff
changeset
|
1151 (insert |
32059
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
1152 (format "Changes to %s since last lock:\n\n" file))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1153 (not (beep)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1154 (yes-or-no-p (concat "File has unlocked changes. " |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1155 "Claim lock retaining changes? "))) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1156 (progn (vc-call-backend backend 'steal-lock file) |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1157 (clear-visited-file-modtime) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1158 ;; Must clear any headers here because they wouldn't |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1159 ;; show that the file is locked now. |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1160 (vc-clear-headers file) |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
1161 (write-file buffer-file-name) |
103553
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1162 (vc-mode-line file backend)) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1163 (if (not (yes-or-no-p |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1164 "Revert to checked-in revision, instead? ")) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1165 (error "Checkout aborted") |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1166 (vc-revert-buffer-internal t t) |
94521
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1167 (vc-checkout file t))))) |
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1168 ;; Unknown fileset state |
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1169 (t |
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1170 (error "Fileset is in an unknown state %s" state))))) |
2490
70d00ecacc0d
(vc-directory. vc-start-entry, vc-next-action, vc-next-action-on-file):
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2464
diff
changeset
|
1171 |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1172 (defun vc-create-repo (backend) |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1173 "Create an empty repository in the current directory." |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1174 (interactive |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1175 (list |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1176 (intern |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1177 (upcase |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1178 (completing-read |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1179 "Create repository for: " |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1180 (mapcar (lambda (b) (list (downcase (symbol-name b)))) vc-handled-backends) |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1181 nil t))))) |
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1182 (vc-call-backend backend 'create-repo)) |
67755
0cdb122ad4db
Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67578
diff
changeset
|
1183 |
104042
47d49939ab41
(vc-dir-move-to-goal-column): Declare.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104041
diff
changeset
|
1184 (declare-function vc-dir-move-to-goal-column "vc-dir" ()) |
47d49939ab41
(vc-dir-move-to-goal-column): Declare.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104041
diff
changeset
|
1185 |
927 | 1186 ;;;###autoload |
95946
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1187 (defun vc-register (&optional set-revision vc-fileset comment) |
86055
f064a093bf93
(vc-register): Allow registering a file passed as a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86034
diff
changeset
|
1188 "Register into a version control system. |
95946
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1189 If VC-FILESET is given, register the files in that fileset. |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1190 Otherwise register the current file. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1191 With prefix argument SET-REVISION, allow user to specify initial revision |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1192 level. If COMMENT is present, use that as an initial comment. |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1193 |
31520
f9d2d484e1e2
* vc-sccs.el (vc-sccs-register):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31435
diff
changeset
|
1194 The version control system to use is found by cycling through the list |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1195 `vc-handled-backends'. The first backend in that list which declares |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1196 itself responsible for the file (usually because other files in that |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1197 directory are already registered under that backend) will be used to |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1198 register the file. If no backend declares itself responsible, the |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1199 first backend that could register the file is used." |
904 | 1200 (interactive "P") |
95946
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1201 (let* ((fileset-arg (or vc-fileset (vc-deduce-fileset nil t))) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1202 (backend (car fileset-arg)) |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
1203 (files (nth 1 fileset-arg))) |
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
1204 ;; We used to operate on `only-files', but VC wants to provide the |
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
1205 ;; possibility to register directories rather than files only, since |
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
1206 ;; many VCS allow that as well. |
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
1207 (dolist (fname files) |
95946
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1208 (let ((bname (get-file-buffer fname))) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1209 (unless fname (setq fname buffer-file-name)) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1210 (when (vc-backend fname) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1211 (if (vc-registered fname) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1212 (error "This file is already registered") |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1213 (unless (y-or-n-p "Previous master file has vanished. Make a new one? ") |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1214 (error "Aborted")))) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1215 ;; Watch out for new buffers of size 0: the corresponding file |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1216 ;; does not exist yet, even though buffer-modified-p is nil. |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1217 (when bname |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1218 (with-current-buffer bname |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1219 (when (and (not (buffer-modified-p)) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1220 (zerop (buffer-size)) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1221 (not (file-exists-p buffer-file-name))) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1222 (set-buffer-modified-p t)) |
3a39d3ac157c
(vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95896
diff
changeset
|
1223 (vc-buffer-sync))))) |
103553
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1224 (message "Registering %s... " files) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1225 (mapc 'vc-file-clearprops files) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1226 (vc-call-backend backend 'register files |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1227 (if set-revision |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1228 (read-string (format "Initial revision level for %s: " files)) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1229 (vc-call-backend backend 'init-revision)) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1230 comment) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1231 (mapc |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1232 (lambda (file) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1233 (vc-file-setprop file 'vc-backend backend) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1234 ;; FIXME: This is wrong: it should set `backup-inhibited' in all |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1235 ;; the buffers visiting files affected by this `vc-register', not |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1236 ;; in the current-buffer. |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1237 ;; (unless vc-make-backup-files |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1238 ;; (make-local-variable 'backup-inhibited) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1239 ;; (setq backup-inhibited t)) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1240 |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1241 (vc-resynch-buffer file vc-keep-workfiles t)) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1242 files) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1243 (when (derived-mode-p 'vc-dir-mode) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1244 (vc-dir-move-to-goal-column)) |
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
1245 (message "Registering %s... done" files))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1246 |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1247 (defun vc-register-with (backend) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1248 "Register the current file with a specified back end." |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1249 (interactive "SBackend: ") |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1250 (when (not (member backend vc-handled-backends)) |
105170 | 1251 (error "Unknown back end")) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1252 (let ((vc-handled-backends (list backend))) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1253 (call-interactively 'vc-register))) |
32069
4b577e4fc758
(vc-responsible-backend): Undo the previous change in the argument
André Spiegel <spiegel@gnu.org>
parents:
32059
diff
changeset
|
1254 |
11597
d6d53a54da18
(vc-backend-checkout): Pass vc-checkout-switches arg
Richard M. Stallman <rms@gnu.org>
parents:
11080
diff
changeset
|
1255 (defun vc-checkout (file &optional writable rev) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1256 "Retrieve a copy of the revision REV of FILE. |
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1257 If WRITABLE is non-nil, make sure the retrieved file is writable. |
38608 | 1258 REV defaults to the latest revision. |
1259 | |
1260 After check-out, runs the normal hook `vc-checkout-hook'." | |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
1261 (and writable |
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
1262 (not rev) |
32748
e2cb0aef151a
(vc-checkout): Added `-p' suffix in call to vc-make-version-backups-p;
André Spiegel <spiegel@gnu.org>
parents:
32344
diff
changeset
|
1263 (vc-call make-version-backups-p file) |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
1264 (vc-up-to-date-p file) |
32748
e2cb0aef151a
(vc-checkout): Added `-p' suffix in call to vc-make-version-backups-p;
André Spiegel <spiegel@gnu.org>
parents:
32344
diff
changeset
|
1265 (vc-make-version-backup file)) |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1266 (let ((backend (vc-backend file))) |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1267 (with-vc-properties (list file) |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1268 (condition-case err |
94495
027a58c5f305
(vc-checkout): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94488
diff
changeset
|
1269 (vc-call-backend backend 'checkout file writable rev) |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1270 (file-error |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1271 ;; Maybe the backend is not installed ;-( |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1272 (when writable |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1273 (let ((buf (get-file-buffer file))) |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1274 (when buf (with-current-buffer buf (toggle-read-only -1))))) |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1275 (signal (car err) (cdr err)))) |
94563
a0bb8ca25a33
Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94556
diff
changeset
|
1276 `((vc-state . ,(if (or (eq (vc-checkout-model backend (list file)) 'implicit) |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1277 (not writable)) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1278 (if (vc-call-backend backend 'latest-on-branch-p file) |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1279 'up-to-date |
94521
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94520
diff
changeset
|
1280 'needs-update) |
94481
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1281 'edited)) |
ad6c174910db
Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94478
diff
changeset
|
1282 (vc-checkout-time . ,(nth 5 (file-attributes file)))))) |
38606
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
1283 (vc-resynch-buffer file t t) |
32e167f31eb6
(vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents:
38595
diff
changeset
|
1284 (run-hooks 'vc-checkout-hook)) |
904 | 1285 |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1286 (defun vc-mark-resolved (backend files) |
98337 | 1287 (prog1 (with-vc-properties |
1288 files | |
1289 (vc-call-backend backend 'mark-resolved files) | |
1290 ;; FIXME: Is this TRTD? Might not be. | |
1291 `((vc-state . edited))) | |
1292 (message | |
1293 (substitute-command-keys | |
1294 "Conflicts have been resolved in %s. \ | |
98336
26ff192a882a
(vc-mark-resolved): Move message here from vc-default-mark-resolved.
Chong Yidong <cyd@stupidchicken.com>
parents:
98326
diff
changeset
|
1295 Type \\[vc-next-action] to check in changes.") |
98337 | 1296 (if (> (length files) 1) |
1297 (format "%d files" (length files)) | |
1298 "this file")))) | |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
1299 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1300 (defun vc-steal-lock (file rev owner) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1301 "Steal the lock on FILE." |
9044
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1302 (let (file-description) |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1303 (if rev |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1304 (setq file-description (format "%s:%s" file rev)) |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1305 (setq file-description file)) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1306 (when (not (yes-or-no-p (format "Steal the lock on %s from %s? " |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1307 file-description owner))) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1308 (error "Steal canceled")) |
42548
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1309 (message "Stealing lock on %s..." file) |
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1310 (with-vc-properties |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1311 (list file) |
42548
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1312 (vc-call steal-lock file rev) |
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1313 `((vc-state . edited))) |
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1314 (vc-resynch-buffer file t t) |
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1315 (message "Stealing lock on %s...done" file) |
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1316 ;; Write mail after actually stealing, because if the stealing |
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1317 ;; goes wrong, we don't want to send any mail. |
1cf3624d80ac
(vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents:
42205
diff
changeset
|
1318 (compose-mail owner (format "Stolen lock on %s" file-description)) |
9044
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1319 (setq default-directory (expand-file-name "~/")) |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1320 (goto-char (point-max)) |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1321 (insert |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1322 (format "I stole the lock on %s, " file-description) |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1323 (current-time-string) |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1324 ".\n") |
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
1325 (message "Please explain why you stole the lock. Type C-c C-c when done."))) |
904 | 1326 |
102576
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1327 (defun vc-checkin (files backend &optional rev comment initial-contents) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1328 "Check in FILES. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1329 The optional argument REV may be a string specifying the new revision |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1330 level (if nil increment the current level). COMMENT is a comment |
32054
fef29341db1c
(vc-next-action-on-file): Update mode line only if file is visited.
André Spiegel <spiegel@gnu.org>
parents:
31836
diff
changeset
|
1331 string; if omitted, a buffer is popped up to accept a comment. If |
fef29341db1c
(vc-next-action-on-file): Update mode line only if file is visited.
André Spiegel <spiegel@gnu.org>
parents:
31836
diff
changeset
|
1332 INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial contents |
fef29341db1c
(vc-next-action-on-file): Update mode line only if file is visited.
André Spiegel <spiegel@gnu.org>
parents:
31836
diff
changeset
|
1333 of the log entry buffer. |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1334 |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1335 If `vc-keep-workfiles' is nil, FILE is deleted afterwards, provided |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1336 that the version control system supports this mode of operation. |
20967 | 1337 |
94579
dca2377770e7
Move context-preservation machinery.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94576
diff
changeset
|
1338 Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." |
dca2377770e7
Move context-preservation machinery.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94576
diff
changeset
|
1339 (when vc-before-checkin-hook |
dca2377770e7
Move context-preservation machinery.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94576
diff
changeset
|
1340 (run-hooks 'vc-before-checkin-hook)) |
102576
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1341 (lexical-let |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1342 ((backend backend)) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1343 (vc-start-logentry |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1344 files rev comment initial-contents |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1345 "Enter a change comment." |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1346 "*VC-log*" |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1347 (lambda (files rev comment) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1348 (message "Checking in %s..." (vc-delistify files)) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1349 ;; "This log message intentionally left almost blank". |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1350 ;; RCS 5.7 gripes about white-space-only comments too. |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1351 (or (and comment (string-match "[^\t\n ]" comment)) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1352 (setq comment "*** empty log message ***")) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1353 (with-vc-properties |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1354 files |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1355 ;; We used to change buffers to get local value of vc-checkin-switches, |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1356 ;; but 'the' local buffer is not a well-defined concept for filesets. |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1357 (progn |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1358 (vc-call-backend backend 'checkin files rev comment) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1359 (mapc 'vc-delete-automatic-version-backups files)) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1360 `((vc-state . up-to-date) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1361 (vc-checkout-time . ,(nth 5 (file-attributes file))) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1362 (vc-working-revision . nil))) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1363 (message "Checking in %s...done" (vc-delistify files))) |
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
1364 'vc-checkin-hook))) |
904 | 1365 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1366 ;;; Additional entry points for examining version histories |
904 | 1367 |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1368 ;; (defun vc-default-diff-tree (backend dir rev1 rev2) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1369 ;; "List differences for all registered files at and below DIR. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1370 ;; The meaning of REV1 and REV2 is the same as for `vc-revision-diff'." |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1371 ;; ;; This implementation does an explicit tree walk, and calls |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1372 ;; ;; vc-BACKEND-diff directly for each file. An optimization |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1373 ;; ;; would be to use `vc-diff-internal', so that diffs can be local, |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1374 ;; ;; and to call it only for files that are actually changed. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1375 ;; ;; However, this is expensive for some backends, and so it is left |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1376 ;; ;; to backend-specific implementations. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1377 ;; (setq default-directory dir) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1378 ;; (vc-file-tree-walk |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1379 ;; default-directory |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1380 ;; (lambda (f) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1381 ;; (vc-exec-after |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1382 ;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1383 ;; (message "Looking at %s" ',f) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1384 ;; (vc-call-backend ',(vc-backend f) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1385 ;; 'diff (list ',f) ',rev1 ',rev2)))))) |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1386 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1387 (defun vc-coding-system-for-diff (file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1388 "Return the coding system for reading diff output for FILE." |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1389 (or coding-system-for-read |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1390 ;; if we already have this file open, |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1391 ;; use the buffer's coding system |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1392 (let ((buf (find-buffer-visiting file))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1393 (when buf (with-current-buffer buf |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1394 buffer-file-coding-system))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1395 ;; otherwise, try to find one based on the file name |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1396 (car (find-operation-coding-system 'insert-file-contents file)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1397 ;; and a final fallback |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1398 'undecided)) |
904 | 1399 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1400 (defun vc-switches (backend op) |
98386
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1401 "Return a list of vc-BACKEND switches for operation OP. |
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1402 BACKEND is a symbol such as `CVS', which will be downcased. |
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1403 OP is a symbol such as `diff'. |
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1404 |
100171 | 1405 In decreasing order of preference, return the value of: |
98386
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1406 vc-BACKEND-OP-switches (e.g. `vc-cvs-diff-switches'); |
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1407 vc-OP-switches (e.g. `vc-diff-switches'); or, in the case of |
98388 | 1408 diff only, `diff-switches'. |
98386
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1409 |
100171 | 1410 If the chosen value is not a string or a list, return nil. |
98386
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1411 This is so that you may set, e.g. `vc-svn-diff-switches' to t in order |
48cf5d8c02af
(vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents:
98337
diff
changeset
|
1412 to override the value of `vc-diff-switches' and `diff-switches'." |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1413 (let ((switches |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1414 (or (when backend |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1415 (let ((sym (vc-make-backend-sym |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1416 backend (intern (concat (symbol-name op) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1417 "-switches"))))) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1418 (when (boundp sym) (symbol-value sym)))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1419 (let ((sym (intern (format "vc-%s-switches" (symbol-name op))))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1420 (when (boundp sym) (symbol-value sym))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1421 (cond |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1422 ((eq op 'diff) diff-switches))))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1423 (if (stringp switches) (list switches) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1424 ;; If not a list, return nil. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1425 ;; This is so we can set vc-diff-switches to t to override |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1426 ;; any switches in diff-switches. |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1427 (when (listp switches) switches)))) |
904 | 1428 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1429 ;; Old def for compatibility with Emacs-21.[123]. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1430 (defmacro vc-diff-switches-list (backend) `(vc-switches ',backend 'diff)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
1431 (make-obsolete 'vc-diff-switches-list 'vc-switches "22.1") |
54618
7cd50dab9d3d
(vc-version-diff, vc-default-diff-tree): Change `rel' -> `rev'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54586
diff
changeset
|
1432 |
91698
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1433 (defun vc-diff-finish (buffer messages) |
85364
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1434 ;; The empty sync output case has already been handled, so the only |
87931
9f4909ced989
Handle dead buffers in async filters/sentinels.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87930
diff
changeset
|
1435 ;; possibility of an empty output is for an async process. |
91698
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1436 (when (buffer-live-p buffer) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1437 (let ((window (get-buffer-window buffer t)) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1438 (emptyp (zerop (buffer-size buffer)))) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1439 (with-current-buffer buffer |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1440 (and messages emptyp |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1441 (let ((inhibit-read-only t)) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1442 (insert (cdr messages) ".\n") |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1443 (message "%s" (cdr messages)))) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1444 (goto-char (point-min)) |
87931
9f4909ced989
Handle dead buffers in async filters/sentinels.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87930
diff
changeset
|
1445 (when window |
91698
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1446 (shrink-window-if-larger-than-buffer window))) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1447 (when (and messages (not emptyp)) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1448 (message "%sdone" (car messages)))))) |
40124
9031427edfa3
(vc-diff-internal, vc-coding-system-for-diff, vc-default-diff-tree):
André Spiegel <spiegel@gnu.org>
parents:
39427
diff
changeset
|
1449 |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1450 (defvar vc-diff-added-files nil |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1451 "If non-nil, diff added files by comparing them to /dev/null.") |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1452 |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1453 (defun vc-diff-internal (async vc-fileset rev1 rev2 &optional verbose) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1454 "Report diffs between two revisions of a fileset. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1455 Diff output goes to the *vc-diff* buffer. The function |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1456 returns t if the buffer had changes, nil otherwise." |
94984
b8d24d4a4bdc
Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94974
diff
changeset
|
1457 (let* ((files (cadr vc-fileset)) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1458 (messages (cons (format "Finding changes in %s..." |
91698
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1459 (vc-delistify files)) |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1460 (format "No changes between %s and %s" |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1461 (or rev1 "working revision") |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1462 (or rev2 "workfile")))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1463 ;; Set coding system based on the first file. It's a kluge, |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1464 ;; but the only way to set it for each file included would |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1465 ;; be to call the back end separately for each file. |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1466 (coding-system-for-read |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1467 (if files (vc-coding-system-for-diff (car files)) 'undecided))) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1468 (vc-setup-buffer "*vc-diff*") |
91698
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1469 (message "%s" (car messages)) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1470 ;; Many backends don't handle well the case of a file that has been |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1471 ;; added but not yet committed to the repo (notably CVS and Subversion). |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1472 ;; Do that work here so the backends don't have to futz with it. --ESR |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1473 ;; |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1474 ;; Actually most backends (including CVS) have options to control the |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1475 ;; behavior since which one is better depends on the user and on the |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1476 ;; situation). Worse yet: this code does not handle the case where |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1477 ;; `file' is a directory which contains added files. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1478 ;; I made it conditional on vc-diff-added-files but it should probably |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1479 ;; just be removed (or copied/moved to specific backends). --Stef. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1480 (when vc-diff-added-files |
104597
d3ef713449d3
* vc.el (vc-diff-internal): Let-bind `process-file-side-effects' with nil.
Michael Albinus <michael.albinus@gmx.de>
parents:
104042
diff
changeset
|
1481 (let ((filtered '()) |
d3ef713449d3
* vc.el (vc-diff-internal): Let-bind `process-file-side-effects' with nil.
Michael Albinus <michael.albinus@gmx.de>
parents:
104042
diff
changeset
|
1482 process-file-side-effects) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1483 (dolist (file files) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1484 (if (or (file-directory-p file) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1485 (not (string= (vc-working-revision file) "0"))) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1486 (push file filtered) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1487 ;; This file is added but not yet committed; |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1488 ;; there is no master file to diff against. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1489 (if (or rev1 rev2) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1490 (error "No revisions of %s exist" file) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1491 ;; We regard this as "changed". |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1492 ;; Diff it against /dev/null. |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1493 (apply 'vc-do-command "*vc-diff*" |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1494 1 "diff" file |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1495 (append (vc-switches nil 'diff) '("/dev/null")))))) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1496 (setq files (nreverse filtered)))) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1497 (let ((vc-disable-async-diff (not async))) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1498 (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 "*vc-diff*")) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1499 (set-buffer "*vc-diff*") |
85364
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1500 (if (and (zerop (buffer-size)) |
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1501 (not (get-buffer-process (current-buffer)))) |
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1502 ;; Treat this case specially so as not to pop the buffer. |
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1503 (progn |
91698
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1504 (message "%s" (cdr messages)) |
85364
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1505 nil) |
85972
51aa47312c4b
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85794
diff
changeset
|
1506 (diff-mode) |
86002
613df1ba1584
* vc.el (vc-diff-internal): Make the *vc-diff* buffer read only.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85972
diff
changeset
|
1507 ;; Make the *vc-diff* buffer read only, the diff-mode key |
613df1ba1584
* vc.el (vc-diff-internal): Make the *vc-diff* buffer read only.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85972
diff
changeset
|
1508 ;; bindings are nicer for read only buffers. pcl-cvs does the |
613df1ba1584
* vc.el (vc-diff-internal): Make the *vc-diff* buffer read only.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85972
diff
changeset
|
1509 ;; same thing. |
613df1ba1584
* vc.el (vc-diff-internal): Make the *vc-diff* buffer read only.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85972
diff
changeset
|
1510 (setq buffer-read-only t) |
91698
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1511 (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose |
c22d8444f043
Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
88111
diff
changeset
|
1512 messages))) |
86100
ac69f23a84ce
(vc-diff-internal): Pop-to-buffer later.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86055
diff
changeset
|
1513 ;; Display the buffer, but at the end because it can change point. |
ac69f23a84ce
(vc-diff-internal): Pop-to-buffer later.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86055
diff
changeset
|
1514 (pop-to-buffer (current-buffer)) |
85364
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1515 ;; In the async case, we return t even if there are no differences |
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1516 ;; because we don't know that yet. |
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
1517 t))) |
40124
9031427edfa3
(vc-diff-internal, vc-coding-system-for-diff, vc-default-diff-tree):
André Spiegel <spiegel@gnu.org>
parents:
39427
diff
changeset
|
1518 |
104647
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1519 (defun vc-read-revision (prompt &optional files backend default initial-input) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1520 (cond |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1521 ((null files) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1522 (let ((vc-fileset (vc-deduce-fileset t))) ;FIXME: why t? --Stef |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1523 (setq files (cadr vc-fileset)) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1524 (setq backend (car vc-fileset)))) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1525 ((null backend) (setq backend (vc-backend (car files))))) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1526 (let ((completion-table |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1527 (vc-call-backend backend 'revision-completion-table files))) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1528 (if completion-table |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1529 (completing-read prompt completion-table |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1530 nil nil initial-input nil default) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1531 (read-string prompt initial-input nil default)))) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1532 |
927 | 1533 ;;;###autoload |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1534 (defun vc-version-diff (files rev1 rev2) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1535 "Report diffs between revisions of the fileset in the repository history." |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1536 (interactive |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
1537 (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: why t? --Stef |
94984
b8d24d4a4bdc
Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94974
diff
changeset
|
1538 (files (cadr vc-fileset)) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1539 (backend (car vc-fileset)) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1540 (first (car files)) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1541 (rev1-default nil) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1542 (rev2-default nil)) |
19055
5439070e5d46
(vc-backend-checkin): For CVS, forget the checkout model after commit.
Richard M. Stallman <rms@gnu.org>
parents:
18857
diff
changeset
|
1543 (cond |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1544 ;; someday we may be able to do revision completion on non-singleton |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1545 ;; filesets, but not yet. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1546 ((/= (length files) 1) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1547 nil) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1548 ;; if it's a directory, don't supply any revision default |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1549 ((file-directory-p first) |
19055
5439070e5d46
(vc-backend-checkin): For CVS, forget the checkout model after commit.
Richard M. Stallman <rms@gnu.org>
parents:
18857
diff
changeset
|
1550 nil) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1551 ;; if the file is not up-to-date, use working revision as older revision |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1552 ((not (vc-up-to-date-p first)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1553 (setq rev1-default (vc-working-revision first))) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1554 ;; if the file is not locked, use last and previous revisions as defaults |
19055
5439070e5d46
(vc-backend-checkin): For CVS, forget the checkout model after commit.
Richard M. Stallman <rms@gnu.org>
parents:
18857
diff
changeset
|
1555 (t |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1556 (setq rev1-default (vc-call-backend backend 'previous-revision first |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1557 (vc-working-revision first))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1558 (when (string= rev1-default "") (setq rev1-default nil)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1559 (setq rev2-default (vc-working-revision first)))) |
19055
5439070e5d46
(vc-backend-checkin): For CVS, forget the checkout model after commit.
Richard M. Stallman <rms@gnu.org>
parents:
18857
diff
changeset
|
1560 ;; construct argument list |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1561 (let* ((rev1-prompt (if rev1-default |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1562 (concat "Older revision (default " |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1563 rev1-default "): ") |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1564 "Older revision: ")) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1565 (rev2-prompt (concat "Newer revision (default " |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1566 (or rev2-default "current source") "): ")) |
104647
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1567 (rev1 (vc-read-revision rev1-prompt files backend rev1-default)) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1568 (rev2 (vc-read-revision rev2-prompt files backend rev2-default))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1569 (when (string= rev1 "") (setq rev1 nil)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1570 (when (string= rev2 "") (setq rev2 nil)) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1571 (list files rev1 rev2)))) |
94778
b9687393def1
Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94729
diff
changeset
|
1572 ;; All that was just so we could do argument completion! |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1573 (when (and (not rev1) rev2) |
105170 | 1574 (error "Not a valid revision range")) |
94778
b9687393def1
Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94729
diff
changeset
|
1575 ;; Yes, it's painful to call (vc-deduce-fileset) again. Alas, the |
b9687393def1
Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94729
diff
changeset
|
1576 ;; placement rules for (interactive) don't actually leave us a choice. |
105405
6d5195c8d57a
Remove commented out code.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105372
diff
changeset
|
1577 (vc-diff-internal t (vc-deduce-fileset t) rev1 rev2 |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
105170
diff
changeset
|
1578 (called-interactively-p 'interactive))) |
40124
9031427edfa3
(vc-diff-internal, vc-coding-system-for-diff, vc-default-diff-tree):
André Spiegel <spiegel@gnu.org>
parents:
39427
diff
changeset
|
1579 |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1580 ;;;###autoload |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1581 (defun vc-diff (historic &optional not-urgent) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1582 "Display diffs between file revisions. |
85165
9b4cc51391e5
Address an edge case in vc-diff. This is an experimental fix and may change.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
1583 Normally this compares the currently selected fileset with their |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1584 working revisions. With a prefix argument HISTORIC, it reads two revision |
85165
9b4cc51391e5
Address an edge case in vc-diff. This is an experimental fix and may change.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
1585 designators specifying which revisions to compare. |
9b4cc51391e5
Address an edge case in vc-diff. This is an experimental fix and may change.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
1586 |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1587 The optional argument NOT-URGENT non-nil means it is ok to say no to |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1588 saving the buffer." |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1589 (interactive (list current-prefix-arg t)) |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1590 (if historic |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1591 (call-interactively 'vc-version-diff) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1592 (when buffer-file-name (vc-buffer-sync not-urgent)) |
105405
6d5195c8d57a
Remove commented out code.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105372
diff
changeset
|
1593 (vc-diff-internal t (vc-deduce-fileset t) nil nil |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
105170
diff
changeset
|
1594 (called-interactively-p 'interactive)))) |
40124
9031427edfa3
(vc-diff-internal, vc-coding-system-for-diff, vc-default-diff-tree):
André Spiegel <spiegel@gnu.org>
parents:
39427
diff
changeset
|
1595 |
4725
126cf4bdfd35
(vc-version-other-window): New function.
Paul Eggert <eggert@twinsun.com>
parents:
4684
diff
changeset
|
1596 ;;;###autoload |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1597 (defun vc-root-diff (historic &optional not-urgent) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1598 "Display diffs between file revisions. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1599 Normally this compares the currently selected fileset with their |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1600 working revisions. With a prefix argument HISTORIC, it reads two revision |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1601 designators specifying which revisions to compare. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1602 |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1603 The optional argument NOT-URGENT non-nil means it is ok to say no to |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1604 saving the buffer." |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1605 (interactive (list current-prefix-arg t)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1606 (if historic |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1607 ;; FIXME: this does not work right, `vc-version-diff' ends up |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1608 ;; calling `vc-deduce-fileset' to find the files to diff, and |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1609 ;; that's not what we want here, we want the diff for the VC root dir. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1610 (call-interactively 'vc-version-diff) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1611 (when buffer-file-name (vc-buffer-sync not-urgent)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1612 (let ((backend |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1613 (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1614 (vc-mode (vc-backend buffer-file-name)))) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1615 rootdir working-revision) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1616 (unless backend |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1617 (error "Buffer is not version controlled")) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1618 (setq rootdir (vc-call-backend backend 'root default-directory)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1619 (setq working-revision (vc-working-revision rootdir)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1620 (vc-diff-internal |
105372
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
105170
diff
changeset
|
1621 t (list backend (list rootdir) working-revision) nil nil |
bd2966850aac
Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents:
105170
diff
changeset
|
1622 (called-interactively-p 'interactive))))) |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1623 |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1624 ;;;###autoload |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1625 (defun vc-revision-other-window (rev) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1626 "Visit revision REV of the current file in another window. |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1627 If the current file is named `F', the revision is named `F.~REV~'. |
41071 | 1628 If `F.~REV~' already exists, use it instead of checking it out again." |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1629 (interactive |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1630 (save-current-buffer |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1631 (vc-ensure-vc-buffer) |
104647
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1632 (list |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1633 (vc-read-revision "Revision to visit (default is working revision): " |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1634 (list buffer-file-name))))) |
21366
e7b64d0b3b3d
(vc-ensure-vc-buffer): New function.
André Spiegel <spiegel@gnu.org>
parents:
21357
diff
changeset
|
1635 (vc-ensure-vc-buffer) |
32888
78063b725d3f
(vc-version-other-window): Bind `file'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32748
diff
changeset
|
1636 (let* ((file buffer-file-name) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1637 (revision (if (string-equal rev "") |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1638 (vc-working-revision file) |
41556
678f91af978a
(vc-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41395
diff
changeset
|
1639 rev))) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1640 (switch-to-buffer-other-window (vc-find-revision file revision)))) |
41556
678f91af978a
(vc-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents:
41395
diff
changeset
|
1641 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1642 (defun vc-find-revision (file revision) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1643 "Read REVISION of FILE into a buffer and return the buffer." |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1644 (let ((automatic-backup (vc-version-backup-file-name file revision)) |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1645 (filebuf (or (get-file-buffer file) (current-buffer))) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1646 (filename (vc-version-backup-file-name file revision 'manual))) |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1647 (unless (file-exists-p filename) |
32748
e2cb0aef151a
(vc-checkout): Added `-p' suffix in call to vc-make-version-backups-p;
André Spiegel <spiegel@gnu.org>
parents:
32344
diff
changeset
|
1648 (if (file-exists-p automatic-backup) |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1649 (rename-file automatic-backup filename nil) |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1650 (message "Checking out %s..." filename) |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1651 (with-current-buffer filebuf |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1652 (let ((failed t)) |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1653 (unwind-protect |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1654 (let ((coding-system-for-read 'no-conversion) |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1655 (coding-system-for-write 'no-conversion)) |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1656 (with-temp-file filename |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1657 (let ((outbuf (current-buffer))) |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1658 ;; Change buffer to get local value of |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1659 ;; vc-checkout-switches. |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1660 (with-current-buffer filebuf |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1661 (vc-call find-revision file revision outbuf)))) |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1662 (setq failed nil)) |
86248
cde7fc4f5945
(vc-find-revision): Set the parent buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86100
diff
changeset
|
1663 (when (and failed (file-exists-p filename)) |
cde7fc4f5945
(vc-find-revision): Set the parent buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86100
diff
changeset
|
1664 (delete-file filename)))) |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1665 (vc-mode-line file)) |
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1666 (message "Checking out %s...done" filename))) |
86248
cde7fc4f5945
(vc-find-revision): Set the parent buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86100
diff
changeset
|
1667 (let ((result-buf (find-file-noselect filename))) |
cde7fc4f5945
(vc-find-revision): Set the parent buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86100
diff
changeset
|
1668 (with-current-buffer result-buf |
86410
bca8808972f0
Delete eol whitespace; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
86370
diff
changeset
|
1669 ;; Set the parent buffer so that things like |
86248
cde7fc4f5945
(vc-find-revision): Set the parent buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86100
diff
changeset
|
1670 ;; C-x v g, C-x v l, ... etc work. |
92122
74bf6df13b6c
* vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92093
diff
changeset
|
1671 (set (make-local-variable 'vc-parent-buffer) filebuf)) |
86248
cde7fc4f5945
(vc-find-revision): Set the parent buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86100
diff
changeset
|
1672 result-buf))) |
47796
cf312195338d
(vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47781
diff
changeset
|
1673 |
904 | 1674 ;; Header-insertion code |
1675 | |
927 | 1676 ;;;###autoload |
904 | 1677 (defun vc-insert-headers () |
41071 | 1678 "Insert headers into a file for use with a version control system. |
23235 | 1679 Headers desired are inserted at point, and are pulled from |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1680 the variable `vc-BACKEND-header'." |
904 | 1681 (interactive) |
21366
e7b64d0b3b3d
(vc-ensure-vc-buffer): New function.
André Spiegel <spiegel@gnu.org>
parents:
21357
diff
changeset
|
1682 (vc-ensure-vc-buffer) |
904 | 1683 (save-excursion |
1684 (save-restriction | |
1685 (widen) | |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1686 (when (or (not (vc-check-headers)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1687 (y-or-n-p "Version headers already exist. Insert another set? ")) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1688 (let* ((delims (cdr (assq major-mode vc-comment-alist))) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1689 (comment-start-vc (or (car delims) comment-start "#")) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1690 (comment-end-vc (or (car (cdr delims)) comment-end "")) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1691 (hdsym (vc-make-backend-sym (vc-backend buffer-file-name) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1692 'header)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1693 (hdstrings (and (boundp hdsym) (symbol-value hdsym)))) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1694 (dolist (s hdstrings) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1695 (insert comment-start-vc "\t" s "\t" |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1696 comment-end-vc "\n")) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1697 (when vc-static-header-alist |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1698 (dolist (f vc-static-header-alist) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1699 (when (string-match (car f) buffer-file-name) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1700 (insert (format (cdr f) (car hdstrings))))))))))) |
904 | 1701 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1702 (defun vc-clear-headers (&optional file) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1703 "Clear all version headers in the current buffer (or FILE). |
41071 | 1704 The headers are reset to their non-expanded form." |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1705 (let* ((filename (or file buffer-file-name)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1706 (visited (find-buffer-visiting filename)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1707 (backend (vc-backend filename))) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1708 (when (vc-find-backend-function backend 'clear-headers) |
31565
de4e73d77734
(vc-dired-listing-switches): Fix :version.
Dave Love <fx@gnu.org>
parents:
31520
diff
changeset
|
1709 (if visited |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1710 (let ((context (vc-buffer-context))) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1711 ;; save-excursion may be able to relocate point and mark |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1712 ;; properly. If it fails, vc-restore-buffer-context |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1713 ;; will give it a second try. |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1714 (save-excursion |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1715 (vc-call-backend backend 'clear-headers)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1716 (vc-restore-buffer-context context)) |
32058
4196f89984ce
* vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32054
diff
changeset
|
1717 (set-buffer (find-file-noselect filename)) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1718 (vc-call-backend backend 'clear-headers) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1719 (kill-buffer filename))))) |
12872
857663042672
(vc-revert-buffer1): Split part of the function into vc-buffer-context
André Spiegel <spiegel@gnu.org>
parents:
12819
diff
changeset
|
1720 |
87432
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1721 (defun vc-modify-change-comment (files rev oldcomment) |
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1722 "Edit the comment associated with the given files and revision." |
94576
7de38dedf0a6
Move the command-closure machinery to vc-dispatcher.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94573
diff
changeset
|
1723 (vc-start-logentry |
87432
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1724 files rev oldcomment t |
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1725 "Enter a replacement change comment." |
95018
2253b8d4def6
More elimination of buffer name dependencies.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95017
diff
changeset
|
1726 "*VC-log*" |
87432
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1727 (lambda (files rev comment) |
87596
0f01cefc5aa8
Fix typo in comment. Reported by Tom Tromey <tromey@redhat.com>.
Juanma Barranquero <lekktu@gmail.com>
parents:
87590
diff
changeset
|
1728 (vc-call-backend |
87432
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1729 ;; Less of a kluge than it looks like; log-view mode only passes |
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1730 ;; this function a singleton list. Arguments left in this form in |
87596
0f01cefc5aa8
Fix typo in comment. Reported by Tom Tromey <tromey@redhat.com>.
Juanma Barranquero <lekktu@gmail.com>
parents:
87590
diff
changeset
|
1731 ;; case the more general operation ever becomes meaningful. |
0f01cefc5aa8
Fix typo in comment. Reported by Tom Tromey <tromey@redhat.com>.
Juanma Barranquero <lekktu@gmail.com>
parents:
87590
diff
changeset
|
1732 (vc-responsible-backend (car files)) |
87432
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1733 'modify-change-comment files rev comment)))) |
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
1734 |
21366
e7b64d0b3b3d
(vc-ensure-vc-buffer): New function.
André Spiegel <spiegel@gnu.org>
parents:
21357
diff
changeset
|
1735 ;;;###autoload |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1736 (defun vc-merge () |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1737 "Merge changes between two revisions into the current buffer's file. |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1738 This asks for two revisions to merge from in the minibuffer. If the |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1739 first revision is a branch number, then merge all changes from that |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1740 branch. If the first revision is empty, merge news, i.e. recent changes |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1741 from the current branch. |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1742 |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1743 See Info node `Merging'." |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1744 (interactive) |
21368
37b978fc46cb
(vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents:
21366
diff
changeset
|
1745 (vc-ensure-vc-buffer) |
37b978fc46cb
(vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents:
21366
diff
changeset
|
1746 (vc-buffer-sync) |
37b978fc46cb
(vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents:
21366
diff
changeset
|
1747 (let* ((file buffer-file-name) |
37b978fc46cb
(vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents:
21366
diff
changeset
|
1748 (backend (vc-backend file)) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1749 (state (vc-state file)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1750 first-revision second-revision status) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1751 (cond |
85064
3e1b7531aa3e
Port various comments from new VC to reduce the noise in the diff.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85059
diff
changeset
|
1752 ((stringp state) ;; Locking VCses only |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1753 (error "File is locked by %s" state)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1754 ((not (vc-editable-p file)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1755 (if (y-or-n-p |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1756 "File must be checked out for merging. Check out now? ") |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1757 (vc-checkout file t) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1758 (error "Merge aborted")))) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1759 (setq first-revision |
104647
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1760 (vc-read-revision |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1761 (concat "Branch or revision to merge from " |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1762 "(default news on current branch): ") |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1763 (list file) |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1764 backend)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1765 (if (string= first-revision "") |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1766 (setq status (vc-call-backend backend 'merge-news file)) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1767 (if (not (vc-find-backend-function backend 'merge)) |
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1768 (error "Sorry, merging is not implemented for %s" backend) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1769 (if (not (vc-branch-p first-revision)) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1770 (setq second-revision |
104647
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1771 (vc-read-revision |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1772 "Second revision: " |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1773 (list file) backend nil |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1774 ;; FIXME: This is CVS/RCS/SCCS specific. |
ef4820f099a1
(vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104621
diff
changeset
|
1775 (concat (vc-branch-part first-revision) "."))) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1776 ;; We want to merge an entire branch. Set revisions |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1777 ;; accordingly, so that vc-BACKEND-merge understands us. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1778 (setq second-revision first-revision) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1779 ;; first-revision must be the starting point of the branch |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1780 (setq first-revision (vc-branch-part first-revision))) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1781 (setq status (vc-call-backend backend 'merge file |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1782 first-revision second-revision)))) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1783 (vc-maybe-resolve-conflicts file status "WORKFILE" "MERGE SOURCE"))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1784 |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1785 (defun vc-maybe-resolve-conflicts (file status &optional name-A name-B) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1786 (vc-resynch-buffer file t (not (buffer-modified-p))) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1787 (if (zerop status) (message "Merge successful") |
87785
8f1628da223f
* smerge-mode.el (smerge-start-session): Rename from smerge-auto.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87743
diff
changeset
|
1788 (smerge-mode 1) |
54586
c3043c1faed3
(vc-maybe-resolve-conflicts): Don't prompt the user.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54562
diff
changeset
|
1789 (message "File contains conflicts."))) |
21368
37b978fc46cb
(vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents:
21366
diff
changeset
|
1790 |
37b978fc46cb
(vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents:
21366
diff
changeset
|
1791 ;;;###autoload |
47781
79bdd88fb006
(vc-resolve-conflicts); Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47780
diff
changeset
|
1792 (defalias 'vc-resolve-conflicts 'smerge-ediff) |
21324
b0abfde79536
* vc.el (vc-resolve-conflicts): New function.
André Spiegel <spiegel@gnu.org>
parents:
21233
diff
changeset
|
1793 |
904 | 1794 ;; Named-configuration entry points |
1795 | |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1796 (defun vc-tag-precondition (dir) |
41071 | 1797 "Scan the tree below DIR, looking for files not up-to-date. |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1798 If any file is not up-to-date, return the name of the first such file. |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1799 \(This means, neither tag creation nor retrieval is allowed.\) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1800 If one or more of the files are currently visited, return `visited'. |
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1801 Otherwise, return nil." |
12714
192f537bca2a
(vc-resynch-buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12589
diff
changeset
|
1802 (let ((status nil)) |
192f537bca2a
(vc-resynch-buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12589
diff
changeset
|
1803 (catch 'vc-locked-example |
192f537bca2a
(vc-resynch-buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12589
diff
changeset
|
1804 (vc-file-tree-walk |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1805 dir |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1806 (lambda (f) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1807 (if (not (vc-up-to-date-p f)) (throw 'vc-locked-example f) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1808 (when (get-file-buffer f) (setq status 'visited))))) |
12714
192f537bca2a
(vc-resynch-buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12589
diff
changeset
|
1809 status))) |
904 | 1810 |
927 | 1811 ;;;###autoload |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1812 (defun vc-create-tag (dir name branchp) |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1813 "Descending recursively from DIR, make a tag called NAME. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1814 For each registered file, the working revision becomes part of |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1815 the named configuration. If the prefix argument BRANCHP is |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1816 given, the tag is made as a new branch and the files are |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1817 checked out in that new branch." |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1818 (interactive |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1819 (list (read-file-name "Directory: " default-directory default-directory t) |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1820 (read-string "New tag name: ") |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1821 current-prefix-arg)) |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1822 (message "Making %s... " (if branchp "branch" "tag")) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1823 (when (file-directory-p dir) (setq dir (file-name-as-directory dir))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1824 (vc-call-backend (vc-responsible-backend dir) |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1825 'create-tag dir name branchp) |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1826 (message "Making %s... done" (if branchp "branch" "tag"))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1827 |
927 | 1828 ;;;###autoload |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1829 (defun vc-retrieve-tag (dir name) |
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1830 "Descending recursively from DIR, retrieve the tag called NAME. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1831 If NAME is empty, it refers to the latest revisions. |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1832 If locking is used for the files in DIR, then there must not be any |
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1833 locked files at or below DIR (but if NAME is empty, locked files are |
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
1834 allowed and simply skipped)." |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1835 (interactive |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1836 (list (read-file-name "Directory: " default-directory default-directory t) |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1837 (read-string "Tag name to retrieve (default latest revisions): "))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1838 (let ((update (yes-or-no-p "Update any affected buffers? ")) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1839 (msg (if (or (not name) (string= name "")) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1840 (format "Updating %s... " (abbreviate-file-name dir)) |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1841 (format "Retrieving tag into %s... " |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1842 (abbreviate-file-name dir))))) |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
65405
diff
changeset
|
1843 (message "%s" msg) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1844 (vc-call-backend (vc-responsible-backend dir) |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
1845 'retrieve-tag dir name update) |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
65405
diff
changeset
|
1846 (message "%s" (concat msg "done")))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
1847 |
904 | 1848 ;; Miscellaneous other entry points |
1849 | |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1850 ;; FIXME: this should be a defcustom |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1851 ;; FIXME: maybe add another choice: |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1852 ;; `root-directory' (or somesuch), which would mean show a short log |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1853 ;; for the root directory. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1854 (defvar vc-log-short-style '(directory) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1855 "Whether or not to show a short log. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1856 If it contains `directory' then if the fileset contains a directory show a short log. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1857 If it contains `file' then show short logs for files. |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1858 Not all VC backends support short logs!") |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1859 |
104041
f2d3a9b75762
(vc-print-log-internal): New function, split out from ...
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103596
diff
changeset
|
1860 (defun vc-print-log-internal (backend files working-revision) |
f2d3a9b75762
(vc-print-log-internal): New function, split out from ...
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103596
diff
changeset
|
1861 ;; Don't switch to the output buffer before running the command, |
f2d3a9b75762
(vc-print-log-internal): New function, split out from ...
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103596
diff
changeset
|
1862 ;; so that any buffer-local settings in the vc-controlled |
f2d3a9b75762
(vc-print-log-internal): New function, split out from ...
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103596
diff
changeset
|
1863 ;; buffer can be accessed by the command. |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1864 (let ((dir-present nil) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1865 (vc-short-log nil)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1866 (dolist (file files) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1867 (when (file-directory-p file) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1868 (setq dir-present t))) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1869 (setq vc-short-log |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1870 (not (null (if dir-present |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1871 (memq 'directory vc-log-short-style) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1872 (memq 'file vc-log-short-style))))) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1873 (vc-call-backend backend 'print-log files "*vc-change-log*" vc-short-log) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1874 (pop-to-buffer "*vc-change-log*") |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1875 (vc-exec-after |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1876 `(let ((inhibit-read-only t) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1877 (vc-short-log ,vc-short-log)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1878 (vc-call-backend ',backend 'log-view-mode) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1879 (set (make-local-variable 'log-view-vc-backend) ',backend) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1880 (set (make-local-variable 'log-view-vc-fileset) ',files) |
104597
d3ef713449d3
* vc.el (vc-diff-internal): Let-bind `process-file-side-effects' with nil.
Michael Albinus <michael.albinus@gmx.de>
parents:
104042
diff
changeset
|
1881 |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1882 (shrink-window-if-larger-than-buffer) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1883 ;; move point to the log entry for the working revision |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1884 (vc-call-backend ',backend 'show-log-entry ',working-revision) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1885 (setq vc-sentinel-movepoint (point)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1886 (set-buffer-modified-p nil))))) |
104041
f2d3a9b75762
(vc-print-log-internal): New function, split out from ...
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103596
diff
changeset
|
1887 |
927 | 1888 ;;;###autoload |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1889 (defun vc-print-log (&optional working-revision) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1890 "List the change log of the current fileset in a window. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1891 If WORKING-REVISION is non-nil, leave the point at that revision." |
904 | 1892 (interactive) |
96046
422d57d537d7
(vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95966
diff
changeset
|
1893 (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1894 (backend (car vc-fileset)) |
94984
b8d24d4a4bdc
Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94974
diff
changeset
|
1895 (files (cadr vc-fileset)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1896 (working-revision (or working-revision (vc-working-revision (car files))))) |
104041
f2d3a9b75762
(vc-print-log-internal): New function, split out from ...
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103596
diff
changeset
|
1897 (vc-print-log-internal backend files working-revision))) |
904 | 1898 |
927 | 1899 ;;;###autoload |
105010
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1900 (defun vc-print-root-log () |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1901 "List the change log of for the current VC controlled tree in a window." |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1902 (interactive) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1903 (let ((backend |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1904 (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1905 (vc-mode (vc-backend buffer-file-name)))) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1906 rootdir working-revision) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1907 (unless backend |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1908 (error "Buffer is not version controlled")) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1909 (setq rootdir (vc-call-backend backend 'root default-directory)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1910 (setq working-revision (vc-working-revision rootdir)) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1911 (vc-print-log-internal backend (list rootdir) working-revision))) |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1912 |
b3c2589ed19e
* vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents:
104711
diff
changeset
|
1913 ;;;###autoload |
81957
8f9991bf3b41
Generalize stay-local-p to operatre on lists of files.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81923
diff
changeset
|
1914 (defun vc-revert () |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1915 "Revert working copies of the selected fileset to their repository contents. |
952 | 1916 This asks for confirmation if the buffer contents are not identical |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1917 to the working revision (except for keyword expansion)." |
904 | 1918 (interactive) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1919 (let* ((vc-fileset (vc-deduce-fileset)) |
94984
b8d24d4a4bdc
Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94974
diff
changeset
|
1920 (files (cadr vc-fileset))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1921 ;; If any of the files is visited by the current buffer, make |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1922 ;; sure buffer is saved. If the user says `no', abort since |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1923 ;; we cannot show the changes and ask for confirmation to |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1924 ;; discard them. |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1925 (when (or (not files) (memq (buffer-file-name) files)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1926 (vc-buffer-sync nil)) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1927 (dolist (file files) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1928 (let ((buf (get-file-buffer file))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1929 (when (and buf (buffer-modified-p buf)) |
105170 | 1930 (error "Please kill or save all modified buffers before reverting"))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1931 (when (vc-up-to-date-p file) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1932 (unless (yes-or-no-p (format "%s seems up-to-date. Revert anyway? " file)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1933 (error "Revert canceled")))) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1934 (when (vc-diff-internal vc-allow-async-revert vc-fileset nil nil) |
99262
bc878f998f43
(vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents:
99159
diff
changeset
|
1935 (unless (yes-or-no-p |
bc878f998f43
(vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents:
99159
diff
changeset
|
1936 (format "Discard changes in %s? " |
bc878f998f43
(vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents:
99159
diff
changeset
|
1937 (let ((str (vc-delistify files))) |
bc878f998f43
(vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents:
99159
diff
changeset
|
1938 (if (< (length str) 50) |
bc878f998f43
(vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents:
99159
diff
changeset
|
1939 str |
bc878f998f43
(vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents:
99159
diff
changeset
|
1940 (format "%d files" (length files)))))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1941 (error "Revert canceled")) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1942 (delete-windows-on "*vc-diff*") |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1943 (kill-buffer "*vc-diff*")) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1944 (dolist (file files) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1945 (message "Reverting %s..." (vc-delistify files)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1946 (vc-revert-file file) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1947 (message "Reverting %s...done" (vc-delistify files))))) |
904 | 1948 |
43586
62c8a228bc1f
(vc-update): New function.
André Spiegel <spiegel@gnu.org>
parents:
43584
diff
changeset
|
1949 ;;;###autoload |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1950 (defun vc-rollback () |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1951 "Roll back (remove) the most recent changeset committed to the repository. |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1952 This may be either a file-level or a repository-level operation, |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1953 depending on the underlying version-control system." |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1954 (interactive) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1955 (let* ((vc-fileset (vc-deduce-fileset)) |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1956 (backend (car vc-fileset)) |
94984
b8d24d4a4bdc
Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94974
diff
changeset
|
1957 (files (cadr vc-fileset)) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1958 (granularity (vc-call-backend backend 'revision-granularity))) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1959 (unless (vc-find-backend-function backend 'rollback) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1960 (error "Rollback is not supported in %s" backend)) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1961 (when (and (not (eq granularity 'repository)) (/= (length files) 1)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1962 (error "Rollback requires a singleton fileset or repository versioning")) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1963 ;; FIXME: latest-on-branch-p should take the fileset. |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1964 (when (not (vc-call-backend backend 'latest-on-branch-p (car files))) |
105170 | 1965 (error "Rollback is only possible at the tip revision")) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1966 ;; If any of the files is visited by the current buffer, make |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1967 ;; sure buffer is saved. If the user says `no', abort since |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1968 ;; we cannot show the changes and ask for confirmation to |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1969 ;; discard them. |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1970 (when (or (not files) (memq (buffer-file-name) files)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1971 (vc-buffer-sync nil)) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1972 (dolist (file files) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1973 (when (buffer-modified-p (get-file-buffer file)) |
105170 | 1974 (error "Please kill or save all modified buffers before rollback")) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
1975 (when (not (vc-up-to-date-p file)) |
105170 | 1976 (error "Please revert all modified workfiles before rollback"))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1977 ;; Accumulate changes associated with the fileset |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1978 (vc-setup-buffer "*vc-diff*") |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1979 (not-modified) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1980 (message "Finding changes...") |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1981 (let* ((tip (vc-working-revision (car files))) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1982 ;; FIXME: `previous-revision' should take the fileset. |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1983 (previous (vc-call-backend backend 'previous-revision |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
1984 (car files) tip))) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
1985 (vc-diff-internal nil vc-fileset previous tip)) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1986 ;; Display changes |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1987 (unless (yes-or-no-p "Discard these revisions? ") |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1988 (error "Rollback canceled")) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1989 (delete-windows-on "*vc-diff*") |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1990 (kill-buffer"*vc-diff*") |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1991 ;; Do the actual reversions |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1992 (message "Rolling back %s..." (vc-delistify files)) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1993 (with-vc-properties |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1994 files |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1995 (vc-call-backend backend 'rollback files) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1996 `((vc-state . ,'up-to-date) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
1997 (vc-checkout-time . , (nth 5 (file-attributes file))) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
1998 (vc-working-revision . nil))) |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
1999 (dolist (f files) (vc-resynch-buffer f t t)) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2000 (message "Rolling back %s...done" (vc-delistify files)))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2001 |
38595
396f97177ef1
(vc-switch-backend): Fix autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
38442
diff
changeset
|
2002 ;;;###autoload |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2003 (define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1") |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2004 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2005 ;;;###autoload |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2006 (defun vc-update () |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2007 "Update the current fileset's files to their tip revisions. |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
2008 For each one that contains no changes, and is not locked, then this simply |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
2009 replaces the work file with the latest revision on its branch. If the file |
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
2010 contains changes, and the backend supports merging news, then any recent |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2011 changes from the current branch are merged into the working file." |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2012 (interactive) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2013 (let* ((vc-fileset (vc-deduce-fileset)) |
94778
b9687393def1
Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94729
diff
changeset
|
2014 (backend (car vc-fileset)) |
94984
b8d24d4a4bdc
Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94974
diff
changeset
|
2015 (files (cadr vc-fileset))) |
95587
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
2016 (save-some-buffers ; save buffers visiting files |
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
2017 nil (lambda () |
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
2018 (and (buffer-modified-p) |
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
2019 (let ((file (buffer-file-name))) |
cb8fbc8ef1c5
(vc-update): Use `save-some-buffers' instead of signaling an error on modified buffers.
Sam Steingold <sds@gnu.org>
parents:
95327
diff
changeset
|
2020 (and file (member file files)))))) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2021 (dolist (file files) |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2022 (if (vc-up-to-date-p file) |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2023 (vc-checkout file nil t) |
94563
a0bb8ca25a33
Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94556
diff
changeset
|
2024 (if (eq (vc-checkout-model backend (list file)) 'locking) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2025 (if (eq (vc-state file) 'edited) |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2026 (error "%s" |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2027 (substitute-command-keys |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2028 "File is locked--type \\[vc-revert] to discard changes")) |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2029 (error "Unexpected file state (%s) -- type %s" |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2030 (vc-state file) |
87147 | 2031 (substitute-command-keys |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2032 "\\[vc-next-action] to correct"))) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2033 (vc-maybe-resolve-conflicts |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2034 file (vc-call-backend backend 'merge-news file))))))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2035 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2036 (defun vc-version-backup-file (file &optional rev) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2037 "Return name of backup file for revision REV of FILE. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2038 If version backups should be used for FILE, and there exists |
85454
be5bf5efd2ed
Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85364
diff
changeset
|
2039 such a backup for REV or the working revision of file, return |
85059
062474ac8e41
Terminology sync, workfile version -> focus version.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85042
diff
changeset
|
2040 its name; otherwise return nil." |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2041 (when (vc-call make-version-backups-p file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2042 (let ((backup-file (vc-version-backup-file-name file rev))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2043 (if (file-exists-p backup-file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2044 backup-file |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2045 ;; there is no automatic backup, but maybe the user made one manually |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2046 (setq backup-file (vc-version-backup-file-name file rev 'manual)) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2047 (when (file-exists-p backup-file) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2048 backup-file))))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2049 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2050 (defun vc-revert-file (file) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2051 "Revert FILE back to the repository working revision it was based on." |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2052 (with-vc-properties |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2053 (list file) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2054 (let ((backup-file (vc-version-backup-file file))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2055 (when backup-file |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2056 (copy-file backup-file file 'ok-if-already-exists 'keep-date) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2057 (vc-delete-automatic-version-backups file)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2058 (vc-call revert file backup-file)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2059 `((vc-state . up-to-date) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2060 (vc-checkout-time . ,(nth 5 (file-attributes file))))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2061 (vc-resynch-buffer file t t)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2062 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2063 ;;;###autoload |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2064 (defun vc-switch-backend (file backend) |
32058
4196f89984ce
* vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32054
diff
changeset
|
2065 "Make BACKEND the current version control system for FILE. |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2066 FILE must already be registered in BACKEND. The change is not |
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2067 permanent, only for the current session. This function only changes |
32058
4196f89984ce
* vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32054
diff
changeset
|
2068 VC's perspective on FILE, it does not register or unregister it. |
4196f89984ce
* vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32054
diff
changeset
|
2069 By default, this command cycles through the registered backends. |
4196f89984ce
* vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32054
diff
changeset
|
2070 To get a prompt, use a prefix argument." |
4196f89984ce
* vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32054
diff
changeset
|
2071 (interactive |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2072 (list |
66549
13a55a7627fd
(vc-switch-backend): Better error message if the buffer is not visiting a
André Spiegel <spiegel@gnu.org>
parents:
66425
diff
changeset
|
2073 (or buffer-file-name |
13a55a7627fd
(vc-switch-backend): Better error message if the buffer is not visiting a
André Spiegel <spiegel@gnu.org>
parents:
66425
diff
changeset
|
2074 (error "There is no version-controlled file in this buffer")) |
96123
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2075 (let ((crt-bk (vc-backend buffer-file-name)) |
32058
4196f89984ce
* vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32054
diff
changeset
|
2076 (backends nil)) |
96123
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2077 (unless crt-bk |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2078 (error "File %s is not under version control" buffer-file-name)) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2079 ;; Find the registered backends. |
96123
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2080 (dolist (crt vc-handled-backends) |
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2081 (when (and (vc-call-backend crt 'registered buffer-file-name) |
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2082 (not (eq crt-bk crt))) |
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2083 (push crt backends))) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2084 ;; Find the next backend. |
96123
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2085 (let ((def (car backends)) |
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2086 (others backends)) |
85132
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2087 (cond |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2088 ((null others) (error "No other backend to switch to")) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2089 (current-prefix-arg |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2090 (intern |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2091 (upcase |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2092 (completing-read |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2093 (format "Switch to backend [%s]: " def) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2094 (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends) |
d5d7671ba1ea
Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85114
diff
changeset
|
2095 nil t nil nil (downcase (symbol-name def)))))) |
96123
7742c3c06407
* vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96122
diff
changeset
|
2096 (t def)))))) |
32059
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
2097 (unless (eq backend (vc-backend file)) |
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
2098 (vc-file-clearprops file) |
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
2099 (vc-file-setprop file 'vc-backend backend) |
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
2100 ;; Force recomputation of the state |
32189
921a2e8fa97e
(with-vc-properties): Use conses rather than length-2 lists.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32126
diff
changeset
|
2101 (unless (vc-call-backend backend 'registered file) |
921a2e8fa97e
(with-vc-properties): Use conses rather than length-2 lists.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32126
diff
changeset
|
2102 (vc-file-clearprops file) |
921a2e8fa97e
(with-vc-properties): Use conses rather than length-2 lists.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32126
diff
changeset
|
2103 (error "%s is not registered in %s" file backend)) |
32059
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
2104 (vc-mode-line file))) |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2105 |
38726
2dddcf515155
(vc-transfer-file): Fix malformed autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents:
38608
diff
changeset
|
2106 ;;;###autoload |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2107 (defun vc-transfer-file (file new-backend) |
32059
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
2108 "Transfer FILE to another version control system NEW-BACKEND. |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2109 If NEW-BACKEND has a higher precedence than FILE's current backend |
32059
13e0fdf65e3c
(with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
32058
diff
changeset
|
2110 \(i.e. it comes earlier in `vc-handled-backends'), then register FILE in |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2111 NEW-BACKEND, using the revision number from the current backend as the |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2112 base level. If NEW-BACKEND has a lower precedence than the current |
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2113 backend, then commit all changes that were made under the current |
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2114 backend to NEW-BACKEND, and unregister FILE from the current backend. |
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2115 \(If FILE is not yet registered under NEW-BACKEND, register it.)" |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2116 (let* ((old-backend (vc-backend file)) |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2117 (edited (memq (vc-state file) '(edited needs-merge))) |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2118 (registered (vc-call-backend new-backend 'registered file)) |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2119 (move |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2120 (and registered ; Never move if not registered in new-backend yet. |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2121 ;; move if new-backend comes later in vc-handled-backends |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2122 (or (memq new-backend (memq old-backend vc-handled-backends)) |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2123 (y-or-n-p "Final transfer? ")))) |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2124 (comment nil)) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2125 (when (eq old-backend new-backend) |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2126 (error "%s is the current backend of %s" new-backend file)) |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2127 (if registered |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2128 (set-file-modes file (logior (file-modes file) 128)) |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2129 ;; `registered' might have switched under us. |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2130 (vc-switch-backend file old-backend) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2131 (let* ((rev (vc-working-revision file)) |
43725
60a9d71aad02
(vc-transfer-file): Use `make-temp-file' instead of `make-temp-name'.
André Spiegel <spiegel@gnu.org>
parents:
43586
diff
changeset
|
2132 (modified-file (and edited (make-temp-file file))) |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2133 (unmodified-file (and modified-file (vc-version-backup-file file)))) |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2134 ;; Go back to the base unmodified file. |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2135 (unwind-protect |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2136 (progn |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2137 (when modified-file |
43725
60a9d71aad02
(vc-transfer-file): Use `make-temp-file' instead of `make-temp-name'.
André Spiegel <spiegel@gnu.org>
parents:
43586
diff
changeset
|
2138 (copy-file file modified-file 'ok-if-already-exists) |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2139 ;; If we have a local copy of the unmodified file, handle that |
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2140 ;; here and not in vc-revert-file because we don't want to |
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2141 ;; delete that copy -- it is still useful for OLD-BACKEND. |
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2142 (if unmodified-file |
50894
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2143 (copy-file unmodified-file file |
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2144 'ok-if-already-exists 'keep-date) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2145 (when (y-or-n-p "Get base revision from master? ") |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2146 (vc-revert-file file)))) |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2147 (vc-call-backend new-backend 'receive-file file rev)) |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2148 (when modified-file |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2149 (vc-switch-backend file new-backend) |
94563
a0bb8ca25a33
Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94556
diff
changeset
|
2150 (unless (eq (vc-checkout-model new-backend (list file)) 'implicit) |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2151 (vc-checkout file t nil)) |
32126
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2152 (rename-file modified-file file 'ok-if-already-exists) |
3aab429d3c8a
(vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents:
32097
diff
changeset
|
2153 (vc-file-setprop file 'vc-checkout-time nil))))) |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2154 (when move |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2155 (vc-switch-backend file old-backend) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2156 (setq comment (vc-call-backend old-backend 'comment-history file)) |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2157 (vc-call-backend old-backend 'unregister file)) |
32097
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2158 (vc-switch-backend file new-backend) |
adf341c172af
(vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents:
32093
diff
changeset
|
2159 (when (or move edited) |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2160 (vc-file-setprop file 'vc-state 'edited) |
103553
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
2161 (vc-mode-line file new-backend) |
102576
ca736f834e8c
(vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents:
102554
diff
changeset
|
2162 (vc-checkin file new-backend nil comment (stringp comment))))) |
31810
495ca3bd372d
(vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents:
31718
diff
changeset
|
2163 |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2164 (defun vc-rename-master (oldmaster newfile templates) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2165 "Rename OLDMASTER to be the master file for NEWFILE based on TEMPLATES." |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2166 (let* ((dir (file-name-directory (expand-file-name oldmaster))) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2167 (newdir (or (file-name-directory newfile) "")) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2168 (newbase (file-name-nondirectory newfile)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2169 (masters |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2170 ;; List of potential master files for `newfile' |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2171 (mapcar |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2172 (lambda (s) (vc-possible-master s newdir newbase)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2173 templates))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2174 (when (or (file-symlink-p oldmaster) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2175 (file-symlink-p (file-name-directory oldmaster))) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2176 (error "This is unsafe in the presence of symbolic links")) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2177 (rename-file |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2178 oldmaster |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2179 (catch 'found |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2180 ;; If possible, keep the master file in the same directory. |
50894
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2181 (dolist (f masters) |
94240
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2182 (when (and f (string= (file-name-directory (expand-file-name f)) dir)) |
9f1f284d17b3
(vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94214
diff
changeset
|
2183 (throw 'found f))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2184 ;; If not, just use the first possible place. |
50894
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2185 (dolist (f masters) |
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2186 (and f (or (not (setq dir (file-name-directory f))) |
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2187 (file-directory-p dir)) |
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2188 (throw 'found f))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2189 (error "New file lacks a version control directory"))))) |
904 | 2190 |
103153
ce30850e6e3f
(vc-delete-file): Add autoload cookie (bug#3209).
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
102680
diff
changeset
|
2191 ;;;###autoload |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2192 (defun vc-delete-file (file) |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2193 "Delete file and mark it as such in the version control system." |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2194 (interactive "fVC delete file: ") |
93165
c4dc2a72d555
(vc-status-mark-buffer-changed): Add an optional file parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93159
diff
changeset
|
2195 (setq file (expand-file-name file)) |
51245
f6920b201e1c
(vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents:
51064
diff
changeset
|
2196 (let ((buf (get-file-buffer file)) |
f6920b201e1c
(vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents:
51064
diff
changeset
|
2197 (backend (vc-backend file))) |
f6920b201e1c
(vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents:
51064
diff
changeset
|
2198 (unless backend |
51627
1329f6a6c949
(vc-rename-file): Fix typo.
Luc Teirlinck <teirllm@auburn.edu>
parents:
51369
diff
changeset
|
2199 (error "File %s is not under version control" |
51245
f6920b201e1c
(vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents:
51064
diff
changeset
|
2200 (file-name-nondirectory file))) |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2201 (unless (vc-find-backend-function backend 'delete-file) |
51245
f6920b201e1c
(vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents:
51064
diff
changeset
|
2202 (error "Deleting files under %s is not supported in VC" backend)) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2203 (when (and buf (buffer-modified-p buf)) |
94520
069edac43148
(vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents:
94519
diff
changeset
|
2204 (error "Please save or undo your changes before deleting %s" file)) |
069edac43148
(vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents:
94519
diff
changeset
|
2205 (let ((state (vc-state file))) |
069edac43148
(vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents:
94519
diff
changeset
|
2206 (when (eq state 'edited) |
069edac43148
(vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents:
94519
diff
changeset
|
2207 (error "Please commit or undo your changes before deleting %s" file)) |
069edac43148
(vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents:
94519
diff
changeset
|
2208 (when (eq state 'conflict) |
069edac43148
(vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents:
94519
diff
changeset
|
2209 (error "Please resolve the conflicts before deleting %s" file))) |
65689
96187e7edd1b
2005-09-25 Romain Francoise <romain@orebokech.com>
Romain Francoise <romain@orebokech.com>
parents:
65680
diff
changeset
|
2210 (unless (y-or-n-p (format "Really want to delete %s? " |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2211 (file-name-nondirectory file))) |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2212 (error "Abort!")) |
94499
5f57377d1eff
(vc-dir-mode-map): Bind "d" to vc-dir-delete-file.
Sam Steingold <sds@gnu.org>
parents:
94495
diff
changeset
|
2213 (unless (or (file-directory-p file) (null make-backup-files) |
5f57377d1eff
(vc-dir-mode-map): Bind "d" to vc-dir-delete-file.
Sam Steingold <sds@gnu.org>
parents:
94495
diff
changeset
|
2214 (not (file-exists-p file))) |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2215 (with-current-buffer (or buf (find-file-noselect file)) |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2216 (let ((backup-inhibited nil)) |
95269
1e9eb6106f5a
(vc-delete-file): Don't try to resynch the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
95079
diff
changeset
|
2217 (backup-buffer)))) |
95895
2ab93a71b21a
(vc-delete-file): Bound default-directory before calling
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95853
diff
changeset
|
2218 ;; Bind `default-directory' so that the command that the backend |
2ab93a71b21a
(vc-delete-file): Bound default-directory before calling
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95853
diff
changeset
|
2219 ;; runs to remove the file is invoked in the correct context. |
2ab93a71b21a
(vc-delete-file): Bound default-directory before calling
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95853
diff
changeset
|
2220 (let ((default-directory (file-name-directory file))) |
2ab93a71b21a
(vc-delete-file): Bound default-directory before calling
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95853
diff
changeset
|
2221 (vc-call-backend backend 'delete-file file)) |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2222 ;; If the backend hasn't deleted the file itself, let's do it for him. |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2223 (when (file-exists-p file) (delete-file file)) |
93165
c4dc2a72d555
(vc-status-mark-buffer-changed): Add an optional file parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93159
diff
changeset
|
2224 ;; Forget what VC knew about the file. |
c4dc2a72d555
(vc-status-mark-buffer-changed): Add an optional file parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93159
diff
changeset
|
2225 (vc-file-clearprops file) |
95270
4d7bc1390196
(vc-delete-file): Make sure the buffer is deleted and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95269
diff
changeset
|
2226 ;; Make sure the buffer is deleted and the *vc-dir* buffers are |
4d7bc1390196
(vc-delete-file): Make sure the buffer is deleted and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95269
diff
changeset
|
2227 ;; updated after this. |
4d7bc1390196
(vc-delete-file): Make sure the buffer is deleted and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95269
diff
changeset
|
2228 (vc-resynch-buffer file nil t))) |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2229 |
9044
5ddb0e0adb08
(vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents:
8726
diff
changeset
|
2230 ;;;###autoload |
904 | 2231 (defun vc-rename-file (old new) |
2750
6f340eabf13f
Improve doc strings and prompt strings.
Richard M. Stallman <rms@gnu.org>
parents:
2745
diff
changeset
|
2232 "Rename file OLD to NEW, and rename its master file likewise." |
6f340eabf13f
Improve doc strings and prompt strings.
Richard M. Stallman <rms@gnu.org>
parents:
2745
diff
changeset
|
2233 (interactive "fVC rename file: \nFRename to: ") |
95853
174293e3d9fc
(vc-rename-file): DTRT when the destination is a directory name and the source is a file.
Sam Steingold <sds@gnu.org>
parents:
95587
diff
changeset
|
2234 ;; in CL I would have said (setq new (merge-pathnames new old)) |
174293e3d9fc
(vc-rename-file): DTRT when the destination is a directory name and the source is a file.
Sam Steingold <sds@gnu.org>
parents:
95587
diff
changeset
|
2235 (let ((old-base (file-name-nondirectory old))) |
174293e3d9fc
(vc-rename-file): DTRT when the destination is a directory name and the source is a file.
Sam Steingold <sds@gnu.org>
parents:
95587
diff
changeset
|
2236 (when (and (not (string= "" old-base)) |
174293e3d9fc
(vc-rename-file): DTRT when the destination is a directory name and the source is a file.
Sam Steingold <sds@gnu.org>
parents:
95587
diff
changeset
|
2237 (string= "" (file-name-nondirectory new))) |
174293e3d9fc
(vc-rename-file): DTRT when the destination is a directory name and the source is a file.
Sam Steingold <sds@gnu.org>
parents:
95587
diff
changeset
|
2238 (setq new (concat new old-base)))) |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2239 (let ((oldbuf (get-file-buffer old))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2240 (when (and oldbuf (buffer-modified-p oldbuf)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2241 (error "Please save files before moving them")) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2242 (when (get-file-buffer new) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2243 (error "Already editing new file name")) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2244 (when (file-exists-p new) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2245 (error "New file already exists")) |
51627
1329f6a6c949
(vc-rename-file): Fix typo.
Luc Teirlinck <teirllm@auburn.edu>
parents:
51369
diff
changeset
|
2246 (let ((state (vc-state old))) |
50926
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2247 (unless (memq state '(up-to-date edited)) |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2248 (error "Please %s files before moving them" |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2249 (if (stringp state) "check in" "update")))) |
dd6110a63907
New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50894
diff
changeset
|
2250 (vc-call rename-file old new) |
50894
4dc2d45403ec
(with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49869
diff
changeset
|
2251 (vc-file-clearprops old) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2252 ;; Move the actual file (unless the backend did it already) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2253 (when (file-exists-p old) (rename-file old new)) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2254 ;; ?? Renaming a file might change its contents due to keyword expansion. |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2255 ;; We should really check out a new copy if the old copy was precisely equal |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2256 ;; to some checked-in revision. However, testing for this is tricky.... |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2257 (when oldbuf |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2258 (with-current-buffer oldbuf |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2259 (let ((buffer-read-only buffer-read-only)) |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2260 (set-visited-file-name new)) |
103553
af4ee0cb7fb7
* vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103434
diff
changeset
|
2261 (vc-mode-line new (vc-backend new)) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2262 (set-buffer-modified-p nil))))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2263 |
927 | 2264 ;;;###autoload |
1226
573df03a54d8
(vc-update-change-log): Use shell-command, not shell-command-on-region.
Roland McGrath <roland@gnu.org>
parents:
952
diff
changeset
|
2265 (defun vc-update-change-log (&rest args) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2266 "Find change log file and add entries from recent version control logs. |
15989
2813c68432c9
(vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
15977
diff
changeset
|
2267 Normally, find log entries for all registered files in the default |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2268 directory. |
15989
2813c68432c9
(vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
15977
diff
changeset
|
2269 |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
2270 With prefix arg of \\[universal-argument], only find log entries for the current buffer's file. |
15989
2813c68432c9
(vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
15977
diff
changeset
|
2271 |
2813c68432c9
(vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
15977
diff
changeset
|
2272 With any numeric prefix arg, find log entries for all currently visited |
2813c68432c9
(vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
15977
diff
changeset
|
2273 files that are under version control. This puts all the entries in the |
2813c68432c9
(vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
15977
diff
changeset
|
2274 log for the default directory, which may not be appropriate. |
2813c68432c9
(vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
15977
diff
changeset
|
2275 |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31387
diff
changeset
|
2276 From a program, any ARGS are assumed to be filenames for which |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2277 log entries should be gathered." |
1227
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2278 (interactive |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2279 (cond ((consp current-prefix-arg) ;C-u |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2280 (list buffer-file-name)) |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2281 (current-prefix-arg ;Numeric argument. |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2282 (let ((files nil) |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2283 (buffers (buffer-list)) |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2284 file) |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2285 (while buffers |
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2286 (setq file (buffer-file-name (car buffers))) |
11605
36b1eb58d0c9
(vc-next-action-on-file): Add missing let-binding.
Karl Heuer <kwzh@gnu.org>
parents:
11597
diff
changeset
|
2287 (and file (vc-backend file) |
3939
1b954eb0f249
(vc-update-change-log): Ensure that file names inserted into a ChangeLog
Paul Eggert <eggert@twinsun.com>
parents:
3905
diff
changeset
|
2288 (setq files (cons file files))) |
1227
d07030650283
(vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents:
1226
diff
changeset
|
2289 (setq buffers (cdr buffers))) |
3939
1b954eb0f249
(vc-update-change-log): Ensure that file names inserted into a ChangeLog
Paul Eggert <eggert@twinsun.com>
parents:
3905
diff
changeset
|
2290 files)) |
1b954eb0f249
(vc-update-change-log): Ensure that file names inserted into a ChangeLog
Paul Eggert <eggert@twinsun.com>
parents:
3905
diff
changeset
|
2291 (t |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2292 ;; Don't supply any filenames to backend; this means |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2293 ;; it should find all relevant files relative to |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2294 ;; the default-directory. |
15977
abc3b3e7ea88
(vc-update-change-log): Remove code which found RCS files
Richard M. Stallman <rms@gnu.org>
parents:
15787
diff
changeset
|
2295 nil))) |
31380
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2296 (vc-call-backend (vc-responsible-backend default-directory) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2297 'update-changelog args)) |
2d74ed749db8
(vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents:
28460
diff
changeset
|
2298 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2299 ;; functions that operate on RCS revision numbers. This code should |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2300 ;; also be moved into the backends. It stays for now, however, since |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2301 ;; it is used in code below. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2302 (defun vc-branch-p (rev) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2303 "Return t if REV is a branch revision." |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2304 (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev)))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2305 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2306 ;;;###autoload |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2307 (defun vc-branch-part (rev) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2308 "Return the branch part of a revision number REV." |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2309 (let ((index (string-match "\\.[0-9]+\\'" rev))) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2310 (when index |
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2311 (substring rev 0 index)))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2312 |
97936
c2f756ba4557
(vc-default-previous-version): Move alias here from vc-hooks, and fix
Glenn Morris <rgm@gnu.org>
parents:
97245
diff
changeset
|
2313 (define-obsolete-function-alias |
c2f756ba4557
(vc-default-previous-version): Move alias here from vc-hooks, and fix
Glenn Morris <rgm@gnu.org>
parents:
97245
diff
changeset
|
2314 'vc-default-previous-version 'vc-default-previous-revision "23.1") |
c2f756ba4557
(vc-default-previous-version): Move alias here from vc-hooks, and fix
Glenn Morris <rgm@gnu.org>
parents:
97245
diff
changeset
|
2315 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2316 (defun vc-default-responsible-p (backend file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2317 "Indicate whether BACKEND is reponsible for FILE. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2318 The default is to return nil always." |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2319 nil) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2320 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2321 (defun vc-default-could-register (backend file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2322 "Return non-nil if BACKEND could be used to register FILE. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2323 The default implementation returns t for all files." |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2324 t) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2325 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2326 (defun vc-default-latest-on-branch-p (backend file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2327 "Return non-nil if FILE is the latest on its branch. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2328 This default implementation always returns non-nil, which means that |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2329 editing non-current revisions is not supported by default." |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2330 t) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2331 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2332 (defun vc-default-init-revision (backend) vc-default-init-revision) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2333 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2334 (defun vc-default-find-revision (backend file rev buffer) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2335 "Provide the new `find-revision' op based on the old `checkout' op. |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2336 This is only for compatibility with old backends. They should be updated |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2337 to provide the `find-revision' operation instead." |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2338 (let ((tmpfile (make-temp-file (expand-file-name file)))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2339 (unwind-protect |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2340 (progn |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2341 (vc-call-backend backend 'checkout file nil rev tmpfile) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2342 (with-current-buffer buffer |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2343 (insert-file-contents-literally tmpfile))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2344 (delete-file tmpfile)))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2345 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2346 (defun vc-default-rename-file (backend old new) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2347 (condition-case nil |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2348 (add-name-to-file old new) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2349 (error (rename-file old new))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2350 (vc-delete-file old) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2351 (with-current-buffer (find-file-noselect new) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2352 (vc-register))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2353 |
85364
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
2354 (defalias 'vc-default-check-headers 'ignore) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2355 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2356 (defun vc-default-log-view-mode (backend) (log-view-mode)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2357 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2358 (defun vc-default-show-log-entry (backend rev) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2359 (with-no-warnings |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2360 (log-view-goto-rev rev))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2361 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2362 (defun vc-default-comment-history (backend file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2363 "Return a string with all log entries stored in BACKEND for FILE." |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
2364 (when (vc-find-backend-function backend 'print-log) |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
2365 (with-current-buffer "*vc*" |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2366 (vc-call-backend backend 'print-log (list file)) |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93934
diff
changeset
|
2367 (buffer-string)))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2368 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2369 (defun vc-default-receive-file (backend file rev) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2370 "Let BACKEND receive FILE from another version control system." |
102554
ac34b8fe4921
(vc-default-receive-file): The 'register method now
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100908
diff
changeset
|
2371 (vc-call-backend backend 'register (list file) rev "")) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2372 |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
2373 (defun vc-default-retrieve-tag (backend dir name update) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2374 (if (string= name "") |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2375 (progn |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2376 (vc-file-tree-walk |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2377 dir |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2378 (lambda (f) (and |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2379 (vc-up-to-date-p f) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2380 (vc-error-occurred |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2381 (vc-call-backend backend 'checkout f nil "") |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2382 (when update (vc-resynch-buffer f t t))))))) |
95020
4da572dc4992
Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
95018
diff
changeset
|
2383 (let ((result (vc-tag-precondition dir))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2384 (if (stringp result) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2385 (error "File %s is locked" result) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2386 (setq update (and (eq result 'visited) update)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2387 (vc-file-tree-walk |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2388 dir |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2389 (lambda (f) (vc-error-occurred |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2390 (vc-call-backend backend 'checkout f nil name) |
94207
2aa6d908ffad
* vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94173
diff
changeset
|
2391 (when update (vc-resynch-buffer f t t))))))))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2392 |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2393 (defun vc-default-revert (backend file contents-done) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2394 (unless contents-done |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85132
diff
changeset
|
2395 (let ((rev (vc-working-revision file)) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2396 (file-buffer (or (get-file-buffer file) (current-buffer)))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2397 (message "Checking out %s..." file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2398 (let ((failed t) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2399 (backup-name (car (find-backup-file-name file)))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2400 (when backup-name |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2401 (copy-file file backup-name 'ok-if-already-exists 'keep-date) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2402 (unless (file-writable-p file) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2403 (set-file-modes file (logior (file-modes file) 128)))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2404 (unwind-protect |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2405 (let ((coding-system-for-read 'no-conversion) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2406 (coding-system-for-write 'no-conversion)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2407 (with-temp-file file |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2408 (let ((outbuf (current-buffer))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2409 ;; Change buffer to get local value of vc-checkout-switches. |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2410 (with-current-buffer file-buffer |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2411 (let ((default-directory (file-name-directory file))) |
94805
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2412 (vc-call-backend backend 'find-revision |
89d37b54b964
* vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
94803
diff
changeset
|
2413 file rev outbuf))))) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2414 (setq failed nil)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2415 (when backup-name |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2416 (if failed |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2417 (rename-file backup-name file 'ok-if-already-exists) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2418 (and (not vc-make-backup-files) (delete-file backup-name)))))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2419 (message "Checking out %s...done" file)))) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2420 |
85364
f8d1bb788744
(vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85178
diff
changeset
|
2421 (defalias 'vc-default-revision-completion-table 'ignore) |
98336
26ff192a882a
(vc-mark-resolved): Move message here from vc-default-mark-resolved.
Chong Yidong <cyd@stupidchicken.com>
parents:
98326
diff
changeset
|
2422 (defalias 'vc-default-mark-resolved 'ignore) |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2423 |
94059
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
2424 (defun vc-default-dir-status-files (backend dir files default-state update-function) |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
2425 (funcall update-function |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
2426 (mapcar (lambda (file) (list file default-state)) files))) |
c249cf124bd6
(vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents:
94003
diff
changeset
|
2427 |
85042
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2428 (defun vc-check-headers () |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2429 "Check if the current file has any headers in it." |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2430 (interactive) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2431 (vc-call-backend (vc-backend buffer-file-name) 'check-headers)) |
2fe89ebca6d3
Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84586
diff
changeset
|
2432 |
18174
238e30645d07
(diff-switches): defvar deleted.
Richard M. Stallman <rms@gnu.org>
parents:
17911
diff
changeset
|
2433 |
904 | 2434 |
94573
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2435 ;; These things should probably be generally available |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2436 |
96390
02d657f45045
* vc-dir.el (vc-dir-hide-up-to-date): Also hide empty directories.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96310
diff
changeset
|
2437 (defun vc-string-prefix-p (prefix string) |
02d657f45045
* vc-dir.el (vc-dir-hide-up-to-date): Also hide empty directories.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96310
diff
changeset
|
2438 (let ((lpref (length prefix))) |
02d657f45045
* vc-dir.el (vc-dir-hide-up-to-date): Also hide empty directories.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96310
diff
changeset
|
2439 (and (>= (length string) lpref) |
02d657f45045
* vc-dir.el (vc-dir-hide-up-to-date): Also hide empty directories.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96310
diff
changeset
|
2440 (eq t (compare-strings prefix nil nil string nil lpref))))) |
02d657f45045
* vc-dir.el (vc-dir-hide-up-to-date): Also hide empty directories.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96310
diff
changeset
|
2441 |
94573
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2442 (defun vc-file-tree-walk (dirname func &rest args) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2443 "Walk recursively through DIRNAME. |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2444 Invoke FUNC f ARGS on each VC-managed file f underneath it." |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2445 (vc-file-tree-walk-internal (expand-file-name dirname) func args) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2446 (message "Traversing directory %s...done" dirname)) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2447 |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2448 (defun vc-file-tree-walk-internal (file func args) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2449 (if (not (file-directory-p file)) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2450 (when (vc-backend file) (apply func file args)) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2451 (message "Traversing directory %s..." (abbreviate-file-name file)) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2452 (let ((dir (file-name-as-directory file))) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2453 (mapcar |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2454 (lambda (f) (or |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2455 (string-equal f ".") |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2456 (string-equal f "..") |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2457 (member f vc-directory-exclusion-list) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2458 (let ((dirf (expand-file-name f dir))) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2459 (or |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2460 (file-symlink-p dirf) ;; Avoid possible loops. |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2461 (vc-file-tree-walk-internal dirf func args))))) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2462 (directory-files dir))))) |
ce09c5078ae7
Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94572
diff
changeset
|
2463 |
904 | 2464 (provide 'vc) |
2465 | |
56952
1e43327f7457
(vc-buffer-context, vc-restore-buffer-context): Disable obsolete code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
55100
diff
changeset
|
2466 ;; arch-tag: ca82c1de-3091-4e26-af92-460abc6213a6 |
904 | 2467 ;;; vc.el ends here |