Mercurial > emacs
annotate lisp/vc-cvs.el @ 94011:077813a3e645
*** empty log message ***
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 11 Apr 2008 19:24:04 +0000 |
parents | 2ecb2ea8d5b5 |
children | ac3873b5653a |
rev | line source |
---|---|
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
1 ;;; vc-cvs.el --- non-resident support for CVS version-control |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
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) 1995, 1998, 1999, 2000, 2001, 2002, 2003, |
79690
be4e5f45a3eb
(vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78359
diff
changeset
|
4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
5 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
6 ;; Author: FSF (see vc.el for full credits) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
7 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
8 |
57913
f5d7d9bbc021
(vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
54465
diff
changeset
|
9 ;; $Id$ |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
10 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
12 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
15 ;; the Free Software Foundation; either version 3, or (at your option) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
16 ;; any later version. |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
17 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
22 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64091 | 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 ;; Boston, MA 02110-1301, USA. | |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
27 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
28 ;;; Commentary: |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
29 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
30 ;;; Code: |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
31 |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
32 (eval-when-compile (require 'cl) (require 'vc)) |
35584 | 33 |
81820
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
34 ;; Clear up the cache to force vc-call to check again and discover |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
35 ;; new functions when we reload this file. |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
36 (put 'CVS 'vc-functions nil) |
35584 | 37 |
35569 | 38 ;;; |
33560 | 39 ;;; Customization options |
40 ;;; | |
41 | |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
42 (defcustom vc-cvs-global-switches nil |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
43 "*Global switches to pass to any CVS command." |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
44 :type '(choice (const :tag "None" nil) |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
45 (string :tag "Argument String") |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
46 (repeat :tag "Argument List" |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
47 :value ("") |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
48 string)) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59443
diff
changeset
|
49 :version "22.1" |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
50 :group 'vc) |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
51 |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
52 (defcustom vc-cvs-register-switches nil |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
53 "*Extra switches for registering a file into CVS. |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
54 A string or list of strings passed to the checkin program by |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
55 \\[vc-register]." |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
56 :type '(choice (const :tag "None" nil) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
57 (string :tag "Argument String") |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
58 (repeat :tag "Argument List" |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
59 :value ("") |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
60 string)) |
31475 | 61 :version "21.1" |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
62 :group 'vc) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
63 |
35821
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
64 (defcustom vc-cvs-diff-switches nil |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
65 "*A string or list of strings specifying extra switches for cvs diff under VC." |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
66 :type '(choice (const :tag "None" nil) |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
67 (string :tag "Argument String") |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
68 (repeat :tag "Argument List" |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
69 :value ("") |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
70 string)) |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
71 :version "21.1" |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
72 :group 'vc) |
6b1ff979e045
(vc-cvs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents:
35702
diff
changeset
|
73 |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
74 (defcustom vc-cvs-header (or (cdr (assoc 'CVS vc-header-alist)) '("\$Id\$")) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
75 "*Header keywords to be inserted by `vc-insert-headers'." |
31475 | 76 :version "21.1" |
35177 | 77 :type '(repeat string) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
78 :group 'vc) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
79 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
80 (defcustom vc-cvs-use-edit t |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
81 "*Non-nil means to use `cvs edit' to \"check out\" a file. |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
82 This is only meaningful if you don't use the implicit checkout model |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
83 \(i.e. if you have $CVSREAD set)." |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
84 :type 'boolean |
31475 | 85 :version "21.1" |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
86 :group 'vc) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
87 |
50671
0737c3a76291
(vc-cvs-stay-local): Keep the old default. Simplify doc string.
André Spiegel <spiegel@gnu.org>
parents:
50668
diff
changeset
|
88 (defcustom vc-cvs-stay-local t |
31475 | 89 "*Non-nil means use local operations when possible for remote repositories. |
38288
6934c28c6bc5
(vc-cvs-stay-local): doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
37358
diff
changeset
|
90 This avoids slow queries over the network and instead uses heuristics |
6934c28c6bc5
(vc-cvs-stay-local): doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
37358
diff
changeset
|
91 and past information to determine the current status of a file. |
50671
0737c3a76291
(vc-cvs-stay-local): Keep the old default. Simplify doc string.
André Spiegel <spiegel@gnu.org>
parents:
50668
diff
changeset
|
92 |
50668
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
93 The value can also be a regular expression or list of regular |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
94 expressions to match against the host name of a repository; then VC |
50671
0737c3a76291
(vc-cvs-stay-local): Keep the old default. Simplify doc string.
André Spiegel <spiegel@gnu.org>
parents:
50668
diff
changeset
|
95 only stays local for hosts that match it. Alternatively, the value |
57913
f5d7d9bbc021
(vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
54465
diff
changeset
|
96 can be a list of regular expressions where the first element is the |
f5d7d9bbc021
(vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
54465
diff
changeset
|
97 symbol `except'; then VC always stays local except for hosts matched |
50671
0737c3a76291
(vc-cvs-stay-local): Keep the old default. Simplify doc string.
André Spiegel <spiegel@gnu.org>
parents:
50668
diff
changeset
|
98 by these regular expressions." |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
99 :type '(choice (const :tag "Always stay local" t) |
50668
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
100 (const :tag "Don't stay local" nil) |
57913
f5d7d9bbc021
(vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
54465
diff
changeset
|
101 (list :format "\nExamine hostname and %v" :tag "Examine hostname ..." |
50668
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
102 (set :format "%v" :inline t (const :format "%t" :tag "don't" except)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
103 (regexp :format " stay local,\n%t: %v" :tag "if it matches") |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
104 (repeat :format "%v%i\n" :inline t (regexp :tag "or")))) |
31475 | 105 :version "21.1" |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
106 :group 'vc) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
107 |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
108 (defcustom vc-cvs-sticky-date-format-string "%c" |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
109 "*Format string for mode-line display of sticky date. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
110 Format is according to `format-time-string'. Only used if |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
111 `vc-cvs-sticky-tag-display' is t." |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
112 :type '(string) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59443
diff
changeset
|
113 :version "22.1" |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
114 :group 'vc) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
115 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
116 (defcustom vc-cvs-sticky-tag-display t |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
117 "*Specify the mode-line display of sticky tags. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
118 Value t means default display, nil means no display at all. If the |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
119 value is a function or macro, it is called with the sticky tag and |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
120 its' type as parameters, in that order. TYPE can have three different |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
121 values: `symbolic-name' (TAG is a string), `revision-number' (TAG is a |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
122 string) and `date' (TAG is a date as returned by `encode-time'). The |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
123 return value of the function or macro will be displayed as a string. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
124 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
125 Here's an example that will display the formatted date for sticky |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
126 dates and the word \"Sticky\" for sticky tag names and revisions. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
127 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
128 (lambda (tag type) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
129 (cond ((eq type 'date) (format-time-string |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
130 vc-cvs-sticky-date-format-string tag)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
131 ((eq type 'revision-number) \"Sticky\") |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
132 ((eq type 'symbolic-name) \"Sticky\"))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
133 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
134 Here's an example that will abbreviate to the first character only, |
47917
ca7641fe56ba
(vc-cvs-sticky-tag-display): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
47840
diff
changeset
|
135 any text before the first occurrence of `-' for sticky symbolic tags. |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
136 If the sticky tag is a revision number, the word \"Sticky\" is |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
137 displayed. Date and time is displayed for sticky dates. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
138 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
139 (lambda (tag type) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
140 (cond ((eq type 'date) (format-time-string \"%Y%m%d %H:%M\" tag)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
141 ((eq type 'revision-number) \"Sticky\") |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
142 ((eq type 'symbolic-name) |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
143 (condition-case nil |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
144 (progn |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
145 (string-match \"\\\\([^-]*\\\\)\\\\(.*\\\\)\" tag) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
146 (concat (substring (match-string 1 tag) 0 1) \":\" |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
147 (substring (match-string 2 tag) 1 nil))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
148 (error tag))))) ; Fall-back to given tag name. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
149 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
150 See also variable `vc-cvs-sticky-date-format-string'." |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
151 :type '(choice boolean function) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59443
diff
changeset
|
152 :version "22.1" |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
153 :group 'vc) |
35569 | 154 |
33560 | 155 ;;; |
156 ;;; Internal variables | |
157 ;;; | |
158 | |
35569 | 159 |
33560 | 160 ;;; |
35569 | 161 ;;; State-querying functions |
33560 | 162 ;;; |
163 | |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
164 ;;;###autoload (defun vc-cvs-registered (f) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
165 ;;;###autoload (when (file-readable-p (expand-file-name |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
166 ;;;###autoload "CVS/Entries" (file-name-directory f))) |
47811
8b1c72f30fea
(vc-cvs-registered): In the autoload version use load instead of
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47807
diff
changeset
|
167 ;;;###autoload (load "vc-cvs") |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
168 ;;;###autoload (vc-cvs-registered f))) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
169 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
170 (defun vc-cvs-registered (file) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
171 "Check if FILE is CVS registered." |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
172 (let ((dirname (or (file-name-directory file) "")) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
173 (basename (file-name-nondirectory file)) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
174 ;; make sure that the file name is searched case-sensitively |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
175 (case-fold-search nil)) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
176 (if (file-readable-p (expand-file-name "CVS/Entries" dirname)) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
177 (with-temp-buffer |
50453
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
178 (vc-cvs-get-entries dirname) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
179 (goto-char (point-min)) |
31475 | 180 (cond |
181 ((re-search-forward | |
44104
985526b08270
(vc-cvs-registered, vc-cvs-dir-state-heuristic):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44005
diff
changeset
|
182 ;; CVS-removed files are not taken under VC control. |
985526b08270
(vc-cvs-registered, vc-cvs-dir-state-heuristic):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44005
diff
changeset
|
183 (concat "^/" (regexp-quote basename) "/[^/-]") nil t) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
184 (beginning-of-line) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
185 (vc-cvs-parse-entry file) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
186 t) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
187 (t nil))) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
188 nil))) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
189 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
190 (defun vc-cvs-state (file) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
191 "CVS-specific version of `vc-state'." |
51733
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
192 (if (vc-stay-local-p file) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
193 (let ((state (vc-file-getprop file 'vc-state))) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
194 ;; If we should stay local, use the heuristic but only if |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
195 ;; we don't have a more precise state already available. |
58640
0241e1689d7f
(vc-cvs-state): Handle the case where vc-state is still nil.
André Spiegel <spiegel@gnu.org>
parents:
57916
diff
changeset
|
196 (if (memq state '(up-to-date edited nil)) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
197 (vc-cvs-state-heuristic file) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
198 state)) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
199 (with-temp-buffer |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
200 (cd (file-name-directory file)) |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
201 (vc-cvs-command t 0 file "status") |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
202 (vc-cvs-parse-status t)))) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
203 |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
204 (defun vc-cvs-state-heuristic (file) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
205 "CVS-specific state heuristic." |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
206 ;; If the file has not changed since checkout, consider it `up-to-date'. |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
207 ;; Otherwise consider it `edited'. |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
208 (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
209 (lastmod (nth 5 (file-attributes file)))) |
93124
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
210 (cond |
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
211 ((equal checkout-time lastmod) 'up-to-date) |
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
212 ((string= (vc-working-revision file) "0") 'added) |
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
213 (t 'edited)))) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
214 |
33560 | 215 (defun vc-cvs-dir-state (dir) |
87424
c0ee02a9ac55
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87139
diff
changeset
|
216 "Find the CVS state of all files in DIR and subdirectories." |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
217 ;; if DIR is not under CVS control, don't do anything. |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
218 (when (file-readable-p (expand-file-name "CVS/Entries" dir)) |
51733
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
219 (if (vc-stay-local-p dir) |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
220 (vc-cvs-dir-state-heuristic dir) |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
221 (let ((default-directory dir)) |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
222 ;; Don't specify DIR in this command, the default-directory is |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
223 ;; enough. Otherwise it might fail with remote repositories. |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
224 (with-temp-buffer |
87442
c5df210848ca
* vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el, vc-mcvs.el, vc-svn.el:
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87432
diff
changeset
|
225 (buffer-disable-undo) ;; Because these buffers can get huge |
87424
c0ee02a9ac55
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87139
diff
changeset
|
226 (vc-cvs-command t 0 nil "status") |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
227 (goto-char (point-min)) |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
228 (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
229 (narrow-to-region (match-beginning 0) (match-end 0)) |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
230 (vc-cvs-parse-status) |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
231 (goto-char (point-max)) |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
232 (widen))))))) |
33560 | 233 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
234 (defun vc-cvs-working-revision (file) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
235 "CVS-specific version of `vc-working-revision'." |
33560 | 236 ;; There is no need to consult RCS headers under CVS, because we |
237 ;; get the workfile version for free when we recognize that a file | |
238 ;; is registered in CVS. | |
239 (vc-cvs-registered file) | |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
240 (vc-file-getprop file 'vc-working-revision)) |
33560 | 241 |
242 (defun vc-cvs-checkout-model (file) | |
243 "CVS-specific version of `vc-checkout-model'." | |
62606
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
244 (if (getenv "CVSREAD") |
33560 | 245 'announce |
62606
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
246 (let ((attrib (file-attributes file))) |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
247 (if (and attrib ;; don't check further if FILE doesn't exist |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
248 ;; If the file is not writable (despite CVSREAD being |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
249 ;; undefined), this is probably because the file is being |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
250 ;; "watched" by other developers. |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
251 ;; (If vc-mistrust-permissions was t, we actually shouldn't |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
252 ;; trust this, but there is no other way to learn this from CVS |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
253 ;; at the moment (version 1.9).) |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
254 (string-match "r-..-..-." (nth 8 attrib))) |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
255 'announce |
6e91e3b4e9bc
(vc-cvs-checkout-model): Handle the case where FILE doesn't exist.
André Spiegel <spiegel@gnu.org>
parents:
60912
diff
changeset
|
256 'implicit)))) |
33560 | 257 |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31384
diff
changeset
|
258 (defun vc-cvs-mode-line-string (file) |
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31384
diff
changeset
|
259 "Return string for placement into the modeline for FILE. |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
260 Compared to the default implementation, this function does two things: |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
261 Handle the special case of a CVS file that is added but not yet |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
262 committed and support display of sticky tags." |
82027
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
263 (let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag)) |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
264 help-echo |
93124
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
265 (string |
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
266 (let ((def-ml (vc-default-mode-line-string 'CVS file))) |
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
267 (setq help-echo |
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
268 (get-text-property 0 'help-echo def-ml)) |
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
269 def-ml))) |
82027
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
270 (propertize |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
271 (if (zerop (length sticky-tag)) |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
272 string |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
273 (setq help-echo (format "%s on the '%s' branch" |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
274 help-echo sticky-tag)) |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
275 (concat string "[" sticky-tag "]")) |
1350ba0c0448
* vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
Dan Nicolaescu <dann@ics.uci.edu>
parents:
81988
diff
changeset
|
276 'help-echo help-echo))) |
31404
f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31384
diff
changeset
|
277 |
35569 | 278 |
33560 | 279 ;;; |
280 ;;; State-changing functions | |
281 ;;; | |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
282 |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
283 (defun vc-cvs-register (files &optional rev comment) |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
284 "Register FILES into the CVS version-control system. |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
285 COMMENT can be used to provide an initial description of FILES. |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
286 |
33560 | 287 `vc-register-switches' and `vc-cvs-register-switches' are passed to |
288 the CVS command (in that order)." | |
92163
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
289 ;; Register the directories if needed. |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
290 (let (dirs) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
291 (dolist (file files) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
292 (and (not (vc-cvs-responsible-p file)) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
293 (vc-cvs-could-register file) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
294 (push (directory-file-name (file-name-directory file)) dirs))) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
295 (if dirs (vc-cvs-register dirs))) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
296 (apply 'vc-cvs-command nil 0 files |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
297 "add" |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
298 (and comment (string-match "[^\t\n ]" comment) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
299 (concat "-m" comment)) |
12326ccb66d6
(vc-cvs-register): Fix registering of directories in multiple file case.
Glenn Morris <rgm@gnu.org>
parents:
91956
diff
changeset
|
300 (vc-switches 'CVS 'register))) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
301 |
33560 | 302 (defun vc-cvs-responsible-p (file) |
303 "Return non-nil if CVS thinks it is responsible for FILE." | |
304 (file-directory-p (expand-file-name "CVS" | |
305 (if (file-directory-p file) | |
306 file | |
307 (file-name-directory file))))) | |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
308 |
51733
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
309 (defun vc-cvs-could-register (file) |
33560 | 310 "Return non-nil if FILE could be registered in CVS. |
51733
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
311 This is only possible if CVS is managing FILE's directory or one of |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
312 its parents." |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
313 (let ((dir file)) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
314 (while (and (stringp dir) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
315 (not (equal dir (setq dir (file-name-directory dir)))) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
316 dir) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
317 (setq dir (if (file-directory-p |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
318 (expand-file-name "CVS/Entries" dir)) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
319 t (directory-file-name dir)))) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
320 (eq dir t))) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
321 |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
322 (defun vc-cvs-checkin (files rev comment) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
323 "CVS-specific version of `vc-backend-checkin'." |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
324 (unless (or (not rev) (vc-cvs-valid-revision-number-p rev)) |
50910
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
325 (if (not (vc-cvs-valid-symbolic-tag-name-p rev)) |
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
326 (error "%s is not a valid symbolic tag name" rev) |
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
327 ;; If the input revison is a valid symbolic tag name, we create it |
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
328 ;; as a branch, commit and switch to it. |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
329 (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev)) |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
330 (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev)) |
81976
69946487f7b5
Fix two variable-reference bugs.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81962
diff
changeset
|
331 (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev)) |
69946487f7b5
Fix two variable-reference bugs.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81962
diff
changeset
|
332 files))) |
69946487f7b5
Fix two variable-reference bugs.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81962
diff
changeset
|
333 (let ((status (apply 'vc-cvs-command nil 1 files |
50910
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
334 "ci" (if rev (concat "-r" rev)) |
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
335 (concat "-m" comment) |
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
336 (vc-switches 'CVS 'checkin)))) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
337 (set-buffer "*vc*") |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
338 (goto-char (point-min)) |
32948
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
339 (when (not (zerop status)) |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
340 ;; Check checkin problem. |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
341 (cond |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
342 ((re-search-forward "Up-to-date check failed" nil t) |
81977
ef9ebdaeea06
vc-cvs-checkin had some reference problems, now fixed.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81976
diff
changeset
|
343 (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge)) |
ef9ebdaeea06
vc-cvs-checkin had some reference problems, now fixed.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81976
diff
changeset
|
344 files) |
87139
f358a2fd5895
Fix buggy calls to `error'.
Deepak Goel <deego@gnufans.org>
parents:
86041
diff
changeset
|
345 (error "%s" (substitute-command-keys |
32948
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
346 (concat "Up-to-date check failed: " |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
347 "type \\[vc-next-action] to merge in changes")))) |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
348 (t |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
349 (pop-to-buffer (current-buffer)) |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
350 (goto-char (point-min)) |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
351 (shrink-window-if-larger-than-buffer) |
3c95af2888f6
(vc-cvs-checkin): Check both status and error message after command.
André Spiegel <spiegel@gnu.org>
parents:
32747
diff
changeset
|
352 (error "Check-in failed")))) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
353 ;; Single-file commit? Then update the revision by parsing the buffer. |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
354 ;; Otherwise we can't necessarily tell what goes with what; clear |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
355 ;; its properties so they have to be refetched. |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
356 (if (= (length files) 1) |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
357 (vc-file-setprop |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
358 (car files) 'vc-working-revision |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
359 (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2)) |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
360 (mapc (lambda (file) (vc-file-clearprops file)) files)) |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
361 ;; Anyway, forget the checkout model of the file, because we might have |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
362 ;; guessed wrong when we found the file. After commit, we can |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
363 ;; tell it from the permissions of the file (see |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
364 ;; vc-cvs-checkout-model). |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
365 (mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil)) |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
366 files) |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
367 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
368 ;; if this was an explicit check-in (does not include creation of |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
369 ;; a branch), remove the sticky tag. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
370 (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev))) |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
371 (vc-cvs-command nil 0 files "update" "-A")))) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
372 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
373 (defun vc-cvs-find-revision (file rev buffer) |
47799
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
374 (apply 'vc-cvs-command |
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
375 buffer 0 file |
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
376 "-Q" ; suppress diagnostic output |
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
377 "update" |
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
378 (and rev (not (string= rev "")) |
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
379 (concat "-r" rev)) |
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
380 "-p" |
50910
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
381 (vc-switches 'CVS 'checkout))) |
47799
0d2f83a91144
(vc-cvs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47758
diff
changeset
|
382 |
81764
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
383 (defun vc-cvs-checkout (file &optional editable rev) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
384 "Checkout a revision of FILE into the working area. |
35132
78bce41f17c5
(vc-cvs-latest-on-branch-p): Removed.
André Spiegel <spiegel@gnu.org>
parents:
33637
diff
changeset
|
385 EDITABLE non-nil means that the file should be writable. |
81764
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
386 REV is the revision to check out." |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
387 (message "Checking out %s..." file) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
388 ;; Change buffers to get local value of vc-checkout-switches. |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
389 (with-current-buffer (or (get-file-buffer file) (current-buffer)) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
390 (if (and (file-exists-p file) (not rev)) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
391 ;; If no revision was specified, just make the file writable |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
392 ;; if necessary (using `cvs-edit' if requested). |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
393 (and editable (not (eq (vc-cvs-checkout-model file) 'implicit)) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
394 (if vc-cvs-use-edit |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
395 (vc-cvs-command nil 0 file "edit") |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
396 (set-file-modes file (logior (file-modes file) 128)) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
397 (if (equal file buffer-file-name) (toggle-read-only -1)))) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
398 ;; Check out a particular revision (or recreate the file). |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
399 (vc-file-setprop file 'vc-working-revision nil) |
81764
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
400 (apply 'vc-cvs-command nil 0 file |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
401 (and editable "-w") |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
402 "update" |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
403 (when rev |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
404 (unless (eq rev t) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
405 ;; default for verbose checkout: clear the |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
406 ;; sticky tag so that the actual update will |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
407 ;; get the head of the trunk |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
408 (if (string= rev "") |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
409 "-A" |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
410 (concat "-r" rev)))) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
411 (vc-switches 'CVS 'checkout))) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
412 (vc-mode-line file)) |
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
413 (message "Checking out %s...done" file)) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
414 |
50923
3eab629b1239
(vc-cvs-mode-line-string): Use vc-default-mode-line-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50910
diff
changeset
|
415 (defun vc-cvs-delete-file (file) |
66551
e72e61aed95a
(vc-cvs-delete-file): Commit the file after removing it.
André Spiegel <spiegel@gnu.org>
parents:
64762
diff
changeset
|
416 (vc-cvs-command nil 0 file "remove" "-f") |
e72e61aed95a
(vc-cvs-delete-file): Commit the file after removing it.
André Spiegel <spiegel@gnu.org>
parents:
64762
diff
changeset
|
417 (vc-cvs-command nil 0 file "commit" "-mRemoved.")) |
50923
3eab629b1239
(vc-cvs-mode-line-string): Use vc-default-mode-line-string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50910
diff
changeset
|
418 |
39001
d13c2139752b
(vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents:
38288
diff
changeset
|
419 (defun vc-cvs-revert (file &optional contents-done) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
420 "Revert FILE to the working revision on which it was based." |
81764
12e5ff38b024
(vc-cvs-revert): Use vc-default-revert.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
421 (vc-default-revert 'CVS file contents-done) |
39001
d13c2139752b
(vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents:
38288
diff
changeset
|
422 (unless (eq (vc-checkout-model file) 'implicit) |
d13c2139752b
(vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents:
38288
diff
changeset
|
423 (if vc-cvs-use-edit |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
424 (vc-cvs-command nil 0 file "unedit") |
39001
d13c2139752b
(vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents:
38288
diff
changeset
|
425 ;; Make the file read-only by switching off all w-bits |
d13c2139752b
(vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents:
38288
diff
changeset
|
426 (set-file-modes file (logand (file-modes file) 3950))))) |
33560 | 427 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
428 (defun vc-cvs-merge (file first-revision &optional second-revision) |
33560 | 429 "Merge changes into current working copy of FILE. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
430 The changes are between FIRST-REVISION and SECOND-REVISION." |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
431 (vc-cvs-command nil 0 file |
33560 | 432 "update" "-kk" |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
433 (concat "-j" first-revision) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
434 (concat "-j" second-revision)) |
33560 | 435 (vc-file-setprop file 'vc-state 'edited) |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
436 (with-current-buffer (get-buffer "*vc*") |
33560 | 437 (goto-char (point-min)) |
438 (if (re-search-forward "conflicts during merge" nil t) | |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
439 (progn |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
440 (vc-file-setprop file 'vc-state 'conflict) |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
441 ;; signal error |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
442 1) |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
443 (vc-file-setprop file 'vc-state 'edited) |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
444 ;; signal success |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
445 0))) |
33560 | 446 |
447 (defun vc-cvs-merge-news (file) | |
448 "Merge in any new changes made to FILE." | |
449 (message "Merging changes into %s..." file) | |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
450 ;; (vc-file-setprop file 'vc-working-revision nil) |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
451 (vc-file-setprop file 'vc-checkout-time 0) |
87739
28dc34f6a246
* vc.el (vc-update): Resolve conflicts if necessary instead of
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87649
diff
changeset
|
452 (vc-cvs-command nil nil file "update") |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
453 ;; Analyze the merge result reported by CVS, and set |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
454 ;; file properties accordingly. |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
455 (with-current-buffer (get-buffer "*vc*") |
33560 | 456 (goto-char (point-min)) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
457 ;; get new working revision |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
458 (if (re-search-forward |
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
459 "^Merging differences between [0-9.]* and \\([0-9.]*\\) into" nil t) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
460 (vc-file-setprop file 'vc-working-revision (match-string 1)) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
461 (vc-file-setprop file 'vc-working-revision nil)) |
33560 | 462 ;; get file status |
463 (prog1 | |
464 (if (eq (buffer-size) 0) | |
465 0 ;; there were no news; indicate success | |
466 (if (re-search-forward | |
467 (concat "^\\([CMUP] \\)?" | |
468 (regexp-quote (file-name-nondirectory file)) | |
469 "\\( already contains the differences between \\)?") | |
470 nil t) | |
471 (cond | |
472 ;; Merge successful, we are in sync with repository now | |
473 ((or (match-string 2) | |
474 (string= (match-string 1) "U ") | |
475 (string= (match-string 1) "P ")) | |
476 (vc-file-setprop file 'vc-state 'up-to-date) | |
477 (vc-file-setprop file 'vc-checkout-time | |
478 (nth 5 (file-attributes file))) | |
479 0);; indicate success to the caller | |
480 ;; Merge successful, but our own changes are still in the file | |
481 ((string= (match-string 1) "M ") | |
482 (vc-file-setprop file 'vc-state 'edited) | |
483 0);; indicate success to the caller | |
484 ;; Conflicts detected! | |
485 (t | |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
486 (vc-file-setprop file 'vc-state 'conflict) |
33560 | 487 1);; signal the error to the caller |
488 ) | |
489 (pop-to-buffer "*vc*") | |
490 (error "Couldn't analyze cvs update result"))) | |
491 (message "Merging changes into %s...done" file)))) | |
492 | |
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:
87427
diff
changeset
|
493 (defun vc-cvs-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:
87427
diff
changeset
|
494 "Modify the change comments for FILES on a specified REV. |
315124ffb889
* (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87427
diff
changeset
|
495 Will fail unless you have administrative privileges on the repo." |
93867
520490ae1b9a
* vc-rcs.el (vc-rcs-modify-change-comment):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93461
diff
changeset
|
496 (vc-cvs-command nil 0 files "admin" (concat "-m" rev ":" comment))) |
35569 | 497 |
33560 | 498 ;;; |
499 ;;; History functions | |
500 ;;; | |
501 | |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
502 (defun vc-cvs-print-log (files &optional buffer) |
87427
1aea302af710
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
503 "Get change logs associated with FILES." |
1aea302af710
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87424
diff
changeset
|
504 ;; It's just the catenation of the individual logs. |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
505 (vc-cvs-command |
54465
2e4ddb8bfffd
(vc-cvs-print-log, vc-cvs-diff): Add optional BUFFER argument.
André Spiegel <spiegel@gnu.org>
parents:
53631
diff
changeset
|
506 buffer |
86002
613df1ba1584
* vc.el (vc-diff-internal): Make the *vc-diff* buffer read only.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85458
diff
changeset
|
507 (if (vc-stay-local-p files) 'async 0) |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
508 files "log")) |
33560 | 509 |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
510 (defun vc-cvs-wash-log () |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
511 "Remove all non-comment information from log output." |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
512 (vc-call-backend 'RCS 'wash-log) |
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
513 nil) |
33560 | 514 |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
515 (defun vc-cvs-diff (files &optional oldvers newvers buffer) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
516 "Get a difference report using CVS between two revisions of FILE." |
86041
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
517 (let* ((async (and (not vc-disable-async-diff) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
518 (vc-stay-local-p files))) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
519 (invoke-cvs-diff-list nil) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
520 status) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
521 ;; Look through the file list and see if any files have backups |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
522 ;; that can be used to do a plain "diff" instead of "cvs diff". |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
523 (dolist (file files) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
524 (let ((ov oldvers) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
525 (nv newvers)) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
526 (when (or (not ov) (string-equal ov "")) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
527 (setq ov (vc-working-revision file))) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
528 (when (string-equal nv "") |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
529 (setq nv nil)) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
530 (let ((file-oldvers (vc-version-backup-file file ov)) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
531 (file-newvers (if (not nv) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
532 file |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
533 (vc-version-backup-file file nv))) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
534 (coding-system-for-read (vc-coding-system-for-diff file))) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
535 (if (and file-oldvers file-newvers) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
536 (progn |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
537 (apply 'vc-do-command (or buffer "*vc-diff*") 1 "diff" nil |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
538 (append (if (listp diff-switches) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
539 diff-switches |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
540 (list diff-switches)) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
541 (if (listp vc-diff-switches) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
542 vc-diff-switches |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
543 (list vc-diff-switches)) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
544 (list (file-relative-name file-oldvers) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
545 (file-relative-name file-newvers)))) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
546 (setq status 0)) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
547 (push file invoke-cvs-diff-list))))) |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
548 (when invoke-cvs-diff-list |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
549 (setq status (apply 'vc-cvs-command (or buffer "*vc-diff*") |
50910
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
550 (if async 'async 1) |
86041
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
551 invoke-cvs-diff-list "diff" |
50910
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
552 (and oldvers (concat "-r" oldvers)) |
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
553 (and newvers (concat "-r" newvers)) |
8c4130079acf
(vc-cvs-register, vc-cvs-checkin, vc-cvs-find-version, vc-cvs-diff)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50909
diff
changeset
|
554 (vc-switches 'CVS 'diff)))) |
86041
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
555 (if async 1 status))) ; async diff, pessimistic assumption |
62a404545514
(vc-cvs-diff): If backup files exist, diff them
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86002
diff
changeset
|
556 |
81820
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
557 (defconst vc-cvs-annotate-first-line-re "^[0-9]") |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
558 |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
559 (defun vc-cvs-annotate-process-filter (process string) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
560 (setq string (concat (process-get process 'output) string)) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
561 (if (not (string-match vc-cvs-annotate-first-line-re string)) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
562 ;; Still waiting for the first real line. |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
563 (process-put process 'output string) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
564 (let ((vc-filter (process-get process 'vc-filter))) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
565 (set-process-filter process vc-filter) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
566 (funcall vc-filter process (substring string (match-beginning 0)))))) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
567 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
568 (defun vc-cvs-annotate-command (file buffer &optional revision) |
33545
5411250e7971
(vc-cvs-annotate-command): New optional arg VERSION. Use
André Spiegel <spiegel@gnu.org>
parents:
32959
diff
changeset
|
569 "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER. |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
570 Optional arg REVISION is a revision to annotate from." |
81820
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
571 (vc-cvs-command buffer |
86002
613df1ba1584
* vc.el (vc-diff-internal): Make the *vc-diff* buffer read only.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85458
diff
changeset
|
572 (if (vc-stay-local-p file) |
81820
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
573 'async 0) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
574 file "annotate" |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
575 (if revision (concat "-r" revision))) |
81820
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
576 ;; Strip the leading few lines. |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
577 (let ((proc (get-buffer-process buffer))) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
578 (if proc |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
579 ;; If running asynchronously, use a process filter. |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
580 (progn |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
581 (process-put proc 'vc-filter (process-filter proc)) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
582 (set-process-filter proc 'vc-cvs-annotate-process-filter)) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
583 (with-current-buffer buffer |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
584 (goto-char (point-min)) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
585 (re-search-forward vc-cvs-annotate-first-line-re) |
37a7f9bddc45
(vc-functions): Clear up the cache when reloading the file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81764
diff
changeset
|
586 (delete-region (point-min) (1- (point))))))) |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
587 |
40171
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
588 (defun vc-cvs-annotate-current-time () |
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
589 "Return the current time, based at midnight of the current day, and |
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
590 encoded as fractional days." |
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
591 (vc-annotate-convert-time |
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
592 (apply 'encode-time 0 0 0 (nthcdr 3 (decode-time (current-time)))))) |
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
593 |
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
594 (defun vc-cvs-annotate-time () |
91eda91380cb
New scaling algorithm for vc-annotate.
André Spiegel <spiegel@gnu.org>
parents:
40125
diff
changeset
|
595 "Return the time of the next annotation (as fraction of days) |
42206 | 596 systime, or nil if there is none." |
57916
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
597 (let* ((bol (point)) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
598 (cache (get-text-property bol 'vc-cvs-annotate-time)) |
84583
52ca2a6a41bf
(vc-cvs-annotate-time): Use inhibit-read-only and inhibit-modification-hooks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
599 (inhibit-read-only t) |
52ca2a6a41bf
(vc-cvs-annotate-time): Use inhibit-read-only and inhibit-modification-hooks.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
82140
diff
changeset
|
600 (inhibit-modification-hooks t)) |
57916
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
601 (cond |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
602 (cache) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
603 ((looking-at |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
604 "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ") |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
605 (let ((day (string-to-number (match-string 1))) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
606 (month (cdr (assq (intern (match-string 2)) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
607 '((Jan . 1) (Feb . 2) (Mar . 3) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
608 (Apr . 4) (May . 5) (Jun . 6) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
609 (Jul . 7) (Aug . 8) (Sep . 9) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
610 (Oct . 10) (Nov . 11) (Dec . 12))))) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
611 (year (let ((tmp (string-to-number (match-string 3)))) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
612 ;; Years 0..68 are 2000..2068. |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
613 ;; Years 69..99 are 1969..1999. |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
614 (+ (cond ((> 69 tmp) 2000) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
615 ((> 100 tmp) 1900) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
616 (t 0)) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
617 tmp)))) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
618 (put-text-property |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
619 bol (1+ bol) 'vc-cvs-annotate-time |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
620 (setq cache (cons |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
621 ;; Position at end makes for nicer overlay result. |
79690
be4e5f45a3eb
(vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78359
diff
changeset
|
622 ;; Don't put actual buffer pos here, but only relative |
be4e5f45a3eb
(vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78359
diff
changeset
|
623 ;; distance, so we don't ever move backward in the |
be4e5f45a3eb
(vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78359
diff
changeset
|
624 ;; goto-char below, even if the text is moved. |
be4e5f45a3eb
(vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78359
diff
changeset
|
625 (- (match-end 0) (match-beginning 0)) |
57916
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
626 (vc-annotate-convert-time |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
627 (encode-time 0 0 0 day month year)))))))) |
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
628 (when cache |
79690
be4e5f45a3eb
(vc-cvs-annotate-time): Don't move backward when text
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78359
diff
changeset
|
629 (goto-char (+ bol (car cache))) ; Fontify from here to eol. |
57916
990dbd4941c8
(vc-cvs-local-month-numbers): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
57913
diff
changeset
|
630 (cdr cache)))) ; days (float) |
35569 | 631 |
53631
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
632 (defun vc-cvs-annotate-extract-revision-at-line () |
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
633 (save-excursion |
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
634 (beginning-of-line) |
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
635 (if (re-search-forward "^\\([0-9]+\\.[0-9]+\\(\\.[0-9]+\\)*\\) +(" |
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
636 (line-end-position) t) |
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
637 (match-string-no-properties 1) |
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
638 nil))) |
74e44ab76fa5
* vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New
André Spiegel <spiegel@gnu.org>
parents:
52717
diff
changeset
|
639 |
33560 | 640 ;;; |
641 ;;; Snapshot system | |
642 ;;; | |
643 | |
644 (defun vc-cvs-create-snapshot (dir name branchp) | |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
645 "Assign to DIR's current revision a given NAME. |
33560 | 646 If BRANCHP is non-nil, the name is created as a branch (and the current |
647 workspace is immediately moved to that new branch)." | |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
648 (vc-cvs-command nil 0 dir "tag" "-c" (if branchp "-b") name) |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
649 (when branchp (vc-cvs-command nil 0 dir "update" "-r" name))) |
33560 | 650 |
651 (defun vc-cvs-retrieve-snapshot (dir name update) | |
652 "Retrieve a snapshot at and below DIR. | |
653 NAME is the name of the snapshot; if it is empty, do a `cvs update'. | |
654 If UPDATE is non-nil, then update (resynch) any affected buffers." | |
655 (with-current-buffer (get-buffer-create "*vc*") | |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
656 (let ((default-directory dir) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
657 (sticky-tag)) |
33560 | 658 (erase-buffer) |
659 (if (or (not name) (string= name "")) | |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
660 (vc-cvs-command t 0 nil "update") |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
661 (vc-cvs-command t 0 nil "update" "-r" name) |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
662 (setq sticky-tag name)) |
33560 | 663 (when update |
664 (goto-char (point-min)) | |
665 (while (not (eobp)) | |
666 (if (looking-at "\\([CMUP]\\) \\(.*\\)") | |
667 (let* ((file (expand-file-name (match-string 2) dir)) | |
668 (state (match-string 1)) | |
669 (buffer (find-buffer-visiting file))) | |
670 (when buffer | |
671 (cond | |
672 ((or (string= state "U") | |
673 (string= state "P")) | |
674 (vc-file-setprop file 'vc-state 'up-to-date) | |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
675 (vc-file-setprop file 'vc-working-revision nil) |
33560 | 676 (vc-file-setprop file 'vc-checkout-time |
677 (nth 5 (file-attributes file)))) | |
678 ((or (string= state "M") | |
679 (string= state "C")) | |
680 (vc-file-setprop file 'vc-state 'edited) | |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
681 (vc-file-setprop file 'vc-working-revision nil) |
33560 | 682 (vc-file-setprop file 'vc-checkout-time 0))) |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
683 (vc-file-setprop file 'vc-cvs-sticky-tag sticky-tag) |
33560 | 684 (vc-resynch-buffer file t t)))) |
685 (forward-line 1)))))) | |
686 | |
35569 | 687 |
33560 | 688 ;;; |
689 ;;; Miscellaneous | |
690 ;;; | |
691 | |
51733
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
692 (defalias 'vc-cvs-make-version-backups-p 'vc-stay-local-p |
50645
4b6925d144de
(vc-cvs-dir-state): Use vc-cvs-command.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50453
diff
changeset
|
693 "Return non-nil if version backups should be made for FILE.") |
33560 | 694 |
695 (defun vc-cvs-check-headers () | |
696 "Check if the current file has any headers in it." | |
697 (save-excursion | |
698 (goto-char (point-min)) | |
699 (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\ | |
700 \\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t))) | |
701 | |
35569 | 702 |
33560 | 703 ;;; |
704 ;;; Internal functions | |
705 ;;; | |
706 | |
91956
7bc22dad5f9a
Make sure all backends support vc-BACKEND-root.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87739
diff
changeset
|
707 (defun vc-cvs-root (dir) |
7bc22dad5f9a
Make sure all backends support vc-BACKEND-root.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87739
diff
changeset
|
708 (vc-find-root dir "CVS" t)) |
7bc22dad5f9a
Make sure all backends support vc-BACKEND-root.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
87739
diff
changeset
|
709 |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
710 (defun vc-cvs-command (buffer okstatus files &rest flags) |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
711 "A wrapper around `vc-do-command' for use in vc-cvs.el. |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
712 The difference to vc-do-command is that this function always invokes `cvs', |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
713 and that it passes `vc-cvs-global-switches' to it before FLAGS." |
81962
0744b309302b
Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
81821
diff
changeset
|
714 (apply 'vc-do-command buffer okstatus "cvs" files |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
715 (if (stringp vc-cvs-global-switches) |
44197
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
716 (cons vc-cvs-global-switches flags) |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
717 (append vc-cvs-global-switches |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
718 flags)))) |
e255f8fa4f62
(vc-cvs-global-switches): New user option.
André Spiegel <spiegel@gnu.org>
parents:
44104
diff
changeset
|
719 |
51733
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
720 (defalias 'vc-cvs-stay-local-p 'vc-stay-local-p) ;Back-compatibility. |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
721 |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
722 (defun vc-cvs-repository-hostname (dirname) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
723 "Hostname of the CVS server associated to workarea DIRNAME." |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
724 (let ((rootname (expand-file-name "CVS/Root" dirname))) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
725 (when (file-readable-p rootname) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
726 (with-temp-buffer |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
727 (let ((coding-system-for-read |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
728 (or file-name-coding-system |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
729 default-file-name-coding-system))) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
730 (vc-insert-file rootname)) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
731 (goto-char (point-min)) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
732 (nth 2 (vc-cvs-parse-root |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
733 (buffer-substring (point) |
2b72fd42f02e
(vc-cvs-repository-hostname): New operation.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
51164
diff
changeset
|
734 (line-end-position)))))))) |
50668
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
735 |
50898
8806616471e2
(vc-cvs-dired-state-info): Use `added' for added files and
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50671
diff
changeset
|
736 (defun vc-cvs-parse-root (root) |
50668
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
737 "Split CVS ROOT specification string into a list of fields. |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
738 A CVS root specification of the form |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
739 [:METHOD:][[USER@]HOSTNAME:]/path/to/repository |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
740 is converted to a normalized record with the following structure: |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
741 \(METHOD USER HOSTNAME CVS-ROOT). |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
742 The default METHOD for a CVS root of the form |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
743 /path/to/repository |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
744 is `local'. |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
745 The default METHOD for a CVS root of the form |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
746 [USER@]HOSTNAME:/path/to/repository |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
747 is `ext'. |
60912
4a2ea521d778
* vc-cvs.el: Replace `illegal' with `invalid'.
Werner LEMBERG <wl@gnu.org>
parents:
59996
diff
changeset
|
748 For an empty string, nil is returned (invalid CVS root)." |
50668
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
749 ;; Split CVS root into colon separated fields (0-4). |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
750 ;; The `x:' makes sure, that leading colons are not lost; |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
751 ;; `HOST:/PATH' is then different from `:METHOD:/PATH'. |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
752 (let* ((root-list (cdr (split-string (concat "x:" root) ":"))) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
753 (len (length root-list)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
754 ;; All syntactic varieties will get a proper METHOD. |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
755 (root-list |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
756 (cond |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
757 ((= len 0) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
758 ;; Invalid CVS root |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
759 nil) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
760 ((= len 1) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
761 ;; Simple PATH => method `local' |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
762 (cons "local" |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
763 (cons nil root-list))) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
764 ((= len 2) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
765 ;; [USER@]HOST:PATH => method `ext' |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
766 (and (not (equal (car root-list) "")) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
767 (cons "ext" root-list))) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
768 ((= len 3) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
769 ;; :METHOD:PATH |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
770 (cons (cadr root-list) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
771 (cons nil (cddr root-list)))) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
772 (t |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
773 ;; :METHOD:[USER@]HOST:PATH |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
774 (cdr root-list))))) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
775 (if root-list |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
776 (let ((method (car root-list)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
777 (uhost (or (cadr root-list) "")) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
778 (root (nth 2 root-list)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
779 user host) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
780 ;; Split USER@HOST |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
781 (if (string-match "\\(.*\\)@\\(.*\\)" uhost) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
782 (setq user (match-string 1 uhost) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
783 host (match-string 2 uhost)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
784 (setq host uhost)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
785 ;; Remove empty HOST |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
786 (and (equal host "") |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
787 (setq host)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
788 ;; Fix windows style CVS root `:local:C:\\project\\cvs\\some\\dir' |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
789 (and host |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
790 (equal method "local") |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
791 (setq root (concat host ":" root) host)) |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
792 ;; Normalize CVS root record |
01d84e9d30e0
Patch by Wolfgang Scherer <Wolfgang.Scherer@gmx.de>
André Spiegel <spiegel@gnu.org>
parents:
50645
diff
changeset
|
793 (list method user host root))))) |
33560 | 794 |
93160
22d835ffa8f7
(vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93149
diff
changeset
|
795 ;; XXX: This does not work correctly for subdirectories. "cvs status" |
22d835ffa8f7
(vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93149
diff
changeset
|
796 ;; information is context sensitive, it contains lines like: |
22d835ffa8f7
(vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93149
diff
changeset
|
797 ;; cvs status: Examining DIRNAME |
22d835ffa8f7
(vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93149
diff
changeset
|
798 ;; and the file entries after that don't show the full path. |
22d835ffa8f7
(vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93149
diff
changeset
|
799 ;; Because of this vc-dired only shows changed files at the top level |
22d835ffa8f7
(vc-cvs-parse-status): Note there are problems with
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93149
diff
changeset
|
800 ;; for CVS. |
33560 | 801 (defun vc-cvs-parse-status (&optional full) |
802 "Parse output of \"cvs status\" command in the current buffer. | |
803 Set file properties accordingly. Unless FULL is t, parse only | |
87450
71fc7b1db920
* vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87449
diff
changeset
|
804 essential information. Note that this can never set the 'ignored |
71fc7b1db920
* vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87449
diff
changeset
|
805 state." |
93242
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
806 (let (file status missing) |
33560 | 807 (goto-char (point-min)) |
87450
71fc7b1db920
* vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87449
diff
changeset
|
808 (while (looking-at "? \\(.*\\)") |
71fc7b1db920
* vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87449
diff
changeset
|
809 (setq file (expand-file-name (match-string 1))) |
71fc7b1db920
* vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87449
diff
changeset
|
810 (vc-file-setprop file 'vc-state 'unregistered) |
71fc7b1db920
* vc-hooks.el (vc-state): Document new 'ignored and 'unregistered
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
87449
diff
changeset
|
811 (forward-line 1)) |
93242
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
812 (when (re-search-forward "^File: " nil t) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
813 (when (setq missing (looking-at "no file ")) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
814 (goto-char (match-end 0))) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
815 (cond |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
816 ((re-search-forward "\\=\\([^ \t]+\\)" nil t) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
817 (setq file (expand-file-name (match-string 1))) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
818 (vc-file-setprop file 'vc-backend 'CVS) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
819 (if (not (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
820 (setq status "Unknown") |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
821 (setq status (match-string 1))) |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
822 (when (and full |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
823 (re-search-forward |
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
824 "\\(RCS Version\\|RCS Revision\\|Repository revision\\):\ |
33560 | 825 \[\t ]+\\([0-9.]+\\)" |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
826 nil t)) |
93242
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
827 (vc-file-setprop file 'vc-latest-revision (match-string 2))) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
828 (vc-file-setprop |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
829 file 'vc-state |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
830 (cond |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
831 ((string-match "Up-to-date" status) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
832 (vc-file-setprop file 'vc-checkout-time |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
833 (nth 5 (file-attributes file))) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
834 'up-to-date) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
835 ((string-match "Locally Modified" status) 'edited) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
836 ((string-match "Needs Merge" status) 'needs-merge) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
837 ((string-match "Needs \\(Checkout\\|Patch\\)" status) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
838 (if missing 'missing 'needs-patch)) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
839 ((string-match "Locally Added" status) 'added) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
840 ((string-match "Locally Removed" status) 'removed) |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
841 ((string-match "File had conflicts " status) 'conflict) |
93242
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
842 (t 'edited)))))))) |
33560 | 843 |
844 (defun vc-cvs-dir-state-heuristic (dir) | |
845 "Find the CVS state of all files in DIR, using only local information." | |
846 (with-temp-buffer | |
50453
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
847 (vc-cvs-get-entries dir) |
33560 | 848 (goto-char (point-min)) |
849 (while (not (eobp)) | |
44104
985526b08270
(vc-cvs-registered, vc-cvs-dir-state-heuristic):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44005
diff
changeset
|
850 ;; CVS-removed files are not taken under VC control. |
985526b08270
(vc-cvs-registered, vc-cvs-dir-state-heuristic):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44005
diff
changeset
|
851 (when (looking-at "/\\([^/]*\\)/[^/-]") |
33560 | 852 (let ((file (expand-file-name (match-string 1) dir))) |
853 (unless (vc-file-getprop file 'vc-state) | |
854 (vc-cvs-parse-entry file t)))) | |
855 (forward-line 1)))) | |
856 | |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
857 ;; XXX Experimental function for the vc-dired replacement. |
94003
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
858 (defun vc-cvs-after-dir-status (update-function) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
859 ;; Heavily inspired by vc-cvs-parse-status. AKA a quick hack. |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
860 ;; It needs a lot of testing. |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
861 (let ((status nil) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
862 (status-str nil) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
863 (file nil) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
864 (result nil) |
93242
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
865 (missing nil) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
866 (subdir default-directory)) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
867 (goto-char (point-min)) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
868 (while |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
869 ;; Look for either a file entry, an unregistered file, or a |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
870 ;; directory change. |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
871 (re-search-forward |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
872 "\\(^=+\n\\([^=c?\n].*\n\\|\n\\)+\\)\\|\\(\\(^?? .*\n\\)+\\)\\|\\(^cvs status: Examining .*\n\\)" |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
873 nil t) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
874 ;; XXX: get rid of narrowing here. |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
875 (narrow-to-region (match-beginning 0) (match-end 0)) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
876 (goto-char (point-min)) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
877 ;; The subdir |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
878 (when (looking-at "cvs status: Examining \\(.+\\)") |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
879 (setq subdir (expand-file-name (match-string 1)))) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
880 ;; Unregistered files |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
881 (while (looking-at "? \\(.*\\)") |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
882 (setq file (file-relative-name |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
883 (expand-file-name (match-string 1) subdir))) |
93461
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93382
diff
changeset
|
884 (push (list file 'unregistered) result) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
885 (forward-line 1)) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
886 ;; A file entry. |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
887 (when (re-search-forward "^File: " nil t) |
93242
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
888 (when (setq missing (looking-at "no file ")) |
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
889 (goto-char (match-end 0))) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
890 (cond |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
891 ((re-search-forward "\\=\\([^ \t]+\\)" nil t) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
892 (setq file (file-relative-name |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
893 (expand-file-name (match-string 1) subdir))) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
894 (if (not (re-search-forward "\\=[ \t]+Status: \\(.*\\)" nil t)) |
93461
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93382
diff
changeset
|
895 (push (list file 'unregistered) result) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
896 (setq status-str (match-string 1)) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
897 (setq status |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
898 (cond |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
899 ((string-match "Up-to-date" status-str) 'up-to-date) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
900 ((string-match "Locally Modified" status-str) 'edited) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
901 ((string-match "Needs Merge" status-str) 'needs-merge) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
902 ((string-match "Needs \\(Checkout\\|Patch\\)" status-str) |
93242
0dcb59446144
(vc-cvs-parse-status, vc-cvs-after-dir-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93175
diff
changeset
|
903 (if missing 'missing 'needs-patch)) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
904 ((string-match "Locally Added" status-str) 'added) |
93175
7b2ec9fec56e
(vc-cvs-after-dir-status, vc-cvs-parse-status): Detect
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93160
diff
changeset
|
905 ((string-match "Locally Removed" status-str) 'removed) |
93956
bfc762f0b49c
* vc-hooks.el (vc-state): Add new state `conflict'.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93941
diff
changeset
|
906 ((string-match "File had conflicts " status-str) 'conflict) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
907 (t 'edited))) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
908 (unless (eq status 'up-to-date) |
93461
3afeea9a48a3
* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93382
diff
changeset
|
909 (push (list file status) result)))))) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
910 (goto-char (point-max)) |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
911 (widen)) |
94003
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
912 (funcall update-function result))) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
913 |
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
914 ;; XXX Experimental function for the vc-dired replacement. |
94003
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
915 (defun vc-cvs-dir-status (dir update-function) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
916 "Create a list of conses (file . state) for DIR." |
93382
8e46096e0cb3
* vc.el (vc-status-menu-map, vc-status-mode-map): Bind vc-revert.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93242
diff
changeset
|
917 (vc-cvs-command (current-buffer) 'async dir "status") |
8e46096e0cb3
* vc.el (vc-status-menu-map, vc-status-mode-map): Bind vc-revert.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93242
diff
changeset
|
918 (vc-exec-after |
94003
2ecb2ea8d5b5
Change `dir-status' to not take (and pass) status-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93956
diff
changeset
|
919 `(vc-cvs-after-dir-status (quote ,update-function)))) |
93149
5ec26b66bbe8
(vc-cvs-after-dir-status, vc-cvs-dir-status):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
93124
diff
changeset
|
920 |
50453
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
921 (defun vc-cvs-get-entries (dir) |
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
922 "Insert the CVS/Entries file from below DIR into the current buffer. |
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
923 This function ensures that the correct coding system is used for that, |
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
924 which may not be the one that is used for the files' contents. |
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
925 CVS/Entries should only be accessed through this function." |
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
926 (let ((coding-system-for-read (or file-name-coding-system |
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
927 default-file-name-coding-system))) |
e499daf7fb22
(vc-cvs-get-entries): New function that uses the right coding system for
André Spiegel <spiegel@gnu.org>
parents:
50321
diff
changeset
|
928 (vc-insert-file (expand-file-name "CVS/Entries" dir)))) |
57913
f5d7d9bbc021
(vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
54465
diff
changeset
|
929 |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
930 (defun vc-cvs-valid-symbolic-tag-name-p (tag) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
931 "Return non-nil if TAG is a valid symbolic tag name." |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
932 ;; According to the CVS manual, a valid symbolic tag must start with |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
933 ;; an uppercase or lowercase letter and can contain uppercase and |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
934 ;; lowercase letters, digits, `-', and `_'. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
935 (and (string-match "^[a-zA-Z]" tag) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
936 (not (string-match "[^a-z0-9A-Z-_]" tag)))) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
937 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
938 (defun vc-cvs-valid-revision-number-p (tag) |
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
939 "Return non-nil if TAG is a valid revision number." |
44462
6eb10924e77f
(vc-cvs-valid-version-number-p): New function.
Sam Steingold <sds@gnu.org>
parents:
44436
diff
changeset
|
940 (and (string-match "^[0-9]" tag) |
6eb10924e77f
(vc-cvs-valid-version-number-p): New function.
Sam Steingold <sds@gnu.org>
parents:
44436
diff
changeset
|
941 (not (string-match "[^0-9.]" tag)))) |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
942 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
943 (defun vc-cvs-parse-sticky-tag (match-type match-tag) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
944 "Parse and return the sticky tag as a string. |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
945 `match-data' is protected." |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
946 (let ((data (match-data)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
947 (tag) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
948 (type (cond ((string= match-type "D") 'date) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
949 ((string= match-type "T") |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
950 (if (vc-cvs-valid-symbolic-tag-name-p match-tag) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
951 'symbolic-name |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
952 'revision-number)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
953 (t nil)))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
954 (unwind-protect |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
955 (progn |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
956 (cond |
46163 | 957 ;; Sticky Date tag. Convert to a proper date value (`encode-time') |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
958 ((eq type 'date) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
959 (string-match |
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
960 "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
961 match-tag) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
962 (let* ((year-tmp (string-to-number (match-string 1 match-tag))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
963 (month (string-to-number (match-string 2 match-tag))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
964 (day (string-to-number (match-string 3 match-tag))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
965 (hour (string-to-number (match-string 4 match-tag))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
966 (min (string-to-number (match-string 5 match-tag))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
967 (sec (string-to-number (match-string 6 match-tag))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
968 ;; Years 0..68 are 2000..2068. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
969 ;; Years 69..99 are 1969..1999. |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
970 (year (+ (cond ((> 69 year-tmp) 2000) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
971 ((> 100 year-tmp) 1900) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
972 (t 0)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
973 year-tmp))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
974 (setq tag (encode-time sec min hour day month year)))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
975 ;; Sticky Tag name or revision number |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
976 ((eq type 'symbolic-name) (setq tag match-tag)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
977 ((eq type 'revision-number) (setq tag match-tag)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
978 ;; Default is no sticky tag at all |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
979 (t nil)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
980 (cond ((eq vc-cvs-sticky-tag-display nil) nil) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
981 ((eq vc-cvs-sticky-tag-display t) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
982 (cond ((eq type 'date) (format-time-string |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
983 vc-cvs-sticky-date-format-string |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
984 tag)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
985 ((eq type 'symbolic-name) tag) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
986 ((eq type 'revision-number) tag) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
987 (t nil))) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
988 ((functionp vc-cvs-sticky-tag-display) |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
989 (funcall vc-cvs-sticky-tag-display tag type)) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
990 (t nil))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
991 |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
992 (set-match-data data)))) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
993 |
33560 | 994 (defun vc-cvs-parse-entry (file &optional set-state) |
995 "Parse a line from CVS/Entries. | |
996 Compare modification time to that of the FILE, set file properties | |
997 accordingly. However, `vc-state' is set only if optional arg SET-STATE | |
998 is non-nil." | |
999 (cond | |
1000 ;; entry for a "locally added" file (not yet committed) | |
1001 ((looking-at "/[^/]+/0/") | |
87507
fd67c20d4a7e
(vc-cvs-parse-entry): Set the vc-backend property.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87450
diff
changeset
|
1002 (vc-file-setprop file 'vc-backend 'CVS) |
33560 | 1003 (vc-file-setprop file 'vc-checkout-time 0) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
1004 (vc-file-setprop file 'vc-working-revision "0") |
93124
97c5b398eee4
* vc-hooks.el (vc-default-mode-line-string): Add case for added files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93118
diff
changeset
|
1005 (if set-state (vc-file-setprop file 'vc-state 'added))) |
33560 | 1006 ;; normal entry |
1007 ((looking-at | |
1008 (concat "/[^/]+" | |
1009 ;; revision | |
1010 "/\\([^/]*\\)" | |
50321
17ff9d10125f
(vc-cvs-parse-entry): Make sure a file with conflicts
Andreas Schwab <schwab@suse.de>
parents:
49822
diff
changeset
|
1011 ;; timestamp and optional conflict field |
17ff9d10125f
(vc-cvs-parse-entry): Make sure a file with conflicts
Andreas Schwab <schwab@suse.de>
parents:
49822
diff
changeset
|
1012 "/\\([^/]*\\)/" |
43447
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
1013 ;; options |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
1014 "\\([^/]*\\)/" |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
1015 ;; sticky tag |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
1016 "\\(.\\|\\)" ;Sticky tag type (date or tag name, could be empty) |
79cf46e34420
Patch by Martin.Lorentzson@telia.com.
André Spiegel <spiegel@gnu.org>
parents:
42657
diff
changeset
|
1017 "\\(.*\\)")) ;Sticky tag |
87507
fd67c20d4a7e
(vc-cvs-parse-entry): Set the vc-backend property.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
87450
diff
changeset
|
1018 (vc-file-setprop file 'vc-backend 'CVS) |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
84583
diff
changeset
|
1019 (vc-file-setprop file 'vc-working-revision (match-string 1)) |
44104
985526b08270
(vc-cvs-registered, vc-cvs-dir-state-heuristic):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44005
diff
changeset
|
1020 (vc-file-setprop file 'vc-cvs-sticky-tag |
57913
f5d7d9bbc021
(vc-cvs-annotate-command): Delete extraneous lines from beginning of buffer.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
54465
diff
changeset
|
1021 (vc-cvs-parse-sticky-tag (match-string 4) |
52624
2b71ed49b8c6
(vc-cvs-parse-entry): Don't require parse-time, because it's
André Spiegel <spiegel@gnu.org>
parents:
52602
diff
changeset
|
1022 (match-string 5))) |
52602
04c9b596cce6
(vc-cvs-parse-entry): Restore the code to compare time stamps
André Spiegel <spiegel@gnu.org>
parents:
52401
diff
changeset
|
1023 ;; Compare checkout time and modification time. |
04c9b596cce6
(vc-cvs-parse-entry): Restore the code to compare time stamps
André Spiegel <spiegel@gnu.org>
parents:
52401
diff
changeset
|
1024 ;; This is intentionally different from the algorithm that CVS uses |
52624
2b71ed49b8c6
(vc-cvs-parse-entry): Don't require parse-time, because it's
André Spiegel <spiegel@gnu.org>
parents:
52602
diff
changeset
|
1025 ;; (which is based on textual comparison), because there can be problems |
52602
04c9b596cce6
(vc-cvs-parse-entry): Restore the code to compare time stamps
André Spiegel <spiegel@gnu.org>
parents:
52401
diff
changeset
|
1026 ;; generating a time string that looks exactly like the one from CVS. |
52717
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1027 (let ((mtime (nth 5 (file-attributes file)))) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1028 (require 'parse-time) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1029 (let ((parsed-time |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1030 (parse-time-string (concat (match-string 2) " +0000")))) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1031 (cond ((and (not (string-match "\\+" (match-string 2))) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1032 (car parsed-time) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1033 (equal mtime (apply 'encode-time parsed-time))) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1034 (vc-file-setprop file 'vc-checkout-time mtime) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1035 (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1036 (t |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1037 (vc-file-setprop file 'vc-checkout-time 0) |
9197177c5f99
(vc-cvs-parse-entry): Revert last change to allow
Dave Love <fx@gnu.org>
parents:
52624
diff
changeset
|
1038 (if set-state (vc-file-setprop file 'vc-state 'edited))))))))) |
44436
f9db51bb423b
(vc-cvs-checkin): Pass the required argument to `error'.
Sam Steingold <sds@gnu.org>
parents:
44197
diff
changeset
|
1039 |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1040 ;; Completion of revision names. |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1041 ;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1042 ;; `cvs log' so I can list all the revision numbers rather than only |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1043 ;; tag names. |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1044 |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1045 (defun vc-cvs-revision-table (file) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1046 (let ((default-directory (file-name-directory file)) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1047 (res nil)) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1048 (with-temp-buffer |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1049 (vc-cvs-command t nil file "log") |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1050 (goto-char (point-min)) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1051 (when (re-search-forward "^symbolic names:\n" nil t) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1052 (while (looking-at "^ \\(.*\\): \\(.*\\)") |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1053 (push (cons (match-string 1) (match-string 2)) res) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1054 (forward-line 1))) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1055 (while (re-search-forward "^revision \\([0-9.]+\\)" nil t) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1056 (push (match-string 1) res)) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1057 res))) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1058 |
85458
119299b8a040
(vc-cvs-revision-completion-table): Make it work when the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85139
diff
changeset
|
1059 (defun vc-cvs-revision-completion-table (files) |
119299b8a040
(vc-cvs-revision-completion-table): Make it work when the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85139
diff
changeset
|
1060 (lexical-let ((files files) |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1061 table) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1062 (setq table (lazy-completion-table |
85458
119299b8a040
(vc-cvs-revision-completion-table): Make it work when the
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85139
diff
changeset
|
1063 table (lambda () (vc-cvs-revision-table (car files))))) |
78359
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1064 table)) |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1065 |
2dd5d799a16d
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78236
diff
changeset
|
1066 |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
1067 (provide 'vc-cvs) |
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
1068 |
81821 | 1069 ;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432 |
31384
f6cb7dfe5e7c
(vc-cvs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
1070 ;;; vc-cvs.el ends here |