annotate lisp/vc.el @ 107736:1f5000fd5ff7

Remove all uses of LIBX11_SYSTEM. * Makefile.in (LIBX11_SYSTEM): Remove. * s/msdos.h (LIBX11_SYSTEM): Do not define, define LIBS_SYSTEM instead. * configure.in: Remove all references to LIBX11_SYSTEM.
author Dan Nicolaescu <dann@ics.uci.edu>
date Thu, 01 Apr 2010 16:08:14 -0700
parents 6db4a0b4404d
children c4daeb1eaaf1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106472
diff changeset
4 ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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
abd085bfec0c Add Keywords header.
Gerd Moellmann <gerd@gnu.org>
parents: 39000
diff changeset
9 ;; Keywords: tools
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
10
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
17
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
21 ;; GNU General Public License for more details.
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
22
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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
3a5e5c74d3bb fix my email
Dave Love <fx@gnu.org>
parents: 32888
diff changeset
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
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
53 ;;; Commentary:
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
66 ;; The vc code maintains some internal state in order to reduce expensive
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
69 ;; vc's back is turned, or move/rename master files while vc is running,
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
70 ;; vc may get seriously confused. Don't do these things!
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
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 ;;
107430
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
264 ;; * checkin (files rev comment &optional extra-args)
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.)
107430
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
272 ;; EXTRA-ARGS should be passed to the backend command.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
273 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
274 ;; * 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
275 ;;
cf312195338d (vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47781
diff changeset
276 ;; 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
277 ;; 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
278 ;; 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
279 ;; 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
280 ;;
cf312195338d (vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47781
diff changeset
281 ;; * checkout (file &optional editable rev)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
282 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
283 ;; 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
284 ;; 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
285 ;; 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
286 ;; 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
287 ;; 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
288 ;; 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
289 ;; 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
290 ;; to the backend command.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
291 ;;
39000
60cf6aee9fd1 (vc-revert-file): Call the backend even if the FILE's
André Spiegel <spiegel@gnu.org>
parents: 38726
diff changeset
292 ;; * revert (file &optional contents-done)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
293 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
294 ;; 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
295 ;; 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
296 ;; 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
297 ;; 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
298 ;; 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
299 ;; `unregistered' state.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
300 ;;
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
301 ;; - rollback (files)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
302 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
303 ;; 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
304 ;; 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
305 ;; 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
306 ;; 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
307 ;; '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
308 ;; files.)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
309 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
310 ;; - merge (file rev1 rev2)
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
311 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
312 ;; 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
313 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
314 ;; - merge-news (file)
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
315 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
316 ;; Merge recent changes from the current branch into FILE.
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
317 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
318 ;; - steal-lock (file &optional revision)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
319 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
320 ;; 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
321 ;; 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
322 ;; 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
323 ;; locked by other users.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
324 ;;
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
325 ;; - 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
326 ;;
87596
0f01cefc5aa8 Fix typo in comment. Reported by Tom Tromey <tromey@redhat.com>.
Juanma Barranquero <lekktu@gmail.com>
parents: 87590
diff changeset
327 ;; 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
328 ;; 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
329 ;;
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
330 ;; - mark-resolved (files)
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
331 ;;
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
332 ;; 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
333 ;; 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
334 ;;
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
335 ;; HISTORY FUNCTIONS
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
336 ;;
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
337 ;; * print-log (files buffer &optional shortlog start-revision limit)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
338 ;;
106033
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
339 ;; Insert the revision log for FILES into BUFFER.
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
340 ;; If SHORTLOG is true insert a short version of the log.
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
341 ;; If LIMIT is true insert only insert LIMIT log entries. If the
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
342 ;; backend does not support limiting the number of entries to show
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
343 ;; it should return `limit-unsupported'.
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
344 ;; If START-REVISION is given, then show the log starting from the
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
345 ;; revision. At this point START-REVISION is only required to work
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
346 ;; in conjunction with LIMIT = 1.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
347 ;;
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
348 ;; - 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
349 ;;
a861d80cf88c * log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
Dan Nicolaescu <dann@ics.uci.edu>
parents: 75347
diff changeset
350 ;; 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
351 ;; `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
352 ;; 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
353 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
354 ;; - show-log-entry (revision)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
355 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
356 ;; 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
357 ;; 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
358 ;; implementation of this function works for RCS-style logs.
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
359 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
360 ;; - comment-history (file)
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
361 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
362 ;; 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
363 ;; 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
364 ;; retaining comment information.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
365 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
366 ;; - update-changelog (files)
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
367 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
368 ;; 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
369 ;; 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
370 ;; default implementation runs rcs2log, which handles RCS- and
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
371 ;; CVS-style logs.
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
372 ;;
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
373 ;; * diff (files &optional rev1 rev2 buffer)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
374 ;;
54463
4598019c5c85 Add new optional BUFFER argument to vc-BACKEND-print-log and
André Spiegel <spiegel@gnu.org>
parents: 54398
diff changeset
375 ;; 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
376 ;; 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
377 ;; 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
378 ;; 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
379 ;; 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
380 ;; 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
381 ;; 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
382 ;; 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
383 ;; run asynchronously).
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
384 ;;
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
385 ;; - 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
386 ;;
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
387 ;; 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
388 ;; 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
389 ;;
58321
f398ebfc07e2 Update annotation-related comments.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57906
diff changeset
390 ;; - annotate-command (file buf &optional rev)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
391 ;;
58321
f398ebfc07e2 Update annotation-related comments.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 57906
diff changeset
392 ;; 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
393 ;; 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
394 ;; 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
395 ;; 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
396 ;; file is fontified according to age.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
397 ;;
40170
115527dd1d27 Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40164
diff changeset
398 ;; - annotate-time ()
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
399 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
400 ;; 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
401 ;; 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
402 ;; 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
403 ;; 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
404 ;; multi-part times as returned by `current-time' and `encode-time'
42205
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 41561
diff changeset
405 ;; 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
406 ;; 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
407 ;; 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
408 ;; 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
409 ;; 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
410 ;; 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
411 ;;
115527dd1d27 Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40164
diff changeset
412 ;; - annotate-current-time ()
115527dd1d27 Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40164
diff changeset
413 ;;
115527dd1d27 Change scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents: 40164
diff changeset
414 ;; 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
415 ;; 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
416 ;; (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
417 ;; 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
418 ;; 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
419 ;;
53630
2f41b6c48585 * vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents: 53283
diff changeset
420 ;; - annotate-extract-revision-at-line ()
2f41b6c48585 * vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents: 53283
diff changeset
421 ;;
2f41b6c48585 * vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents: 53283
diff changeset
422 ;; 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
423 ;; 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
424 ;; 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
425 ;; corresponding to the current line.
105670
6f463ea7a91a Make vc-annotate work through copies and renames.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105591
diff changeset
426 ;; If the backend supports annotating through copies and renames,
6f463ea7a91a Make vc-annotate work through copies and renames.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105591
diff changeset
427 ;; and displays a file name and a revision, then return a cons
6f463ea7a91a Make vc-annotate work through copies and renames.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105591
diff changeset
428 ;; (REVISION . FILENAME).
53630
2f41b6c48585 * vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents: 53283
diff changeset
429 ;;
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
430 ;; TAG SYSTEM
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
431 ;;
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
432 ;; - create-tag (dir name branchp)
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 ;; 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
435 ;; 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
436 ;; 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
437 ;; 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
438 ;; 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
439 ;; 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
440 ;; assigns the tag to each file.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
441 ;;
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
442 ;; - retrieve-tag (dir name update)
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
443 ;;
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
444 ;; 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
445 ;; 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
446 ;; tag that are currently visited. The default implementation
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
447 ;; 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
448 ;; 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
449 ;; function to retrieve the corresponding revisions.
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
450 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
451 ;; MISCELLANEOUS
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
452 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
453 ;; - make-version-backups-p (file)
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
454 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
455 ;; 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
456 ;; 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
457 ;; `revert' operations itself, without calling the backend system. The
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
458 ;; default implementation always returns nil.
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
459 ;;
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
460 ;; - root (file)
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
461 ;; 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
462 ;;
50926
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
463 ;; - repository-hostname (dirname)
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
464 ;;
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
465 ;; 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
466 ;; 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
467 ;; 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
468 ;; 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
469 ;; for their convenience.
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
470 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
471 ;; - previous-revision (file rev)
42548
1cf3624d80ac (vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents: 42205
diff changeset
472 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
473 ;; 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
474 ;; revision exists.
53630
2f41b6c48585 * vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents: 53283
diff changeset
475 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
476 ;; - next-revision (file rev)
53630
2f41b6c48585 * vc.el (vc-default-previous-version): Doc enhancement.
André Spiegel <spiegel@gnu.org>
parents: 53283
diff changeset
477 ;;
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
478 ;; 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
479 ;; revision exists.
42548
1cf3624d80ac (vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents: 42205
diff changeset
480 ;;
107430
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
481 ;; - log-edit-mode ()
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
482 ;;
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
483 ;; Turn on the mode used for editing the check in log. This
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
484 ;; defaults to `log-edit-mode'. If changed, it should use a mode
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
485 ;; derived from`log-edit-mode'.
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
486 ;;
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
487 ;; - check-headers ()
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
488 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
489 ;; 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
490 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
491 ;; - clear-headers ()
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
492 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
493 ;; 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
494 ;; 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
495 ;; 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
496 ;; 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
497 ;; 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
498 ;; wrong information.
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
499 ;;
50926
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
500 ;; - delete-file (file)
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
501 ;;
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
502 ;; 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
503 ;; 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
504 ;; signal an error.
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
505 ;;
35199
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
506 ;; - rename-file (old new)
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
507 ;;
aa38d1de35cb Added documentation for backend interface.
André Spiegel <spiegel@gnu.org>
parents: 35131
diff changeset
508 ;; 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
509 ;; 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
510 ;; 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
511 ;;
54398
2decd50569f3 Document new find-file-hook operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53874
diff changeset
512 ;; - find-file-hook ()
2decd50569f3 Document new find-file-hook operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53874
diff changeset
513 ;;
54530
b217df9a35e0 Document new backend operation `find-file-not-found-hook'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54463
diff changeset
514 ;; 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
515 ;; 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
516 ;;
78822
1926a08e8926 * vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78599
diff changeset
517 ;; - 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
518 ;;
1926a08e8926 * vc-arch.el (vc-arch-extra-menu-map): New var and fun.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78599
diff changeset
519 ;; 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
520 ;; 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
521 ;; 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
522 ;; 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
523 ;; 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
524 ;; 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
525 ;;
99159
b0dce7f34dda * vc.el: Rename VC methods that were missed when vc-status was
Dan Nicolaescu <dann@ics.uci.edu>
parents: 98388
diff changeset
526 ;; - 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
527 ;;
92122
74bf6df13b6c * vc.el (vc-find-revision): Make vc-parent-buffer local before
Dan Nicolaescu <dann@ics.uci.edu>
parents: 92093
diff changeset
528 ;; 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
529 ;; 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
530 ;; 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
531 ;; 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
532 ;; 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
533 ;; generic concepts.
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
534
87743
c2a952d12e21 * smerge-mode.el (smerge-auto): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87739
diff changeset
535 ;;; Todo:
c2a952d12e21 * smerge-mode.el (smerge-auto): New function.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87739
diff changeset
536
96046
422d57d537d7 (vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95966
diff changeset
537 ;; - 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
538
95269
1e9eb6106f5a (vc-delete-file): Don't try to resynch the buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95079
diff changeset
539 ;; - 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
540
94861
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
541 ;;;; New Primitives:
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
542 ;;
93362
ca726aff3769 Reshuffle TODOs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93346
diff changeset
543 ;; - deal with push/pull operations.
ca726aff3769 Reshuffle TODOs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93346
diff changeset
544 ;;
94861
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
545 ;; - 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
546 ;; to be ignored, when that's possible.
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
547 ;;
94883
b615f9b9d57e Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94882
diff changeset
548 ;;;; Primitives that need changing:
b615f9b9d57e Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94882
diff changeset
549 ;;
b615f9b9d57e Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94882
diff changeset
550 ;; - 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
551 ;; 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
552 ;; 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
553 ;; 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
554 ;; is updated after these operations.
94883
b615f9b9d57e Re-add Todo item about merging.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94882
diff changeset
555 ;; 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
556 ;;
94861
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
557 ;;;; Improved branch and tag handling:
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 ;; - 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
560 ;; 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
561 ;; vc-cvs-sticky-tag with that.
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
562 ;;
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
563 ;; - 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
564 ;; buffers that might be visiting the affected files.
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
565 ;;
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
566 ;;;; Internal cleanups:
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
567 ;;
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
568 ;; - 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
569 ;; 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
570 ;;
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
571 ;; - 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
572 ;; files managed by that backend.
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
573 ;;
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
574 ;; - 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
575 ;; 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
576 ;; 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
577 ;; (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
578 ;; (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
579 ;; 4 operations in term of this one.
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
580 ;;
142a56989604 Reorganize to-do list.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94857
diff changeset
581 ;;;; Other
93362
ca726aff3769 Reshuffle TODOs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93346
diff changeset
582 ;;
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
583 ;; - 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
584 ;;
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
585 ;; - 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
586 ;; 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
587 ;; 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
588 ;; 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
589 ;; 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
590 ;;
93362
ca726aff3769 Reshuffle TODOs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93346
diff changeset
591 ;; - make it easier to write logs. Maybe C-x 4 a should add to the log
ca726aff3769 Reshuffle TODOs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93346
diff changeset
592 ;; 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
593 ;;
94488
d3100c0eddb7 (vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94481
diff changeset
594 ;; - 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
595 ;; *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
596 ;; 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
597 ;; 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
598 ;; `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
599 ;; skeleton for the log...
d3100c0eddb7 (vc-deduce-fileset): Add new parameter.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94481
diff changeset
600 ;;
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
601 ;; - 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
602 ;; 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
603 ;; possible VC states.
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
604 ;;
94836
3cb546529dde Update todo.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94822
diff changeset
605 ;; - 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
606 ;;
92091
f6aa0a65fa82 (vc-exec-after): Move setting mode-line-process in the
Dan Nicolaescu <dann@ics.uci.edu>
parents: 92038
diff changeset
607 ;; - 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
608 ;; 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
609 ;; 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
610 ;; 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
611 ;;
96215
ad9760e68890 (Todo): Update.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96203
diff changeset
612 ;; - vc-next-action needs work in order to work with multiple
ad9760e68890 (Todo): Update.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96203
diff changeset
613 ;; backends: `vc-state' returns the state for the default backend,
ad9760e68890 (Todo): Update.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96203
diff changeset
614 ;; 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
615 ;;
96203
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
616 ;; - vc-dir-kill-dir-status-process should not be specific to dir-status,
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
617 ;; it should work for other async commands done through vc-do-command
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
618 ;; as well,
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
619 ;;
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
620 ;; - vc-dir toolbar needs more icons.
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
621 ;;
96886
3b7098612be6 (Todo): Update.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96390
diff changeset
622 ;; - The backends should avoid using `vc-file-setprop' and `vc-file-getprop'.
3b7098612be6 (Todo): Update.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96390
diff changeset
623 ;;
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
624 ;;; Code:
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
625
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
626 (require 'vc-hooks)
94571
61cca370b8f5 vc-dispatcher layer separation.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94570
diff changeset
627 (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
628
94573
ce09c5078ae7 Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94572
diff changeset
629 (eval-when-compile
106159
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
630 (require 'cl)
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
631 (require 'dired))
94573
ce09c5078ae7 Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94572
diff changeset
632
94207
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
633 (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
634 (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
635 (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
636 minor-mode-alist)))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
637
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
638 ;; General customization
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
639
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
640 (defgroup vc nil
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
641 "Version-control system in Emacs."
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
642 :group 'tools)
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
643
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
644 (defcustom vc-initial-comment nil
67755
0cdb122ad4db Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67578
diff changeset
645 "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
646 :type 'boolean
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
647 :group 'vc)
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
648
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
649 (defcustom vc-default-init-revision "1.1"
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
650 "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
651 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
652 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
653 :type 'string
21669
9861518505cb *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21560
diff changeset
654 :group 'vc
9861518505cb *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21560
diff changeset
655 :version "20.3")
20988
9a6179e6eff6 (vc-default-init-version): New variable.
André Spiegel <spiegel@gnu.org>
parents: 20977
diff changeset
656
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
657 (defcustom vc-checkin-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 checkin.
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
659 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
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-checkout-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 specifying extra switches for checkout.
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
669 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
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
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
677 (defcustom vc-register-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; extra switches for registering a file.
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
679 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
680 :type '(choice (const :tag "None" nil)
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
681 (string :tag "Argument String")
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
682 (repeat :tag "Argument List"
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
683 :value ("")
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
684 string))
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
685 :group 'vc)
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
686
35820
3cfa6e077b83 (vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 35199
diff changeset
687 (defcustom vc-diff-switches nil
67755
0cdb122ad4db Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67578
diff changeset
688 "A string or list of strings specifying switches for diff under VC.
100187
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
689 When running diff under a given BACKEND, VC uses the first
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
690 non-nil value of `vc-BACKEND-diff-switches', `vc-diff-switches',
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
691 and `diff-switches', in that order. Since nil means to check the
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
692 next variable in the sequence, either of the first two may use
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
693 the value t to mean no switches at all. `vc-diff-switches'
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
694 should contain switches that are specific to version control, but
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
695 not specific to any particular backend."
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
696 :type '(choice (const :tag "Unspecified" nil)
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
697 (const :tag "None" t)
35820
3cfa6e077b83 (vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 35199
diff changeset
698 (string :tag "Argument String")
100187
e518f14b0bda (vc-diff-switches): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 100171
diff changeset
699 (repeat :tag "Argument List" :value ("") string))
35820
3cfa6e077b83 (vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 35199
diff changeset
700 :group 'vc
3cfa6e077b83 (vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 35199
diff changeset
701 :version "21.1")
3cfa6e077b83 (vc-diff-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents: 35199
diff changeset
702
71446
b0324f716b87 (vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents: 71228
diff changeset
703 (defcustom vc-diff-knows-L nil
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99262
diff changeset
704 "Indicates whether diff understands the -L option.
71446
b0324f716b87 (vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents: 71228
diff changeset
705 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
706 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
707 :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
708 :group 'vc)
b0324f716b87 (vc-diff-knows-L): New variable.
André Spiegel <spiegel@gnu.org>
parents: 71228
diff changeset
709
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
710 (defcustom vc-log-show-limit 2000
106033
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
711 "Limit the number of items shown by the VC log commands.
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
712 Zero means unlimited.
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
713 Not all VC backends are able to support this feature."
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
714 :type 'integer
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
715 :group 'vc)
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
716
59442
37d47d9bf8b1 (vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents: 59011
diff changeset
717 (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
718 "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
719 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
720 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
721 :type '(choice (const :tag "No" nil)
37d47d9bf8b1 (vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents: 59011
diff changeset
722 (const :tag "Yes" t))
37d47d9bf8b1 (vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents: 59011
diff changeset
723 :group 'vc
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59442
diff changeset
724 :version "22.1")
59442
37d47d9bf8b1 (vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents: 59011
diff changeset
725
31380
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
726 ;;;###autoload
38606
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
727 (defcustom vc-checkout-hook nil
67755
0cdb122ad4db Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67578
diff changeset
728 "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
729 See `run-hooks'."
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
730 :type 'hook
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
731 :group 'vc
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
732 :version "21.1")
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
733
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
734 ;;;###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
735 (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
736 "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
737 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
738 :type 'hook
51369
91b1fb194872 (vc-directory-exclusion-list): Add MCVS and .svn.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 51245
diff changeset
739 :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
740 :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
741
31380
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
742 ;;;###autoload
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
743 (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
744 "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
745 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
746 :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
747 :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
748
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
749 ;; Header-insertion hair
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
750
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
751 (defcustom vc-static-header-alist
67755
0cdb122ad4db Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67578
diff changeset
752 '(("\\.c\\'" .
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
753 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n#endif /* lint */\n"))
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99262
diff changeset
754 "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
755 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
756 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
757 :type '(repeat (cons :format "%v"
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
758 (regexp :tag "File Type")
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
759 (string :tag "Header String")))
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
760 :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
761
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
762 (defcustom vc-comment-alist
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
763 '((nroff-mode ".\\\"" ""))
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99262
diff changeset
764 "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
765 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
766 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
767 is sensitive to blank lines."
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
768 :type '(repeat (list :format "%v"
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
769 (symbol :tag "Mode")
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
770 (string :tag "Comment Start")
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
771 (string :tag "Comment End")))
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
772 :group 'vc)
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
773
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
774 (defcustom vc-checkout-carefully (= (user-uid) 0)
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99262
diff changeset
775 "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
776 Verify that the file really is not locked
17672
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
777 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
778 :type 'boolean
3e14521699ff Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17410
diff changeset
779 :group 'vc)
49619
b48f8839a782 (vc-annotate-display, vc-checkout-carefully): Add obsolescence declaration and
Juanma Barranquero <lekktu@gmail.com>
parents: 49597
diff changeset
780 (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
781 "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
782 "21.1")
5201
b27badfb4040 (vc-buffer-sync): Signal error if user says no.
Richard M. Stallman <rms@gnu.org>
parents: 5015
diff changeset
783
31380
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
784
94576
7de38dedf0a6 Move the command-closure machinery to vc-dispatcher.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94573
diff changeset
785 ;; Variables users don't need to see
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
786
59442
37d47d9bf8b1 (vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents: 59011
diff changeset
787 (defvar vc-disable-async-diff nil
37d47d9bf8b1 (vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents: 59011
diff changeset
788 "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
789 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
790 in their implementation of vc-BACKEND-diff.")
37d47d9bf8b1 (vc-allow-async-revert): New user option.
André Spiegel <spiegel@gnu.org>
parents: 59011
diff changeset
791
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
792 ;; File property caching
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
793
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
794 (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
795 "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
796 (interactive)
51064
f2383fb5260e (vc-log-mode-map, vc-maximum-comment-ring-size)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50926
diff changeset
797 (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
798
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
799 (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
800 "Execute FORM, then maybe set per-file properties for FILES.
106888
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
801 If any of FILES is actually a directory, then do the same for all
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
802 buffers for files in that directory.
41071
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
803 SETTINGS is an association list of property/value pairs. After
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
804 executing FORM, set those properties from SETTINGS that have not yet
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
805 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
806 (declare (debug t))
106888
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
807 `(let ((vc-touched-properties (list t))
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
808 (flist nil))
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
809 (dolist (file ,files)
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
810 (if (file-directory-p file)
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
811 (dolist (buffer (buffer-list))
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
812 (let ((fname (buffer-file-name buffer)))
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
813 (when (and fname (vc-string-prefix-p file fname))
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
814 (push fname flist))))
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
815 (push file flist)))
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31387
diff changeset
816 ,form
106888
70822719735d (with-vc-properties): Deal with directory arguments. (Bug#5298)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106815
diff changeset
817 (dolist (file flist)
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
818 (dolist (setting ,settings)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
819 (let ((property (car setting)))
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
820 (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
821 (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
822 property (cdr setting))))))))
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31387
diff changeset
823
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
824 ;;; 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
825
105745
0a74e9b3065f (vc-backend-for-registration): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105730
diff changeset
826 (defun vc-backend-for-registration (file)
105730
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
827 "Return a backend that can be used for registering FILE.
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
828
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
829 If no backend declares itself responsible for FILE, then FILE
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
830 must not be in a version controlled directory, so try to create a
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
831 repository, prompting for the directory and the VC backend to
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
832 use."
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
833 (catch 'found
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
834 ;; First try: find a responsible backend, it must be a backend
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
835 ;; under which FILE is not yet registered.
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
836 (dolist (backend vc-handled-backends)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
837 (and (not (vc-call-backend backend 'registered file))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
838 (vc-call-backend backend 'responsible-p file)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
839 (throw 'found backend)))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
840 ;; no responsible backend
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
841 (let* ((possible-backends
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
842 (let (pos)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
843 (dolist (crt vc-handled-backends)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
844 (when (vc-find-backend-function crt 'create-repo)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
845 (push crt pos)))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
846 pos))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
847 (bk
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
848 (intern
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
849 ;; Read the VC backend from the user, only
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
850 ;; complete with the backends that have the
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
851 ;; 'create-repo method.
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
852 (completing-read
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
853 (format "%s is not in a version controlled directory.\nUse VC backend: " file)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
854 (mapcar 'symbol-name possible-backends) nil t)))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
855 (repo-dir
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
856 (let ((def-dir (file-name-directory file)))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
857 ;; read the directory where to create the
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
858 ;; repository, make sure it's a parent of
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
859 ;; file.
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
860 (read-file-name
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
861 (format "create %s repository in: " bk)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
862 default-directory def-dir t nil
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
863 (lambda (arg)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
864 (message "arg %s" arg)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
865 (and (file-directory-p arg)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
866 (vc-string-prefix-p (expand-file-name arg) def-dir)))))))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
867 (let ((default-directory repo-dir))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
868 (vc-call-backend bk 'create-repo))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
869 (throw 'found bk))))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
870
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
871 (defun vc-responsible-backend (file)
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
872 "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
873
105730
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
874 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
875 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
876 first backend in `vc-handled-backends' that declares itself
105730
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
877 responsible for FILE is returned."
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
878 (or (and (not (file-directory-p file)) (vc-backend file))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
879 (catch 'found
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
880 ;; 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
881 ;; 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
882 (dolist (backend vc-handled-backends)
105730
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
883 (and (vc-call-backend backend 'responsible-p file)
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
884 (throw 'found backend))))
414178e8f10d (vc-responsible-backend): Throw an error if not backend is
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105695
diff changeset
885 (error "No VC backend is responsible for %s" file)))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
886
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
887 (defun vc-expand-dirs (file-or-dir-list)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
888 "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
889 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
890 (let ((flattened '()))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
891 (dolist (node file-or-dir-list)
95322
54121bb9b5ad (Problems): Remove fixed issues.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95319
diff changeset
892 (when (file-directory-p node)
54121bb9b5ad (Problems): Remove fixed issues.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95319
diff changeset
893 (vc-file-tree-walk
54121bb9b5ad (Problems): Remove fixed issues.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95319
diff changeset
894 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
895 (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
896 (nreverse flattened)))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
897
96203
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
898 (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
899
96203
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
900 (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
901 (declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files))
96203
30bbe1648bcf * vc.el:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96202
diff changeset
902
96256
a56e02fe83fc * vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96215
diff changeset
903 (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
904 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
905 "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
906
96256
a56e02fe83fc * vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96215
diff changeset
907 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
908 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
909 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
910 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
911 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
912 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
913 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
914
a56e02fe83fc * vc-dir.el (vc-dir-marked-only-files-and-states): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96215
diff changeset
915 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
916 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
917 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
918 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
919 current buffer."
95326
23822423eb64 (vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95325
diff changeset
920 ;; 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
921 ;; 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
922 (let (backend)
23822423eb64 (vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95325
diff changeset
923 (cond
23822423eb64 (vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95325
diff changeset
924 ((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
925 (vc-dir-deduce-fileset state-model-only-files))
106159
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
926 ((derived-mode-p 'dired-mode)
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
927 (if observer
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
928 (vc-dired-deduce-fileset)
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
929 (error "State changing VC operations not supported in `dired-mode'")))
95326
23822423eb64 (vc-deduce-fileset): Replace implementation with one based on a
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95325
diff changeset
930 ((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
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 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
933 (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
934 (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
935 (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
936 (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
937 ((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
938 ;; FIXME: Why this test? --Stef
422d57d537d7 (vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95966
diff changeset
939 (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
940 (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
941 (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
942 (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
943 (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
944 (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
945 ((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
946 (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
947 ((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
948 (if state-model-only-files
105745
0a74e9b3065f (vc-backend-for-registration): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105730
diff changeset
949 (list (vc-backend-for-registration (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
950 (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
951 (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
952 (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
953 nil)
105745
0a74e9b3065f (vc-backend-for-registration): Rename from
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105730
diff changeset
954 (list (vc-backend-for-registration (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
955 (list buffer-file-name))))
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
956 (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
957
106159
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
958 (defun vc-dired-deduce-fileset ()
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
959 (let ((backend (vc-responsible-backend default-directory)))
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
960 (unless backend (error "Directory not under VC"))
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
961 (list backend
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
962 (dired-map-over-marks (dired-get-filename nil t) nil))))
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
963
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
964 (defun vc-ensure-vc-buffer ()
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
965 "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
966 (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
967 ((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
968 (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
969 (t
87337
bad7c1eb5392 (vc-ensure-vc-buffer): Avoid infinite looping when
Martin Rudalics <rudalics@gmx.at>
parents: 87319
diff changeset
970 (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
971 (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
972 ;; 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
973 ;; current buffer are the same buffer.
bad7c1eb5392 (vc-ensure-vc-buffer): Avoid infinite looping when
Martin Rudalics <rudalics@gmx.at>
parents: 87319
diff changeset
974 (not (eq vc-parent-buffer (current-buffer))))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
975 (set-buffer vc-parent-buffer))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
976 (if (not buffer-file-name)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
977 (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
978 (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
979 (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
980
94481
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
981 ;;; 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
982 ;; 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
983 ;; 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
984
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
985 (defsubst vc-editable-p (file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
986 "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
987 (let ((backend (vc-backend file)))
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
988 (and backend
94563
a0bb8ca25a33 Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94556
diff changeset
989 (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
990 (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
991
87477
b5060e79eb98 * vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87450
diff changeset
992 (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
993 "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
994 (or
b5060e79eb98 * vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 87450
diff changeset
995 (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
996 (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
997
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
998 ;; Here's the major entry point.
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
999
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1000 ;;;###autoload
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1001 (defun vc-next-action (verbose)
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1002 "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
1003 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
1004
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1005 For locking systems:
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1006 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
1007 control.
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1008 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
1009 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
1010 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
1011 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
1012 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
1013 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
1014 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
1015 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
1016 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
1017 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
1018 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
1019 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
1020
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1021 For merging systems:
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1022 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
1023 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
1024 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
1025 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
1026 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
1027 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
1028 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
1029 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
1030 merge in the changes into your working copy."
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1031 (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
1032 (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
1033 (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
1034 (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
1035 (fileset-only-files (nth 2 vc-fileset))
94878
112212c5e23c Comment.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94861
diff changeset
1036 ;; 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
1037 (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
1038 ;; 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
1039 ;; 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
1040 (model (nth 4 vc-fileset))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1041 revision)
94803
0c63a93bf877 (vc-deduce-fileset): Don't require the checkout-model and the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94796
diff changeset
1042
31380
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1043 ;; Do the right thing
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1044 (cond
94538
dc1cd59ce955 Better error message on missing files.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94536
diff changeset
1045 ((eq state 'missing)
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
1046 (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
1047 ((eq state 'ignored)
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
1048 (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
1049 ((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
1050 (vc-register nil vc-fileset))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1051 ;; 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
1052 ((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
1053 (cond
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1054 (verbose
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1055 ;; go to a different revision
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1056 (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
1057 (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
1058 (if (member
a4d2ede95fbd (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102576
diff changeset
1059 revision-downcase
a4d2ede95fbd (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102576
diff changeset
1060 (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
1061 (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
1062 (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
1063 (dolist (file files)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1064 (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
1065 ((not (eq model 'implicit))
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1066 ;; check the files out
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1067 (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
1068 (t
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1069 ;; do nothing
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1070 (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
1071 ;; 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
1072 ((vc-compatible-state state 'edited)
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1073 (let ((ready-for-commit files))
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1074 ;; 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
1075 (dolist (file files)
87826
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1076 (unless (file-writable-p file)
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1077 ;; Make the file+buffer read-write.
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1078 (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
1079 (error "Aborted"))
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1080 (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
1081 (let ((visited (get-file-buffer file)))
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1082 (when visited
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1083 (with-current-buffer visited
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1084 (toggle-read-only -1))))))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1085 ;; 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
1086 (save-excursion
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1087 (dolist (file files)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1088 (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
1089 ;; 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
1090 ;; 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
1091 (when (and (not (eq model 'implicit))
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1092 (vc-workfile-unchanged-p file)
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1093 ;; 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
1094 ;; 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
1095 ;; 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
1096 ;; finishing the log entry and committing.
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1097 (not (and visited (buffer-modified-p))))
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1098 (vc-revert-file file)
97245
855f5155ed05 (vc-next-action): Update list var correctly after delete.
Chong Yidong <cyd@stupidchicken.com>
parents: 96886
diff changeset
1099 (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
1100 ;; Remaining files need to be committed
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1101 (if (not ready-for-commit)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1102 (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
1103 (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
1104 (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
1105 (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
1106 (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
1107 (if (member
a4d2ede95fbd (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102576
diff changeset
1108 revision-downcase
a4d2ede95fbd (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102576
diff changeset
1109 (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
1110 vc-handled-backends))
a4d2ede95fbd (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102576
diff changeset
1111 (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
1112 (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
1113 (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
1114 ;; 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
1115 ((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
1116 ;; 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
1117 ;; 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
1118 ;; 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
1119 ;; 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
1120 ;; 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
1121 ;; 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
1122 ;; 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
1123 ;; 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
1124 ;; 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
1125 ;; 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
1126 ;; 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
1127 ;; 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
1128 (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
1129 (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
1130 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
1131 (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
1132 (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
1133 state)))
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
1134 ;; conflict
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
1135 ((eq state 'conflict)
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1136 ;; 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
1137 ;; 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
1138 ;; 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
1139 ;; 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
1140 ;; very rarely.
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1141 (vc-mark-resolved backend files))
94521
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94520
diff changeset
1142 ;; needs-update
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94520
diff changeset
1143 ((eq state 'needs-update)
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1144 (dolist (file files)
31565
de4e73d77734 (vc-dired-listing-switches): Fix :version.
Dave Love <fx@gnu.org>
parents: 31520
diff changeset
1145 (if (yes-or-no-p (format
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1146 "%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
1147 (file-name-nondirectory file)))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1148 (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
1149 (when (and (not (eq model 'implicit))
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1150 (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
1151 (vc-checkout file t)))))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1152 ;; needs-merge
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1153 ((eq state 'needs-merge)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1154 (dolist (file files)
87826
06bebff4deab Add a TODO note about vc-state.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87785
diff changeset
1155 (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
1156 "%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
1157 (file-name-nondirectory file)))
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1158 (vc-maybe-resolve-conflicts
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1159 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
1160
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1161 ;; unlocked-changes
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1162 ((eq state 'unlocked-changes)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1163 (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
1164 (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
1165 (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
1166 (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
1167 (vc-diff-internal nil
94778
b9687393def1 Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94729
diff changeset
1168 (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
1169 (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
1170 (goto-char (point-min))
32059
13e0fdf65e3c (with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 32058
diff changeset
1171 (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
1172 (insert
32059
13e0fdf65e3c (with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 32058
diff changeset
1173 (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
1174 (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
1175 (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
1176 "Claim lock retaining changes? ")))
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1177 (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
1178 (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
1179 ;; 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
1180 ;; 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
1181 (vc-clear-headers file)
50926
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
1182 (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
1183 (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
1184 (if (not (yes-or-no-p
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1185 "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
1186 (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
1187 (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
1188 (vc-checkout file t)))))
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94520
diff changeset
1189 ;; Unknown fileset state
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94520
diff changeset
1190 (t
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94520
diff changeset
1191 (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
1192
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
1193 (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
1194 "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
1195 (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
1196 (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
1197 (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
1198 (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
1199 (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
1200 "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
1201 (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
1202 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
1203 (vc-call-backend backend 'create-repo))
67755
0cdb122ad4db Remove unnecessary leading * in docstrings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67578
diff changeset
1204
104042
47d49939ab41 (vc-dir-move-to-goal-column): Declare.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104041
diff changeset
1205 (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
1206
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
1207 ;;;###autoload
95946
3a39d3ac157c (vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95896
diff changeset
1208 (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
1209 "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
1210 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
1211 Otherwise register the current file.
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1212 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
1213 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
1214
31520
f9d2d484e1e2 * vc-sccs.el (vc-sccs-register):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31435
diff changeset
1215 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
1216 `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
1217 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
1218 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
1219 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
1220 first backend that could register the file is used."
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1221 (interactive "P")
95946
3a39d3ac157c (vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95896
diff changeset
1222 (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
1223 (backend (car fileset-arg))
96046
422d57d537d7 (vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95966
diff changeset
1224 (files (nth 1 fileset-arg)))
422d57d537d7 (vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95966
diff changeset
1225 ;; 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
1226 ;; 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
1227 ;; many VCS allow that as well.
422d57d537d7 (vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95966
diff changeset
1228 (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
1229 (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
1230 (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
1231 (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
1232 (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
1233 (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
1234 (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
1235 (error "Aborted"))))
3a39d3ac157c (vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95896
diff changeset
1236 ;; 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
1237 ;; 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
1238 (when bname
3a39d3ac157c (vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95896
diff changeset
1239 (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
1240 (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
1241 (zerop (buffer-size))
3a39d3ac157c (vc-deduce-fileset): Check if the buffer has a file.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95896
diff changeset
1242 (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
1243 (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
1244 (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
1245 (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
1246 (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
1247 (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
1248 (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
1249 (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
1250 (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
1251 comment)
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 103434
diff changeset
1252 (mapc
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 103434
diff changeset
1253 (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
1254 (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
1255 ;; 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
1256 ;; 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
1257 ;; 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
1258 ;; (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
1259 ;; (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
1260 ;; (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
1261
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 103434
diff changeset
1262 (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
1263 files)
af4ee0cb7fb7 * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 103434
diff changeset
1264 (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
1265 (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
1266 (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
1267
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1268 (defun vc-register-with (backend)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1269 "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
1270 (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
1271 (when (not (member backend vc-handled-backends))
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
1272 (error "Unknown back end"))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1273 (let ((vc-handled-backends (list backend)))
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1274 (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
1275
11597
d6d53a54da18 (vc-backend-checkout): Pass vc-checkout-switches arg
Richard M. Stallman <rms@gnu.org>
parents: 11080
diff changeset
1276 (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
1277 "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
1278 If WRITABLE is non-nil, make sure the retrieved file is writable.
38608
cfe886db83f8 #Document prev change.
André Spiegel <spiegel@gnu.org>
parents: 38606
diff changeset
1279 REV defaults to the latest revision.
cfe886db83f8 #Document prev change.
André Spiegel <spiegel@gnu.org>
parents: 38606
diff changeset
1280
cfe886db83f8 #Document prev change.
André Spiegel <spiegel@gnu.org>
parents: 38606
diff changeset
1281 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
1282 (and writable
3aab429d3c8a (vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents: 32097
diff changeset
1283 (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
1284 (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
1285 (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
1286 (vc-make-version-backup file))
94481
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1287 (let ((backend (vc-backend file)))
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1288 (with-vc-properties (list file)
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1289 (condition-case err
94495
027a58c5f305 (vc-checkout): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94488
diff changeset
1290 (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
1291 (file-error
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1292 ;; Maybe the backend is not installed ;-(
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1293 (when writable
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1294 (let ((buf (get-file-buffer file)))
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1295 (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
1296 (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
1297 `((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
1298 (not writable))
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1299 (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
1300 'up-to-date
94521
2a61c5f918a5 Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94520
diff changeset
1301 'needs-update)
94481
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1302 'edited))
ad6c174910db Make `checkout-model' apply to filesets.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94478
diff changeset
1303 (vc-checkout-time . ,(nth 5 (file-attributes file))))))
38606
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
1304 (vc-resynch-buffer file t t)
32e167f31eb6 (vc-checkout-hook): New hook.
André Spiegel <spiegel@gnu.org>
parents: 38595
diff changeset
1305 (run-hooks 'vc-checkout-hook))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1306
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1307 (defun vc-mark-resolved (backend files)
98337
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1308 (prog1 (with-vc-properties
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1309 files
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1310 (vc-call-backend backend 'mark-resolved files)
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1311 ;; FIXME: Is this TRTD? Might not be.
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1312 `((vc-state . edited)))
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1313 (message
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1314 (substitute-command-keys
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1315 "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
1316 Type \\[vc-next-action] to check in changes.")
98337
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1317 (if (> (length files) 1)
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1318 (format "%d files" (length files))
34fed5300274 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 98336
diff changeset
1319 "this file"))))
93956
bfc762f0b49c * vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93934
diff changeset
1320
31380
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1321 (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
1322 "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
1323 (let (file-description)
5ddb0e0adb08 (vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents: 8726
diff changeset
1324 (if rev
5ddb0e0adb08 (vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents: 8726
diff changeset
1325 (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
1326 (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
1327 (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
1328 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
1329 (error "Steal canceled"))
42548
1cf3624d80ac (vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents: 42205
diff changeset
1330 (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
1331 (with-vc-properties
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1332 (list file)
42548
1cf3624d80ac (vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents: 42205
diff changeset
1333 (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
1334 `((vc-state . edited)))
1cf3624d80ac (vc-branch-part): Return nil if there's no `.'
André Spiegel <spiegel@gnu.org>
parents: 42205
diff changeset
1335 (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
1336 (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
1337 ;; 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
1338 ;; 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
1339 (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
1340 (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
1341 (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
1342 (insert
5ddb0e0adb08 (vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents: 8726
diff changeset
1343 (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
1344 (current-time-string)
5ddb0e0adb08 (vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents: 8726
diff changeset
1345 ".\n")
5ddb0e0adb08 (vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents: 8726
diff changeset
1346 (message "Please explain why you stole the lock. Type C-c C-c when done.")))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1347
102576
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1348 (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
1349 "Check in FILES.
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1350 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
1351 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
1352 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
1353 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
1354 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
1355
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1356 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
1357 that the version control system supports this mode of operation.
20967
e57454838582 (vc-checkin-hook): Add :options.
Dave Love <fx@gnu.org>
parents: 20752
diff changeset
1358
94579
dca2377770e7 Move context-preservation machinery.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94576
diff changeset
1359 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
1360 (when vc-before-checkin-hook
dca2377770e7 Move context-preservation machinery.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94576
diff changeset
1361 (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
1362 (lexical-let
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1363 ((backend backend))
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1364 (vc-start-logentry
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1365 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
1366 "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
1367 "*VC-log*"
107430
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
1368 (lambda ()
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
1369 (vc-call-backend backend 'log-edit-mode))
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
1370 (lambda (files rev comment extra-flags)
102576
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1371 (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
1372 ;; "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
1373 ;; 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
1374 (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
1375 (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
1376 (with-vc-properties
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1377 files
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1378 ;; 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
1379 ;; 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
1380 (progn
107430
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
1381 (vc-call-backend backend 'checkin files rev comment extra-flags)
102576
ca736f834e8c (vc-checkin): Add an extra argument for the VC backend,
Dan Nicolaescu <dann@ics.uci.edu>
parents: 102554
diff changeset
1382 (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
1383 `((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
1384 (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
1385 (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
1386 (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
1387 'vc-checkin-hook)))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1388
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1389 ;;; Additional entry points for examining version histories
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1390
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1391 ;; (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
1392 ;; "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
1393 ;; 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
1394 ;; ;; 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
1395 ;; ;; 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
1396 ;; ;; 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
1397 ;; ;; 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
1398 ;; ;; 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
1399 ;; ;; to backend-specific implementations.
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1400 ;; (setq default-directory dir)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1401 ;; (vc-file-tree-walk
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1402 ;; default-directory
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1403 ;; (lambda (f)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1404 ;; (vc-exec-after
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1405 ;; `(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
1406 ;; (message "Looking at %s" ',f)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1407 ;; (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
1408 ;; '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
1409
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1410 (defun vc-coding-system-for-diff (file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1411 "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
1412 (or coding-system-for-read
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1413 ;; if we already have this file open,
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1414 ;; use the buffer's coding system
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1415 (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
1416 (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
1417 buffer-file-coding-system)))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1418 ;; 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
1419 (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
1420 ;; and a final fallback
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1421 'undecided))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1422
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1423 (defun vc-switches (backend op)
98386
48cf5d8c02af (vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents: 98337
diff changeset
1424 "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
1425 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
1426 OP is a symbol such as `diff'.
48cf5d8c02af (vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents: 98337
diff changeset
1427
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99262
diff changeset
1428 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
1429 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
1430 vc-OP-switches (e.g. `vc-diff-switches'); or, in the case of
98388
a0d0310a78a7 Fix previous change.
Glenn Morris <rgm@gnu.org>
parents: 98386
diff changeset
1431 diff only, `diff-switches'.
98386
48cf5d8c02af (vc-switches): Give it a doc string.
Glenn Morris <rgm@gnu.org>
parents: 98337
diff changeset
1432
100171
d42aff5ca541 * align.el:
Lute Kamstra <lute@gnu.org>
parents: 99262
diff changeset
1433 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
1434 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
1435 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
1436 (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
1437 (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
1438 (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
1439 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
1440 "-switches")))))
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
1441 (when (boundp sym) (symbol-value sym))))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1442 (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
1443 (when (boundp sym) (symbol-value sym)))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1444 (cond
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1445 ((eq op 'diff) diff-switches)))))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1446 (if (stringp switches) (list switches)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1447 ;; If not a list, return nil.
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1448 ;; 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
1449 ;; 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
1450 (when (listp switches) switches))))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1451
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1452 ;; Old def for compatibility with Emacs-21.[123].
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
1453 (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
1454 (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
1455
91698
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1456 (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
1457 ;; 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
1458 ;; 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
1459 (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
1460 (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
1461 (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
1462 (with-current-buffer buffer
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1463 (and messages emptyp
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1464 (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
1465 (insert (cdr messages) ".\n")
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1466 (message "%s" (cdr messages))))
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1467 (goto-char (point-min))
87931
9f4909ced989 Handle dead buffers in async filters/sentinels.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 87930
diff changeset
1468 (when window
91698
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1469 (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
1470 (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
1471 (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
1472
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1473 (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
1474 "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
1475
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
1476 (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
1477 "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
1478 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
1479 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
1480 (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
1481 (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
1482 (vc-delistify files))
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1483 (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
1484 (or rev1 "working revision")
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1485 (or rev2 "workfile"))))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1486 ;; 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
1487 ;; 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
1488 ;; 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
1489 (coding-system-for-read
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1490 (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
1491 (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
1492 (message "%s" (car messages))
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1493 ;; 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
1494 ;; 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
1495 ;; 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
1496 ;;
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1497 ;; 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
1498 ;; 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
1499 ;; 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
1500 ;; `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
1501 ;; 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
1502 ;; 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
1503 (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
1504 (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
1505 process-file-side-effects)
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1506 (dolist (file files)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1507 (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
1508 (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
1509 (push file filtered)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1510 ;; 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
1511 ;; 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
1512 (if (or rev1 rev2)
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1513 (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
1514 ;; We regard this as "changed".
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1515 ;; Diff it against /dev/null.
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1516 (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
1517 1 "diff" file
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1518 (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
1519 (setq files (nreverse filtered))))
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1520 (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
1521 (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
1522 (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
1523 (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
1524 (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
1525 ;; 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
1526 (progn
91698
c22d8444f043 Make vc-diff-internal messages consistent across many cases.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 88111
diff changeset
1527 (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
1528 nil)
85972
51aa47312c4b * ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85794
diff changeset
1529 (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
1530 ;; 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
1531 ;; 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
1532 ;; 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
1533 (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
1534 (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
1535 messages)))
86100
ac69f23a84ce (vc-diff-internal): Pop-to-buffer later.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86055
diff changeset
1536 ;; 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
1537 (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
1538 ;; 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
1539 ;; 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
1540 t)))
40124
9031427edfa3 (vc-diff-internal, vc-coding-system-for-diff, vc-default-diff-tree):
André Spiegel <spiegel@gnu.org>
parents: 39427
diff changeset
1541
104647
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1542 (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
1543 (cond
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1544 ((null files)
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1545 (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
1546 (setq files (cadr vc-fileset))
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1547 (setq backend (car vc-fileset))))
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1548 ((null backend) (setq backend (vc-backend (car files)))))
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1549 (let ((completion-table
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1550 (vc-call-backend backend 'revision-completion-table files)))
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1551 (if completion-table
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1552 (completing-read prompt completion-table
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1553 nil nil initial-input nil default)
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1554 (read-string prompt initial-input nil default))))
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1555
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
1556 ;;;###autoload
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1557 (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
1558 "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
1559 (interactive
96046
422d57d537d7 (vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95966
diff changeset
1560 (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
1561 (files (cadr vc-fileset))
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1562 (backend (car vc-fileset))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1563 (first (car files))
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1564 (rev1-default nil)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1565 (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
1566 (cond
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1567 ;; 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
1568 ;; filesets, but not yet.
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1569 ((/= (length files) 1)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1570 nil)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1571 ;; 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
1572 ((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
1573 nil)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1574 ;; 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
1575 ((not (vc-up-to-date-p first))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1576 (setq rev1-default (vc-working-revision first)))
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1577 ;; 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
1578 (t
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1579 (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
1580 (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
1581 (when (string= rev1-default "") (setq rev1-default nil))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1582 (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
1583 ;; 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
1584 (let* ((rev1-prompt (if rev1-default
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1585 (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
1586 rev1-default "): ")
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1587 "Older revision: "))
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1588 (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
1589 (or rev2-default "current source") "): "))
104647
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1590 (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
1591 (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
1592 (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
1593 (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
1594 (list files rev1 rev2))))
94778
b9687393def1 Large simplification in (vc-deduce-fileset) logic.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94729
diff changeset
1595 ;; 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
1596 (when (and (not rev1) rev2)
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
1597 (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
1598 ;; 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
1599 ;; 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
1600 (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
1601 (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
1602
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1603 ;;;###autoload
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1604 (defun vc-diff (historic &optional not-urgent)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1605 "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
1606 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
1607 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
1608 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
1609
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1610 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
1611 saving the buffer."
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1612 (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
1613 (if historic
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
1614 (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
1615 (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
1616 (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
1617 (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
1618
4725
126cf4bdfd35 (vc-version-other-window): New function.
Paul Eggert <eggert@twinsun.com>
parents: 4684
diff changeset
1619 ;;;###autoload
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1620 (defun vc-root-diff (historic &optional not-urgent)
107679
e542aa3511d0 * vc.el (vc-root-diff): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 107677
diff changeset
1621 "Display diffs between VC-controlled whole tree revisions.
e542aa3511d0 * vc.el (vc-root-diff): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 107677
diff changeset
1622 Normally, this compares the tree corresponding to the current
e542aa3511d0 * vc.el (vc-root-diff): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 107677
diff changeset
1623 fileset with the working revision.
e542aa3511d0 * vc.el (vc-root-diff): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 107677
diff changeset
1624 With a prefix argument HISTORIC, prompt for two revision
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1625 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
1626
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1627 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
1628 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
1629 (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
1630 (if historic
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1631 ;; 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
1632 ;; 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
1633 ;; 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
1634 (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
1635 (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
1636 (let ((backend
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1637 (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend)
106159
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
1638 ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1639 (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
1640 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
1641 (unless backend
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1642 (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
1643 (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
1644 (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
1645 (vc-diff-internal
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 105170
diff changeset
1646 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
1647 (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
1648
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1649 ;;;###autoload
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1650 (defun vc-revision-other-window (rev)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1651 "Visit revision REV of the current file in another window.
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1652 If the current file is named `F', the revision is named `F.~REV~'.
41071
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
1653 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
1654 (interactive
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1655 (save-current-buffer
2dd5d799a16d * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
1656 (vc-ensure-vc-buffer)
104647
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1657 (list
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1658 (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
1659 (list buffer-file-name)))))
21366
e7b64d0b3b3d (vc-ensure-vc-buffer): New function.
André Spiegel <spiegel@gnu.org>
parents: 21357
diff changeset
1660 (vc-ensure-vc-buffer)
32888
78063b725d3f (vc-version-other-window): Bind `file'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 32748
diff changeset
1661 (let* ((file buffer-file-name)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1662 (revision (if (string-equal rev "")
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1663 (vc-working-revision file)
41556
678f91af978a (vc-find-version): New function.
André Spiegel <spiegel@gnu.org>
parents: 41395
diff changeset
1664 rev)))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1665 (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
1666
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1667 (defun vc-find-revision (file revision)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1668 "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
1669 (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
1670 (filebuf (or (get-file-buffer file) (current-buffer)))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1671 (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
1672 (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
1673 (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
1674 (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
1675 (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
1676 (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
1677 (let ((failed t))
cf312195338d (vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47781
diff changeset
1678 (unwind-protect
cf312195338d (vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47781
diff changeset
1679 (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
1680 (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
1681 (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
1682 (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
1683 ;; 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
1684 ;; vc-checkout-switches.
cf312195338d (vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47781
diff changeset
1685 (with-current-buffer filebuf
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1686 (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
1687 (setq failed nil))
86248
cde7fc4f5945 (vc-find-revision): Set the parent buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86100
diff changeset
1688 (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
1689 (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
1690 (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
1691 (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
1692 (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
1693 (with-current-buffer result-buf
86410
bca8808972f0 Delete eol whitespace; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 86370
diff changeset
1694 ;; 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
1695 ;; 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
1696 (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
1697 result-buf)))
47796
cf312195338d (vc-find-version): Use the new backend op `find-version'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47781
diff changeset
1698
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1699 ;; Header-insertion code
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1700
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
1701 ;;;###autoload
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1702 (defun vc-insert-headers ()
41071
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
1703 "Insert headers into a file for use with a version control system.
23235
7f3fdbb83988 (vc-insert-headers): Doc fix.
Dave Love <fx@gnu.org>
parents: 22905
diff changeset
1704 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
1705 the variable `vc-BACKEND-header'."
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1706 (interactive)
21366
e7b64d0b3b3d (vc-ensure-vc-buffer): New function.
André Spiegel <spiegel@gnu.org>
parents: 21357
diff changeset
1707 (vc-ensure-vc-buffer)
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1708 (save-excursion
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1709 (save-restriction
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1710 (widen)
94207
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
1711 (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
1712 (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
1713 (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
1714 (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
1715 (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
1716 (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
1717 'header))
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
1718 (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
1719 (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
1720 (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
1721 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
1722 (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
1723 (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
1724 (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
1725 (insert (format (cdr f) (car hdstrings)))))))))))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1726
31380
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1727 (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
1728 "Clear all version headers in the current buffer (or FILE).
41071
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
1729 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
1730 (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
1731 (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
1732 (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
1733 (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
1734 (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
1735 (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
1736 ;; 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
1737 ;; 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
1738 ;; 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
1739 (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
1740 (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
1741 (vc-restore-buffer-context context))
32058
4196f89984ce * vc.el (vc-editable-p): Minor optimization.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 32054
diff changeset
1742 (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
1743 (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
1744 (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
1745
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
1746 (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
1747 "Edit the comment associated with the given files and revision."
107485
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1748 ;; Less of a kluge than it looks like; log-view mode only passes
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1749 ;; this function a singleton list. Arguments left in this form in
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1750 ;; case the more general operation ever becomes meaningful.
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1751 (let ((backend (vc-responsible-backend (car files))))
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1752 (vc-start-logentry
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1753 files rev oldcomment t
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1754 "Enter a replacement change comment."
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1755 "*VC-log*"
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1756 (lambda () (vc-call-backend backend 'log-edit-mode))
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1757 (lambda (files rev comment ignored)
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1758 (vc-call-backend backend
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
1759 'modify-change-comment files rev comment)))))
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
1760
21366
e7b64d0b3b3d (vc-ensure-vc-buffer): New function.
André Spiegel <spiegel@gnu.org>
parents: 21357
diff changeset
1761 ;;;###autoload
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31387
diff changeset
1762 (defun vc-merge ()
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1763 "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
1764 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
1765 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
1766 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
1767 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
1768
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1769 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
1770 (interactive)
21368
37b978fc46cb (vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents: 21366
diff changeset
1771 (vc-ensure-vc-buffer)
37b978fc46cb (vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents: 21366
diff changeset
1772 (vc-buffer-sync)
37b978fc46cb (vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents: 21366
diff changeset
1773 (let* ((file buffer-file-name)
37b978fc46cb (vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents: 21366
diff changeset
1774 (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
1775 (state (vc-state file))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1776 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
1777 (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
1778 ((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
1779 (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
1780 ((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
1781 (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
1782 "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
1783 (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
1784 (error "Merge aborted"))))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1785 (setq first-revision
104647
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1786 (vc-read-revision
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1787 (concat "Branch or revision to merge from "
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1788 "(default news on current branch): ")
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1789 (list file)
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1790 backend))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1791 (if (string= first-revision "")
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
1792 (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
1793 (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
1794 (error "Sorry, merging is not implemented for %s" backend)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1795 (if (not (vc-branch-p first-revision))
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1796 (setq second-revision
104647
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1797 (vc-read-revision
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1798 "Second revision: "
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1799 (list file) backend nil
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1800 ;; FIXME: This is CVS/RCS/SCCS specific.
ef4820f099a1 (vc-read-revision): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104621
diff changeset
1801 (concat (vc-branch-part first-revision) ".")))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1802 ;; 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
1803 ;; accordingly, so that vc-BACKEND-merge understands us.
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1804 (setq second-revision first-revision)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1805 ;; first-revision must be the starting point of the branch
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1806 (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
1807 (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
1808 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
1809 (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
1810
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1811 (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
1812 (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
1813 (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
1814 (smerge-mode 1)
54586
c3043c1faed3 (vc-maybe-resolve-conflicts): Don't prompt the user.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54562
diff changeset
1815 (message "File contains conflicts.")))
21368
37b978fc46cb (vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents: 21366
diff changeset
1816
37b978fc46cb (vc-merge, vc-backend-merge): New functions.
André Spiegel <spiegel@gnu.org>
parents: 21366
diff changeset
1817 ;;;###autoload
47781
79bdd88fb006 (vc-resolve-conflicts); Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47780
diff changeset
1818 (defalias 'vc-resolve-conflicts 'smerge-ediff)
21324
b0abfde79536 * vc.el (vc-resolve-conflicts): New function.
André Spiegel <spiegel@gnu.org>
parents: 21233
diff changeset
1819
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1820 ;; Named-configuration entry points
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1821
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
1822 (defun vc-tag-precondition (dir)
41071
cb1ebde1c4c9 Documentation fixes.
André Spiegel <spiegel@gnu.org>
parents: 40958
diff changeset
1823 "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
1824 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
1825 \(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
1826 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
1827 Otherwise, return nil."
12714
192f537bca2a (vc-resynch-buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12589
diff changeset
1828 (let ((status nil))
192f537bca2a (vc-resynch-buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12589
diff changeset
1829 (catch 'vc-locked-example
192f537bca2a (vc-resynch-buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12589
diff changeset
1830 (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
1831 dir
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1832 (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
1833 (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
1834 (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
1835 status)))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1836
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
1837 ;;;###autoload
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
1838 (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
1839 "Descending recursively from DIR, make a tag called NAME.
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1840 For each registered file, the working revision becomes part of
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1841 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
1842 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
1843 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
1844 (interactive
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1845 (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
1846 (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
1847 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
1848 (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
1849 (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
1850 (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
1851 '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
1852 (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
1853
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
1854 ;;;###autoload
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
1855 (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
1856 "Descending recursively from DIR, retrieve the tag called NAME.
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1857 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
1858 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
1859 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
1860 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
1861 (interactive
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
1862 (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
1863 (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
1864 (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
1865 (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
1866 (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
1867 (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
1868 (abbreviate-file-name dir)))))
65582
4d1085b02d64 Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents: 65405
diff changeset
1869 (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
1870 (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
1871 'retrieve-tag dir name update)
65582
4d1085b02d64 Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents: 65405
diff changeset
1872 (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
1873
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1874 ;; Miscellaneous other entry points
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1875
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1876 ;; 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
1877 ;; 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
1878 ;; `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
1879 ;; 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
1880 (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
1881 "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
1882 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
1883 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
1884 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
1885
106383
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
1886 (defvar log-view-vc-backend)
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
1887 (defvar log-view-vc-fileset)
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
1888
106230
eb5b55788509 (vc-print-log-internal): Make `limit' optional for better
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106159
diff changeset
1889 (defun vc-print-log-internal (backend files working-revision
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1890 &optional is-start-revision limit)
104041
f2d3a9b75762 (vc-print-log-internal): New function, split out from ...
Dan Nicolaescu <dann@ics.uci.edu>
parents: 103596
diff changeset
1891 ;; 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
1892 ;; 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
1893 ;; 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
1894 (let ((dir-present nil)
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1895 (vc-short-log nil)
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1896 pl-return)
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1897 (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
1898 (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
1899 (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
1900 (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
1901 (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
1902 (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
1903 (memq 'file vc-log-short-style)))))
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1904
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1905 (setq pl-return (vc-call-backend
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1906 backend 'print-log files "*vc-change-log*"
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1907 vc-short-log (when is-start-revision working-revision) limit))
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1908 (pop-to-buffer "*vc-change-log*")
106361
2e9a20121a4f (vc-print-log-internal): Don't wait for the prcess to
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106230
diff changeset
1909 (let ((inhibit-read-only t))
2e9a20121a4f (vc-print-log-internal): Don't wait for the prcess to
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106230
diff changeset
1910 ;; log-view-mode used to be called with inhibit-read-only bound
2e9a20121a4f (vc-print-log-internal): Don't wait for the prcess to
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106230
diff changeset
1911 ;; to t, so let's keep doing it, just in case.
2e9a20121a4f (vc-print-log-internal): Don't wait for the prcess to
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106230
diff changeset
1912 (vc-call-backend backend 'log-view-mode))
106383
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
1913 (set (make-local-variable 'log-view-vc-backend) backend)
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
1914 (set (make-local-variable 'log-view-vc-fileset) files)
106361
2e9a20121a4f (vc-print-log-internal): Don't wait for the prcess to
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106230
diff changeset
1915
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1916 (vc-exec-after
106361
2e9a20121a4f (vc-print-log-internal): Don't wait for the prcess to
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106230
diff changeset
1917 `(let ((inhibit-read-only t))
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1918 (when (and ,limit (not ,(eq 'limit-unsupported pl-return))
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1919 (not ,is-start-revision))
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1920 (goto-char (point-max))
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1921 (widget-create 'push-button
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1922 :notify (lambda (&rest ignore)
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1923 (vc-print-log-internal
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1924 ',backend ',files ',working-revision nil (* 2 ,limit)))
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1925 :help-echo "Show the log again, and double the number of log entries shown"
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1926 "Show 2X entries")
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1927 (widget-insert " ")
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1928 (widget-create 'push-button
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1929 :notify (lambda (&rest ignore)
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1930 (vc-print-log-internal
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1931 ',backend ',files ',working-revision nil nil))
106060
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1932 :help-echo "Show the log again, showing all entries"
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1933 "Show unlimited entries")
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1934 (widget-setup))
2f9ecf376c7a * vc.el (vc-log-show-limit): Default to 2000.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106033
diff changeset
1935
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1936 (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
1937 ;; 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
1938 (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
1939 (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
1940 (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
1941
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
1942 ;;;###autoload
106033
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1943 (defun vc-print-log (&optional working-revision limit)
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
1944 "List the change log of the current fileset in a window.
107677
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1945 If WORKING-REVISION is non-nil, leave point at that revision.
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1946 If LIMIT is non-nil, it should be a number specifying the maximum
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1947 number of revisions to show; the default is `vc-log-show-limit'.
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1948
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1949 When called interactively with a prefix argument, prompt for
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1950 WORKING-REVISION and LIMIT."
106033
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1951 (interactive
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1952 (cond
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1953 (current-prefix-arg
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1954 (let ((rev (read-from-minibuffer "Log from revision (default: last revision): " nil
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1955 nil nil nil))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1956 (lim (string-to-number
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1957 (read-from-minibuffer
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1958 "Limit display (unlimited: 0): "
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1959 (format "%s" vc-log-show-limit)
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1960 nil nil nil))))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1961 (when (string= rev "") (setq rev nil))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1962 (when (<= lim 0) (setq lim nil))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1963 (list rev lim)))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1964 (t
106399
065925e07677 Limit the number of log entries displayed by default.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106383
diff changeset
1965 (list nil (when (> vc-log-show-limit 0) vc-log-show-limit)))))
96046
422d57d537d7 (vc-deduce-fileset): Add arg `only-files'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95966
diff changeset
1966 (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
1967 (backend (car vc-fileset))
94984
b8d24d4a4bdc Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94974
diff changeset
1968 (files (cadr vc-fileset))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
1969 (working-revision (or working-revision (vc-working-revision (car files)))))
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1970 (vc-print-log-internal backend files working-revision nil limit)))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1971
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
1972 ;;;###autoload
106033
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1973 (defun vc-print-root-log (&optional limit)
107677
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1974 "List the change log for the current VC controlled tree in a window.
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1975 If LIMIT is non-nil, it should be a number specifying the maximum
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1976 number of revisions to show; the default is `vc-log-show-limit'.
6dc6d78ccf45 * vc.el (vc-print-log, vc-print-root-log): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 106888
diff changeset
1977 When called interactively with a prefix argument, prompt for LIMIT."
106033
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1978 (interactive
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1979 (cond
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1980 (current-prefix-arg
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1981 (let ((lim (string-to-number
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1982 (read-from-minibuffer
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1983 "Limit display (unlimited: 0): "
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1984 (format "%s" vc-log-show-limit)
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1985 nil nil nil))))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1986 (when (<= lim 0) (setq lim nil))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1987 (list lim)))
2bed02fa3041 * vc.el (vc-log-show-limit): New variable.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105745
diff changeset
1988 (t
106399
065925e07677 Limit the number of log entries displayed by default.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106383
diff changeset
1989 (list (when (> vc-log-show-limit 0) vc-log-show-limit)))))
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1990 (let ((backend
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1991 (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend)
106159
f5e8e91b23bf (vc-deduce-fileset): Allow non-state changing operations
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106060
diff changeset
1992 ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1993 (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
1994 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
1995 (unless backend
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
1996 (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
1997 (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
1998 (setq working-revision (vc-working-revision rootdir))
106472
6e0f1038bc44 Support showing a single log entry from vc-annotate.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106399
diff changeset
1999 (vc-print-log-internal backend (list rootdir) working-revision nil limit)))
105010
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
2000
b3c2589ed19e * vc.el (top): print-log method now takes an optional SHORTLOG
Dan Nicolaescu <dann@ics.uci.edu>
parents: 104711
diff changeset
2001 ;;;###autoload
81957
8f9991bf3b41 Generalize stay-local-p to operatre on lists of files.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 81923
diff changeset
2002 (defun vc-revert ()
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2003 "Revert working copies of the selected fileset to their repository contents.
952
ba6a993500d4 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 927
diff changeset
2004 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
2005 to the working revision (except for keyword expansion)."
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2006 (interactive)
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2007 (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
2008 (files (cadr vc-fileset)))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2009 ;; 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
2010 ;; 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
2011 ;; 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
2012 ;; 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
2013 (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
2014 (vc-buffer-sync nil))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2015 (dolist (file files)
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
2016 (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
2017 (when (and buf (buffer-modified-p buf))
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
2018 (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
2019 (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
2020 (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
2021 (error "Revert canceled"))))
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2022 (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
2023 (unless (yes-or-no-p
bc878f998f43 (vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents: 99159
diff changeset
2024 (format "Discard changes in %s? "
106383
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
2025 (let ((str (vc-delistify files))
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
2026 (nfiles (length files)))
99262
bc878f998f43 (vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents: 99159
diff changeset
2027 (if (< (length str) 50)
bc878f998f43 (vc-revert): Limit the length of the query string.
Chong Yidong <cyd@stupidchicken.com>
parents: 99159
diff changeset
2028 str
106383
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
2029 (format "%d file%s" nfiles
09d0cce6cdd3 (log-view-vc-backend, log-view-vc-fileset): Declare.
Glenn Morris <rgm@gnu.org>
parents: 106361
diff changeset
2030 (if (= nfiles 1) "" "s"))))))
94207
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
2031 (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
2032 (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
2033 (kill-buffer "*vc-diff*"))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2034 (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
2035 (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
2036 (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
2037 (message "Reverting %s...done" (vc-delistify files)))))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2038
43586
62c8a228bc1f (vc-update): New function.
André Spiegel <spiegel@gnu.org>
parents: 43584
diff changeset
2039 ;;;###autoload
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2040 (defun vc-rollback ()
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2041 "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
2042 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
2043 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
2044 (interactive)
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2045 (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
2046 (backend (car vc-fileset))
94984
b8d24d4a4bdc Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94974
diff changeset
2047 (files (cadr vc-fileset))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2048 (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
2049 (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
2050 (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
2051 (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
2052 (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
2053 ;; 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
2054 (when (not (vc-call-backend backend 'latest-on-branch-p (car files)))
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
2055 (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
2056 ;; 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
2057 ;; 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
2058 ;; 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
2059 ;; 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
2060 (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
2061 (vc-buffer-sync nil))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2062 (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
2063 (when (buffer-modified-p (get-file-buffer file))
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
2064 (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
2065 (when (not (vc-up-to-date-p file))
105170
f8ba8d6fd250 Fix typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 105010
diff changeset
2066 (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
2067 ;; Accumulate changes associated with the fileset
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2068 (vc-setup-buffer "*vc-diff*")
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2069 (not-modified)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2070 (message "Finding changes...")
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2071 (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
2072 ;; 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
2073 (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
2074 (car files) tip)))
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2075 (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
2076 ;; Display changes
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2077 (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
2078 (error "Rollback canceled"))
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2079 (delete-windows-on "*vc-diff*")
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2080 (kill-buffer"*vc-diff*")
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2081 ;; Do the actual reversions
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2082 (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
2083 (with-vc-properties
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2084 files
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2085 (vc-call-backend backend 'rollback files)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2086 `((vc-state . ,'up-to-date)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2087 (vc-checkout-time . , (nth 5 (file-attributes file)))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2088 (vc-working-revision . nil)))
85454
be5bf5efd2ed Remove `diff-tree' operation, now subsumed by `diff'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85364
diff changeset
2089 (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
2090 (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
2091
38595
396f97177ef1 (vc-switch-backend): Fix autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 38442
diff changeset
2092 ;;;###autoload
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2093 (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
2094
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2095 ;;;###autoload
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2096 (defun vc-update ()
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2097 "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
2098 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
2099 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
2100 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
2101 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
2102 (interactive)
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2103 (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
2104 (backend (car vc-fileset))
94984
b8d24d4a4bdc Eliminate exoensive (vc-expand-dirs) calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94974
diff changeset
2105 (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
2106 (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
2107 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
2108 (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
2109 (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
2110 (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
2111 (dolist (file files)
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2112 (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
2113 (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
2114 (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
2115 (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
2116 (error "%s"
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2117 (substitute-command-keys
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2118 "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
2119 (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
2120 (vc-state file)
87147
e07baccc00fc Fix vc.el breakage.
Deepak Goel <deego@gnufans.org>
parents: 87145
diff changeset
2121 (substitute-command-keys
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2122 "\\[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
2123 (vc-maybe-resolve-conflicts
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
2124 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
2125
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2126 (defun vc-version-backup-file (file &optional rev)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2127 "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
2128 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
2129 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
2130 its name; otherwise return nil."
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2131 (when (vc-call make-version-backups-p file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2132 (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
2133 (if (file-exists-p backup-file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2134 backup-file
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2135 ;; 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
2136 (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
2137 (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
2138 backup-file)))))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2139
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2140 (defun vc-revert-file (file)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2141 "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
2142 (with-vc-properties
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2143 (list file)
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2144 (let ((backup-file (vc-version-backup-file file)))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2145 (when backup-file
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2146 (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
2147 (vc-delete-automatic-version-backups file))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2148 (vc-call revert file backup-file))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2149 `((vc-state . up-to-date)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2150 (vc-checkout-time . ,(nth 5 (file-attributes file)))))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2151 (vc-resynch-buffer file t t))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2152
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2153 ;;;###autoload
31810
495ca3bd372d (vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents: 31718
diff changeset
2154 (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
2155 "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
2156 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
2157 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
2158 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
2159 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
2160 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
2161 (interactive
31810
495ca3bd372d (vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents: 31718
diff changeset
2162 (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
2163 (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
2164 (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
2165 (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
2166 (backends nil))
96123
7742c3c06407 * vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96122
diff changeset
2167 (unless crt-bk
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2168 (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
2169 ;; Find the registered backends.
96123
7742c3c06407 * vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96122
diff changeset
2170 (dolist (crt vc-handled-backends)
7742c3c06407 * vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96122
diff changeset
2171 (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
2172 (not (eq crt-bk crt)))
7742c3c06407 * vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96122
diff changeset
2173 (push crt backends)))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2174 ;; Find the next backend.
96123
7742c3c06407 * vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96122
diff changeset
2175 (let ((def (car backends))
7742c3c06407 * vc.el (vc-switch-backend): Simplify.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96122
diff changeset
2176 (others backends))
85132
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2177 (cond
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2178 ((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
2179 (current-prefix-arg
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2180 (intern
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2181 (upcase
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2182 (completing-read
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2183 (format "Switch to backend [%s]: " def)
d5d7671ba1ea Merge in new VC with filesets.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85114
diff changeset
2184 (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
2185 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
2186 (t def))))))
32059
13e0fdf65e3c (with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 32058
diff changeset
2187 (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
2188 (vc-file-clearprops file)
13e0fdf65e3c (with-vc-file, vc-next-action-on-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 32058
diff changeset
2189 (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
2190 ;; 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
2191 (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
2192 (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
2193 (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
2194 (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
2195
38726
2dddcf515155 (vc-transfer-file): Fix malformed autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 38608
diff changeset
2196 ;;;###autoload
31810
495ca3bd372d (vc-index-of, vc-transfer-file, vc-default-receive-file): New functions.
André Spiegel <spiegel@gnu.org>
parents: 31718
diff changeset
2197 (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
2198 "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
2199 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
2200 \(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
2201 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
2202 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
2203 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
2204 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
2205 \(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
2206 (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
2207 (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
2208 (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
2209 (move
adf341c172af (vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents: 32093
diff changeset
2210 (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
2211 ;; 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
2212 (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
2213 (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
2214 (comment nil))
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2215 (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
2216 (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
2217 (if registered
adf341c172af (vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents: 32093
diff changeset
2218 (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
2219 ;; `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
2220 (vc-switch-backend file old-backend)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2221 (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
2222 (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
2223 (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
2224 ;; 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
2225 (unwind-protect
adf341c172af (vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents: 32093
diff changeset
2226 (progn
32126
3aab429d3c8a (vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents: 32097
diff changeset
2227 (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
2228 (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
2229 ;; 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
2230 ;; 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
2231 ;; 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
2232 (if unmodified-file
50894
4dc2d45403ec (with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49869
diff changeset
2233 (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
2234 '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
2235 (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
2236 (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
2237 (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
2238 (when modified-file
32097
adf341c172af (vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents: 32093
diff changeset
2239 (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
2240 (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
2241 (vc-checkout file t nil))
32126
3aab429d3c8a (vc-revert-buffer): Handle empty diff properly.
André Spiegel <spiegel@gnu.org>
parents: 32097
diff changeset
2242 (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
2243 (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
2244 (when move
adf341c172af (vc-transfer-file, vc-default-receive-file): Rewritten to factorize
André Spiegel <spiegel@gnu.org>
parents: 32093
diff changeset
2245 (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
2246 (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
2247 (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
2248 (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
2249 (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
2250 (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
2251 (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
2252 (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
2253
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 (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
2255 "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
2256 (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
2257 (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
2258 (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
2259 (masters
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
2260 ;; 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
2261 (mapcar
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
2262 (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
2263 templates)))
94207
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
2264 (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
2265 (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
2266 (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
2267 (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
2268 oldmaster
2d74ed749db8 (vc-next-action-on-file): Do not visit the file if it's
Gerd Moellmann <gerd@gnu.org>
parents: 28460
diff changeset
2269 (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
2270 ;; 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
2271 (dolist (f masters)
94240
9f1f284d17b3 (vc-next-action): Do not consider directories when
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94214
diff changeset
2272 (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
2273 (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
2274 ;; 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
2275 (dolist (f masters)
4dc2d45403ec (with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49869
diff changeset
2276 (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
2277 (file-directory-p dir))
4dc2d45403ec (with-vc-properties, with-vc-file, edit-vc-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49869
diff changeset
2278 (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
2279 (error "New file lacks a version control directory")))))
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2280
103153
ce30850e6e3f (vc-delete-file): Add autoload cookie (bug#3209).
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102680
diff changeset
2281 ;;;###autoload
50926
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
2282 (defun vc-delete-file (file)
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
2283 "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
2284 (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
2285 (setq file (expand-file-name file))
51245
f6920b201e1c (vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents: 51064
diff changeset
2286 (let ((buf (get-file-buffer file))
f6920b201e1c (vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents: 51064
diff changeset
2287 (backend (vc-backend file)))
f6920b201e1c (vc-delete-file): Fix free variable reference.
André Spiegel <spiegel@gnu.org>
parents: 51064
diff changeset
2288 (unless backend
51627
1329f6a6c949 (vc-rename-file): Fix typo.
Luc Teirlinck <teirllm@auburn.edu>
parents: 51369
diff changeset
2289 (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
2290 (file-name-nondirectory file)))
50926
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
2291 (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
2292 (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
2293 (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
2294 (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
2295 (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
2296 (when (eq state 'edited)
069edac43148 (vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents: 94519
diff changeset
2297 (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
2298 (when (eq state 'conflict)
069edac43148 (vc-delete-file): Check if the file has uncommitted changed.
Sam Steingold <sds@gnu.org>
parents: 94519
diff changeset
2299 (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
2300 (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
2301 (file-name-nondirectory file)))
dd6110a63907 New backend functions `delete-file' and `repository-hostname'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50894
diff changeset
2302 (error "Abort!"))
94499
5f57377d1eff (vc-dir-mode-map): Bind "d" to vc-dir-delete-file.
Sam Steingold <sds@gnu.org>
parents: 94495
diff changeset
2303 (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
2304 (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
2305 (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
2306 (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
2307 (backup-buffer))))
95895
2ab93a71b21a (vc-delete-file): Bound default-directory before calling
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95853
diff changeset
2308 ;; 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
2309 ;; 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
2310 (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
2311 (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
2312 ;; 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
2313 (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
2314 ;; 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
2315 (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
2316 ;; 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
2317 ;; updated after this.
4d7bc1390196 (vc-delete-file): Make sure the buffer is deleted and
Dan Nicolaescu <dann@ics.uci.edu>
parents: 95269
diff changeset
2318 (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
2319
9044
5ddb0e0adb08 (vc-backend-checkout): Add if-statements to the shell cmds
Richard M. Stallman <rms@gnu.org>
parents: 8726
diff changeset
2320 ;;;###autoload
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2321 (defun vc-rename-file (old new)
2750
6f340eabf13f Improve doc strings and prompt strings.
Richard M. Stallman <rms@gnu.org>
parents: 2745
diff changeset
2322 "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
2323 (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
2324 ;; 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
2325 (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
2326 (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
2327 (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
2328 (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
2329 (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
2330 (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
2331 (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
2332 (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
2333 (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
2334 (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
2335 (error "New file already exists"))
51627
1329f6a6c949 (vc-rename-file): Fix typo.
Luc Teirlinck <teirllm@auburn.edu>
parents: 51369
diff changeset
2336 (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
2337 (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
2338 (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
2339 (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
2340 (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
2341 (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
2342 ;; 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
2343 (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
2344 ;; ?? 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
2345 ;; 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
2346 ;; 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
2347 (when oldbuf
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
2348 (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
2349 (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
2350 (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
2351 (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
2352 (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
2353
927
587a08c3a70b *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 904
diff changeset
2354 ;;;###autoload
1226
573df03a54d8 (vc-update-change-log): Use shell-command, not shell-command-on-region.
Roland McGrath <roland@gnu.org>
parents: 952
diff changeset
2355 (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
2356 "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
2357 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
2358 directory.
15989
2813c68432c9 (vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 15977
diff changeset
2359
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31387
diff changeset
2360 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
2361
2813c68432c9 (vc-update-change-log): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 15977
diff changeset
2362 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
2363 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
2364 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
2365
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31387
diff changeset
2366 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
2367 log entries should be gathered."
1227
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2368 (interactive
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2369 (cond ((consp current-prefix-arg) ;C-u
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2370 (list buffer-file-name))
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2371 (current-prefix-arg ;Numeric argument.
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2372 (let ((files nil)
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2373 (buffers (buffer-list))
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2374 file)
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2375 (while buffers
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2376 (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
2377 (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
2378 (setq files (cons file files)))
1227
d07030650283 (vc-checkin-hook): New user hook variable.
Roland McGrath <roland@gnu.org>
parents: 1226
diff changeset
2379 (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
2380 files))
1b954eb0f249 (vc-update-change-log): Ensure that file names inserted into a ChangeLog
Paul Eggert <eggert@twinsun.com>
parents: 3905
diff changeset
2381 (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
2382 ;; 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
2383 ;; 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
2384 ;; 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
2385 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
2386 (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
2387 '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
2388
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2389 ;; 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
2390 ;; 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
2391 ;; it is used in code below.
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2392 (defun vc-branch-p (rev)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2393 "Return t if REV is a branch revision."
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2394 (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
2395
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2396 ;;;###autoload
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2397 (defun vc-branch-part (rev)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2398 "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
2399 (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
2400 (when index
2aa6d908ffad * vc-hooks.el (vc-insert-file, vc-state, vc-working-revision)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94173
diff changeset
2401 (substring rev 0 index))))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2402
97936
c2f756ba4557 (vc-default-previous-version): Move alias here from vc-hooks, and fix
Glenn Morris <rgm@gnu.org>
parents: 97245
diff changeset
2403 (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
2404 '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
2405
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2406 (defun vc-default-responsible-p (backend file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2407 "Indicate whether BACKEND is reponsible for FILE.
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2408 The default is to return nil always."
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2409 nil)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2410
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2411 (defun vc-default-could-register (backend file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2412 "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
2413 The default implementation returns t for all files."
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2414 t)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2415
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2416 (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
2417 "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
2418 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
2419 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
2420 t)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2421
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2422 (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
2423
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2424 (defun vc-default-find-revision (backend file rev buffer)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2425 "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
2426 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
2427 to provide the `find-revision' operation instead."
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2428 (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
2429 (unwind-protect
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2430 (progn
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2431 (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
2432 (with-current-buffer buffer
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2433 (insert-file-contents-literally tmpfile)))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2434 (delete-file tmpfile))))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2435
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2436 (defun vc-default-rename-file (backend old new)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2437 (condition-case nil
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2438 (add-name-to-file old new)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2439 (error (rename-file old new)))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2440 (vc-delete-file old)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2441 (with-current-buffer (find-file-noselect new)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2442 (vc-register)))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2443
85364
f8d1bb788744 (vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85178
diff changeset
2444 (defalias 'vc-default-check-headers 'ignore)
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2445
107485
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
2446 (declare-function log-edit-mode "log-edit" ())
8d62d5ccf793 * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
Glenn Morris <rgm@gnu.org>
parents: 107430
diff changeset
2447
107430
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
2448 (defun vc-default-log-edit-mode (backend) (log-edit-mode))
1918e70c8b37 Add special markup processing for commit logs.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 106888
diff changeset
2449
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2450 (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
2451
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2452 (defun vc-default-show-log-entry (backend rev)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2453 (with-no-warnings
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2454 (log-view-goto-rev rev)))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2455
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2456 (defun vc-default-comment-history (backend file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2457 "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
2458 (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
2459 (with-current-buffer "*vc*"
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
2460 (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
2461 (buffer-string))))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2462
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2463 (defun vc-default-receive-file (backend file rev)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2464 "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
2465 (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
2466
95020
4da572dc4992 Snapshot primitives globally renamed to refer to tags, documentation updated.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 95018
diff changeset
2467 (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
2468 (if (string= name "")
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2469 (progn
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2470 (vc-file-tree-walk
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2471 dir
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2472 (lambda (f) (and
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2473 (vc-up-to-date-p f)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2474 (vc-error-occurred
94805
89d37b54b964 * vc.el (vc-mark-resolved): Add `backend' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 94803
diff changeset
2475 (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
2476 (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
2477 (let ((result (vc-tag-precondition dir)))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2478 (if (stringp result)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2479 (error "File %s is locked" result)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2480 (setq update (and (eq result 'visited) update))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2481 (vc-file-tree-walk
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2482 dir
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2483 (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
2484 (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
2485 (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
2486
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2487 (defun vc-default-revert (backend file contents-done)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2488 (unless contents-done
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85132
diff changeset
2489 (let ((rev (vc-working-revision file))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2490 (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
2491 (message "Checking out %s..." file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2492 (let ((failed t)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2493 (backup-name (car (find-backup-file-name file))))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2494 (when backup-name
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2495 (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
2496 (unless (file-writable-p file)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2497 (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
2498 (unwind-protect
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2499 (let ((coding-system-for-read 'no-conversion)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2500 (coding-system-for-write 'no-conversion))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2501 (with-temp-file file
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2502 (let ((outbuf (current-buffer)))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2503 ;; 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
2504 (with-current-buffer file-buffer
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2505 (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
2506 (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
2507 file rev outbuf)))))
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2508 (setq failed nil))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2509 (when backup-name
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2510 (if failed
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2511 (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
2512 (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
2513 (message "Checking out %s...done" file))))
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2514
85364
f8d1bb788744 (vc-diff-sentinel, vc-diff-internal): Revert some changes in the
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85178
diff changeset
2515 (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
2516 (defalias 'vc-default-mark-resolved 'ignore)
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2517
94059
c249cf124bd6 (vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents: 94003
diff changeset
2518 (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
2519 (funcall update-function
c249cf124bd6 (vc-status-update): Revert an incorrect rewrite. Add some
Alexandre Julliard <julliard@winehq.org>
parents: 94003
diff changeset
2520 (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
2521
85042
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2522 (defun vc-check-headers ()
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2523 "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
2524 (interactive)
2fe89ebca6d3 Reorder functions, no code changes.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84586
diff changeset
2525 (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
2526
18174
238e30645d07 (diff-switches): defvar deleted.
Richard M. Stallman <rms@gnu.org>
parents: 17911
diff changeset
2527
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2528
94573
ce09c5078ae7 Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94572
diff changeset
2529 ;; 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
2530
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
2531 (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
2532 (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
2533 (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
2534 (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
2535
94573
ce09c5078ae7 Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94572
diff changeset
2536 (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
2537 "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
2538 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
2539 (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
2540 (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
2541
ce09c5078ae7 Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94572
diff changeset
2542 (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
2543 (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
2544 (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
2545 (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
2546 (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
2547 (mapcar
ce09c5078ae7 Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94572
diff changeset
2548 (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
2549 (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
2550 (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
2551 (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
2552 (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
2553 (or
ce09c5078ae7 Partially undo the dispatcher split, it needs to happen more gradually
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 94572
diff changeset
2554 (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
2555 (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
2556 (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
2557
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2558 (provide 'vc)
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2559
56952
1e43327f7457 (vc-buffer-context, vc-restore-buffer-context): Disable obsolete code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55100
diff changeset
2560 ;; arch-tag: ca82c1de-3091-4e26-af92-460abc6213a6
904
4a1ac370d57a Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2561 ;;; vc.el ends here