Mercurial > emacs
annotate lisp/pcvs-info.el @ 105952:c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
(tramp-advice-minibuffer-electric-tilde): Unload advices via
`tramp-unload'.
(tramp-advice-make-auto-save-file-name)
(tramp-advice-file-expand-wildcards): Apply also `ad-activate'
after removing the advice.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Wed, 11 Nov 2009 14:40:18 +0000 |
parents | afa0e028ba97 |
children | 1d1d5d9bd884 |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
34652
diff
changeset
|
1 ;;; pcvs-info.el --- internal representation of a fileinfo entry |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
2 |
56955
53103758d397
(cvs-states): Allow `ignore' on NEED-UPDATE.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54871
diff
changeset
|
3 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
100908 | 4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
94031
780a4492dea0
Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents:
79721
diff
changeset
|
5 ;; Free Software Foundation, Inc. |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
6 |
70292
2b77fa42947f
Update my email address.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
68651
diff
changeset
|
7 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
8 ;; Keywords: pcl-cvs |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
9 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
10 ;; This file is part of GNU Emacs. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
11 |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94166
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94166
diff
changeset
|
14 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94166
diff
changeset
|
15 ;; (at your option) any later version. |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
16 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
17 ;; GNU Emacs is distributed in the hope that it will be useful, |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
20 ;; GNU General Public License for more details. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
21 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
22 ;; You should have received a copy of the GNU General Public License |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94166
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
24 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
25 ;;; Commentary: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
26 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
27 ;; The cvs-fileinfo data structure: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
28 ;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
29 ;; When the `cvs update' is ready we parse the output. Every file |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
30 ;; that is affected in some way is added to the cookie collection as |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
31 ;; a "fileinfo" (as defined below in cvs-create-fileinfo). |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
32 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
33 ;;; Code: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
34 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
35 (eval-when-compile (require 'cl)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
36 (require 'pcvs-util) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
37 ;;(require 'pcvs-defs) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
38 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
39 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
40 ;;;; config variables |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
41 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
42 |
94166
024f6c12a147
(cvs-display-full-path, cvs-fileinfo->full-path):
Juanma Barranquero <lekktu@gmail.com>
parents:
94031
diff
changeset
|
43 (define-obsolete-variable-alias 'cvs-display-full-path |
024f6c12a147
(cvs-display-full-path, cvs-fileinfo->full-path):
Juanma Barranquero <lekktu@gmail.com>
parents:
94031
diff
changeset
|
44 'cvs-display-full-name "22.1") |
94031
780a4492dea0
Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents:
79721
diff
changeset
|
45 |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
46 (defcustom cvs-display-full-name t |
100171 | 47 "Specifies how the filenames should be displayed in the listing. |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
48 If non-nil, their full filename name will be displayed, else only the |
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
49 non-directory part." |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
50 :group 'pcl-cvs |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
51 :type '(boolean)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
52 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
53 (defcustom cvs-allow-dir-commit nil |
100171 | 54 "Allow `cvs-mode-commit' on directories. |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
55 If you commit without any marked file and with the cursor positioned |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
56 on a directory entry, cvs would commit the whole directory. This seems |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
57 to confuse some users sometimes." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
58 :group 'pcl-cvs |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
59 :type '(boolean)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
60 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
61 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
62 ;;;; Faces for fontification |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
63 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
64 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
65 (defface cvs-header |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
66 '((((class color) (background dark)) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
67 (:foreground "lightyellow" :weight bold)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
68 (((class color) (background light)) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
69 (:foreground "blue4" :weight bold)) |
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
70 (t (:weight bold))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
71 "PCL-CVS face used to highlight directory changes." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
72 :group 'pcl-cvs) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
73 (define-obsolete-face-alias 'cvs-header-face 'cvs-header "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
74 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
75 (defface cvs-filename |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
76 '((((class color) (background dark)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
77 (:foreground "lightblue")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
78 (((class color) (background light)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
79 (:foreground "blue4")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
80 (t ())) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
81 "PCL-CVS face used to highlight file names." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
82 :group 'pcl-cvs) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
83 (define-obsolete-face-alias 'cvs-filename-face 'cvs-filename "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
84 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
85 (defface cvs-unknown |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
86 '((((class color) (background dark)) |
78112
6ad309ee5f4e
* replace.el (match): Use yellow1 instead of yellow.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
87 (:foreground "red1")) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
88 (((class color) (background light)) |
78112
6ad309ee5f4e
* replace.el (match): Use yellow1 instead of yellow.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
75347
diff
changeset
|
89 (:foreground "red1")) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
90 (t (:slant italic))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
91 "PCL-CVS face used to highlight unknown file status." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
92 :group 'pcl-cvs) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
93 (define-obsolete-face-alias 'cvs-unknown-face 'cvs-unknown "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
94 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
95 (defface cvs-handled |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
96 '((((class color) (background dark)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
97 (:foreground "pink")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
98 (((class color) (background light)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
99 (:foreground "pink")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
100 (t ())) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
101 "PCL-CVS face used to highlight handled file status." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
102 :group 'pcl-cvs) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
103 (define-obsolete-face-alias 'cvs-handled-face 'cvs-handled "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
104 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
105 (defface cvs-need-action |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
106 '((((class color) (background dark)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
107 (:foreground "orange")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
108 (((class color) (background light)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
109 (:foreground "orange")) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
110 (t (:slant italic))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
111 "PCL-CVS face used to highlight status of files needing action." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
112 :group 'pcl-cvs) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
113 (define-obsolete-face-alias 'cvs-need-action-face 'cvs-need-action "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
114 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
115 (defface cvs-marked |
61394
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
56955
diff
changeset
|
116 '((((min-colors 88) (class color) (background dark)) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
56955
diff
changeset
|
117 (:foreground "green1" :weight bold)) |
31aa9a390538
* mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents:
56955
diff
changeset
|
118 (((class color) (background dark)) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
119 (:foreground "green" :weight bold)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
120 (((class color) (background light)) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
121 (:foreground "green3" :weight bold)) |
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
122 (t (:weight bold))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
123 "PCL-CVS face used to highlight marked file indicator." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
124 :group 'pcl-cvs) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
125 (define-obsolete-face-alias 'cvs-marked-face 'cvs-marked "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
126 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
127 (defface cvs-msg |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
128 '((t (:slant italic))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
129 "PCL-CVS face used to highlight CVS messages." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
130 :group 'pcl-cvs) |
104778
afa0e028ba97
Mark face aliases with "-face" suffix as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
131 (define-obsolete-face-alias 'cvs-msg-face 'cvs-msg "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
132 |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
133 (defvar cvs-fi-up-to-date-face 'cvs-handled) |
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
134 (defvar cvs-fi-unknown-face 'cvs-unknown) |
33431
5ca411467bf3
(cvs-fi-conflict-face): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
29576
diff
changeset
|
135 (defvar cvs-fi-conflict-face 'font-lock-warning-face) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
136 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
137 ;; There is normally no need to alter the following variable, but if |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
138 ;; your site has installed CVS in a non-standard way you might have |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
139 ;; to change it. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
140 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
141 (defvar cvs-bakprefix ".#" |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
142 "The prefix that CVS prepends to files when rcsmerge'ing.") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
143 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
144 (easy-mmode-defmap cvs-status-map |
54871
22cdf6999b11
(cvs-status-map): Update binding name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54280
diff
changeset
|
145 '(([(mouse-2)] . cvs-mode-toggle-mark)) |
29576
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
146 "Local keymap for text properties of status") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
147 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
148 ;; Constructor: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
149 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
150 (defstruct (cvs-fileinfo |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
151 (:constructor nil) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
152 (:copier nil) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
153 (:constructor -cvs-create-fileinfo (type dir file full-log |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
154 &key marked subtype |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
155 merge |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
156 base-rev |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
157 head-rev)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
158 (:conc-name cvs-fileinfo->)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
159 marked ;; t/nil. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
160 type ;; See below |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
161 subtype ;; See below |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
162 dir ;; Relative directory the file resides in. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
163 ;; (concat dir file) should give a valid path. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
164 file ;; The file name sans the directory. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
165 base-rev ;; During status: This is the revision that the |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
166 ;; working file is based on. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
167 head-rev ;; During status: This is the highest revision in |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
168 ;; the repository. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
169 merge ;; A cons cell containing the (ancestor . head) revisions |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
170 ;; of the merge that resulted in the current file. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
171 ;;removed ;; t if the file no longer exists. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
172 full-log ;; The output from cvs, unparsed. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
173 ;;mod-time ;; Not used. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
174 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
175 ;; In addition to the above, the following values can be extracted: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
176 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
177 ;; handled ;; t if this file doesn't require further action. |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
178 ;; full-name ;; The complete relative filename. |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
179 ;; pp-name ;; The printed file name |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
180 ;; backup-file;; For MERGED and CONFLICT files after a \"cvs update\", |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
181 ;; this is a full path to the backup file where the |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
182 ;; untouched version resides. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
183 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
184 ;; The meaning of the type field: |
49597
e88404e8f2cf
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49237
diff
changeset
|
185 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
186 ;; Value ---Used by--- Explanation |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
187 ;; update status |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
188 ;; NEED-UPDATE x file needs update |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
189 ;; MODIFIED x x modified by you, unchanged in repository |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
190 ;; MERGED x x successful merge |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
191 ;; ADDED x x added by you, not yet committed |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
192 ;; MISSING x rm'd, but not yet `cvs remove'd |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
193 ;; REMOVED x x removed by you, not yet committed |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
194 ;; NEED-MERGE x need merge |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
195 ;; CONFLICT x conflict when merging |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
196 ;; ;;MOD-CONFLICT x removed locally, changed in repository. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
197 ;; DIRCHANGE x x A change of directory. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
198 ;; UNKNOWN x An unknown file. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
199 ;; UP-TO-DATE x The file is up-to-date. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
200 ;; UPDATED x x file copied from repository |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
201 ;; PATCHED x x diff applied from repository |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
202 ;; COMMITTED x x cvs commit'd |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
203 ;; DEAD An entry that should be removed |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
204 ;; MESSAGE x x This is a special fileinfo that is used |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
205 ;; to display a text that should be in |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
206 ;; full-log." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
207 ;; TEMP A temporary message that should be removed |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
208 ) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
209 (defun cvs-create-fileinfo (type dir file msg &rest keys) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
210 (cvs-check-fileinfo (apply #'-cvs-create-fileinfo type dir file msg keys))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
211 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
212 ;; Fake selectors: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
213 |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
214 (defun cvs-fileinfo->full-name (fileinfo) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
215 "Return the full path for the file that is described in FILEINFO." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
216 (let ((dir (cvs-fileinfo->dir fileinfo))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
217 (if (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
218 (if (string= dir "") "." (directory-file-name dir)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
219 ;; Here, I use `concat' rather than `expand-file-name' because I want |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
220 ;; the resulting path to stay relative if `dir' is relative. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
221 (concat dir (cvs-fileinfo->file fileinfo))))) |
94166
024f6c12a147
(cvs-display-full-path, cvs-fileinfo->full-path):
Juanma Barranquero <lekktu@gmail.com>
parents:
94031
diff
changeset
|
222 (define-obsolete-function-alias 'cvs-fileinfo->full-path |
024f6c12a147
(cvs-display-full-path, cvs-fileinfo->full-path):
Juanma Barranquero <lekktu@gmail.com>
parents:
94031
diff
changeset
|
223 'cvs-fileinfo->full-name "22.1") |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
224 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
225 (defun cvs-fileinfo->pp-name (fi) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
226 "Return the filename of FI as it should be displayed." |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
227 (if cvs-display-full-name |
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
228 (cvs-fileinfo->full-name fi) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
229 (cvs-fileinfo->file fi))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
230 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
231 (defun cvs-fileinfo->backup-file (fileinfo) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
232 "Construct the file name of the backup file for FILEINFO." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
233 (let* ((dir (cvs-fileinfo->dir fileinfo)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
234 (file (cvs-fileinfo->file fileinfo)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
235 (default-directory (file-name-as-directory (expand-file-name dir))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
236 (files (directory-files "." nil |
54280
bfa320f698d6
(cvs-fileinfo->backup-file): Use a more constraining
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52401
diff
changeset
|
237 (concat "\\`" (regexp-quote cvs-bakprefix) |
bfa320f698d6
(cvs-fileinfo->backup-file): Use a more constraining
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
52401
diff
changeset
|
238 (regexp-quote file) "\\(\\.[0-9]+\\.[0-9]+\\)+\\'"))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
239 bf) |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
240 (dolist (f files) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
241 (when (and (file-readable-p f) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
242 (or (null bf) (file-newer-than-file-p f bf))) |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
243 (setq bf f))) |
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
244 (concat dir bf))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
245 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
246 ;; (defun cvs-fileinfo->handled (fileinfo) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
247 ;; "Tell if this requires further action" |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
248 ;; (memq (cvs-fileinfo->type fileinfo) '(UP-TO-DATE DEAD))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
249 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
250 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
251 ;; Predicate: |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
252 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
253 (defun cvs-check-fileinfo (fi) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
254 "Check FI's conformance to some conventions." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
255 (let ((check 'none) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
256 (type (cvs-fileinfo->type fi)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
257 (subtype (cvs-fileinfo->subtype fi)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
258 (marked (cvs-fileinfo->marked fi)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
259 (dir (cvs-fileinfo->dir fi)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
260 (file (cvs-fileinfo->file fi)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
261 (base-rev (cvs-fileinfo->base-rev fi)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
262 (head-rev (cvs-fileinfo->head-rev fi)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
263 (full-log (cvs-fileinfo->full-log fi))) |
47390
ff0e463ca59f
(cvs-check-fileinfo): Don't use boolp.
Richard M. Stallman <rms@gnu.org>
parents:
45910
diff
changeset
|
264 (if (and (setq check 'marked) (memq marked '(t nil)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
265 (setq check 'base-rev) (or (null base-rev) (stringp base-rev)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
266 (setq check 'head-rev) (or (null head-rev) (stringp head-rev)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
267 (setq check 'full-log) (stringp full-log) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
268 (setq check 'dir) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
269 (and (stringp dir) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
270 (not (file-name-absolute-p dir)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
271 (or (string= dir "") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
272 (string= dir (file-name-as-directory dir)))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
273 (setq check 'file) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
274 (and (stringp file) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
275 (string= file (file-name-nondirectory file))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
276 (setq check 'type) (symbolp type) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
277 (setq check 'consistency) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
278 (case type |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
279 (DIRCHANGE (and (null subtype) (string= "." file))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
280 ((NEED-UPDATE ADDED MISSING DEAD MODIFIED MESSAGE UP-TO-DATE |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
281 REMOVED NEED-MERGE CONFLICT UNKNOWN MESSAGE) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
282 t))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
283 fi |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
284 (error "Invalid :%s in cvs-fileinfo %s" check fi)))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
285 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
286 |
49597
e88404e8f2cf
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49237
diff
changeset
|
287 ;;;; |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
288 ;;;; State table to indicate what you can do when. |
49597
e88404e8f2cf
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49237
diff
changeset
|
289 ;;;; |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
290 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
291 (defconst cvs-states |
56955
53103758d397
(cvs-states): Allow `ignore' on NEED-UPDATE.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54871
diff
changeset
|
292 `((NEED-UPDATE update diff ignore) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
293 (UP-TO-DATE update nil remove diff safe-rm revert) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
294 (MODIFIED update commit undo remove diff merge diff-base) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
295 (ADDED update commit remove) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
296 (MISSING remove undo update safe-rm revert) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
297 (REMOVED commit add undo safe-rm) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
298 (NEED-MERGE update undo diff diff-base) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
299 (CONFLICT merge remove undo commit diff diff-base) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
300 (DIRCHANGE remove update diff ,(if cvs-allow-dir-commit 'commit) tag) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
301 (UNKNOWN ignore add remove) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
302 (DEAD ) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
303 (MESSAGE)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
304 "Fileinfo state descriptions for pcl-cvs. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
305 This is an assoc list. Each element consists of (STATE . FUNS) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
306 - STATE (described in `cvs-create-fileinfo') is the key |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
307 - FUNS is the list of applicable operations. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
308 The first one (if any) should be the \"default\" action. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
309 Most of the actions have the obvious meaning. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
310 `safe-rm' indicates that the file can be removed without losing |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
311 any information.") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
312 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
313 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
314 ;;;; Utility functions |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
315 ;;;; |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
316 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
317 (defun cvs-applicable-p (fi-or-type func) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
318 "Check if FUNC is applicable to FI-OR-TYPE. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
319 If FUNC is nil, always return t. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
320 FI-OR-TYPE can either be a symbol (a fileinfo-type) or a fileinfo." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
321 (let ((type (if (symbolp fi-or-type) fi-or-type |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
322 (cvs-fileinfo->type fi-or-type)))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
323 (and (not (eq type 'MESSAGE)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
324 (eq (car (memq func (cdr (assq type cvs-states)))) func)))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
325 |
45903
bbb734dc35fd
(cvs-add-face): Minor rewrite.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45841
diff
changeset
|
326 (defun cvs-add-face (str face &optional keymap &rest props) |
45910
32ed873c69a7
(cvs-add-face): Fix silly oversight.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45903
diff
changeset
|
327 (when keymap |
32ed873c69a7
(cvs-add-face): Fix silly oversight.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45903
diff
changeset
|
328 (when (keymapp keymap) |
32ed873c69a7
(cvs-add-face): Fix silly oversight.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45903
diff
changeset
|
329 (setq props (list* 'keymap keymap props))) |
32ed873c69a7
(cvs-add-face): Fix silly oversight.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45903
diff
changeset
|
330 (setq props (list* 'mouse-face 'highlight props))) |
32ed873c69a7
(cvs-add-face): Fix silly oversight.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45903
diff
changeset
|
331 (add-text-properties 0 (length str) (list* 'font-lock-face face props) str) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
332 str) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
333 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
334 (defun cvs-fileinfo-pp (fileinfo) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
335 "Pretty print FILEINFO. Insert a printed representation in current buffer. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
336 For use by the cookie package." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
337 (cvs-check-fileinfo fileinfo) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
338 (let ((type (cvs-fileinfo->type fileinfo)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
339 (subtype (cvs-fileinfo->subtype fileinfo))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
340 (insert |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
341 (case type |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
342 (DIRCHANGE (concat "In directory " |
61866
37400c7baa6c
Rename "full-path" -> "full-name".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
61394
diff
changeset
|
343 (cvs-add-face (cvs-fileinfo->full-name fileinfo) |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
344 'cvs-header t 'cvs-goal-column t) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
345 ":")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
346 (MESSAGE |
28256
06cfa273543d
* pcvs.el: Add a minimal leading commentary.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
347 (cvs-add-face (format "Message: %s" (cvs-fileinfo->full-log fileinfo)) |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
348 'cvs-msg)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
349 (t |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
350 (let* ((status (if (cvs-fileinfo->marked fileinfo) |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
351 (cvs-add-face "*" 'cvs-marked) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
352 " ")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
353 (file (cvs-add-face (cvs-fileinfo->pp-name fileinfo) |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
354 'cvs-filename t 'cvs-goal-column t)) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
355 (base (or (cvs-fileinfo->base-rev fileinfo) "")) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
356 (head (cvs-fileinfo->head-rev fileinfo)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
357 (type |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
358 (let ((str (case type |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
359 ;;(MOD-CONFLICT "Not Removed") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
360 (DEAD "") |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
361 (t (capitalize (symbol-name type))))) |
29576
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
362 (face (let ((sym (intern |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
363 (concat "cvs-fi-" |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
364 (downcase (symbol-name type)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
365 "-face")))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
366 (or (and (boundp sym) (symbol-value sym)) |
63209
24689001fa22
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Miles Bader <miles@gnu.org>
parents:
61866
diff
changeset
|
367 'cvs-need-action)))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
368 (cvs-add-face str face cvs-status-map))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
369 (side (or |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
370 ;; maybe a subtype |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
371 (when subtype (downcase (symbol-name subtype))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
372 ;; or the head-rev |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
373 (when (and head (not (string= head base))) head) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
374 ;; or nothing |
28256
06cfa273543d
* pcvs.el: Add a minimal leading commentary.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28088
diff
changeset
|
375 ""))) |
44384
3626a12fe452
* pcvs.el (cvs-mode-previous-line, cvs-mode-next-line): Move to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
42455
diff
changeset
|
376 (format "%-11s %s %-11s %-11s %s" |
70709
45029a5165ac
(cvs-fileinfo-pp): Insert trailing newline.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
70292
diff
changeset
|
377 side status type base file)))) |
45029a5165ac
(cvs-fileinfo-pp): Insert trailing newline.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
70292
diff
changeset
|
378 "\n"))) |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
379 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
380 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
381 (defun cvs-fileinfo-update (fi fi-new) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
382 "Update FI with the information provided in FI-NEW." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
383 (let ((type (cvs-fileinfo->type fi-new)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
384 (merge (cvs-fileinfo->merge fi-new))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
385 (setf (cvs-fileinfo->type fi) type) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
386 (setf (cvs-fileinfo->subtype fi) (cvs-fileinfo->subtype fi-new)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
387 (setf (cvs-fileinfo->full-log fi) (cvs-fileinfo->full-log fi-new)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
388 (setf (cvs-fileinfo->base-rev fi) (cvs-fileinfo->base-rev fi-new)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
389 (setf (cvs-fileinfo->head-rev fi) (cvs-fileinfo->head-rev fi-new)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
390 (cond |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
391 (merge (setf (cvs-fileinfo->merge fi) merge)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
392 ((memq type '(UP-TO-DATE NEED-UPDATE)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
393 (setf (cvs-fileinfo->merge fi) nil))))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
394 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
395 (defun cvs-fileinfo< (a b) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
396 "Compare fileinfo A with fileinfo B and return t if A is `less'. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
397 The ordering defined by this function is such that directories are |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
398 sorted alphabetically, and inside every directory the DIRCHANGE |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
399 fileinfo will appear first, followed by all files (alphabetically)." |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
400 (let ((subtypea (cvs-fileinfo->subtype a)) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
401 (subtypeb (cvs-fileinfo->subtype b))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
402 (cond |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
403 ;; Sort according to directories. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
404 ((string< (cvs-fileinfo->dir a) (cvs-fileinfo->dir b)) t) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
405 ((not (string= (cvs-fileinfo->dir a) (cvs-fileinfo->dir b))) nil) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
406 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
407 ;; The DIRCHANGE entry is always first within the directory. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
408 ((eq (cvs-fileinfo->type b) 'DIRCHANGE) nil) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
409 ((eq (cvs-fileinfo->type a) 'DIRCHANGE) t) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
410 |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
411 ;; All files are sorted by file name. |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
412 ((string< (cvs-fileinfo->file a) (cvs-fileinfo->file b)))))) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
413 |
29576
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
414 ;;; |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
415 ;;; Look at CVS/Entries to quickly find a first approximation of the status |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
416 ;;; |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
417 |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
418 (defun cvs-fileinfo-from-entries (dir &optional all) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
419 "List of fileinfos for DIR, extracted from CVS/Entries. |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
420 Unless ALL is optional, returns only the files that are not up-to-date. |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
421 DIR can also be a file." |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
422 (let* ((singlefile |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
423 (cond |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
424 ((equal dir "") nil) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
425 ((file-directory-p dir) (setq dir (file-name-as-directory dir)) nil) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
426 (t (prog1 (file-name-nondirectory dir) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
427 (setq dir (or (file-name-directory dir) "")))))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
428 (file (expand-file-name "CVS/Entries" dir)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
429 (fis nil)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
430 (if (not (file-readable-p file)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
431 (push (cvs-create-fileinfo (if singlefile 'UNKNOWN 'DIRCHANGE) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
432 dir (or singlefile ".") "") fis) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
433 (with-temp-buffer |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
434 (insert-file-contents file) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
435 (goto-char (point-min)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
436 ;; Select the single file entry in case we're only interested in a file. |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
437 (cond |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
438 ((not singlefile) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
439 (push (cvs-create-fileinfo 'DIRCHANGE dir "." "") fis)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
440 ((re-search-forward |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
441 (concat "^[^/]*/" (regexp-quote singlefile) "/.*") nil t) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
442 (setq all t) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
443 (goto-char (match-beginning 0)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
444 (narrow-to-region (point) (match-end 0))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
445 (t |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
446 (push (cvs-create-fileinfo 'UNKNOWN dir singlefile "") fis) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
447 (narrow-to-region (point-min) (point-min)))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
448 (while (looking-at "\\([^/]*\\)/\\([^/]*\\)/\\([^/]*\\)/\\([^/]*\\)/") |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
449 (if (/= (match-beginning 1) (match-end 1)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
450 (setq fis (append (cvs-fileinfo-from-entries |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
451 (concat dir (file-name-as-directory |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
452 (match-string 2))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
453 all) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
454 fis)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
455 (let ((f (match-string 2)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
456 (rev (match-string 3)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
457 (date (match-string 4)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
458 timestamp |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
459 (type 'MODIFIED) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
460 (subtype nil)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
461 (cond |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
462 ((equal (substring rev 0 1) "-") |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
463 (setq type 'REMOVED rev (substring rev 1))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
464 ((not (file-exists-p (concat dir f))) (setq type 'MISSING)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
465 ((equal rev "0") (setq type 'ADDED rev nil)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
466 ((equal date "Result of merge") (setq subtype 'MERGED)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
467 ((let ((mtime (nth 5 (file-attributes (concat dir f)))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
468 (system-time-locale "C")) |
49237
9a2cb7cc7942
(cvs-fileinfo-from-entries): Deal with Solaris'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47390
diff
changeset
|
469 (setq timestamp (format-time-string "%c" mtime 'utc)) |
9a2cb7cc7942
(cvs-fileinfo-from-entries): Deal with Solaris'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47390
diff
changeset
|
470 ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep 5". |
9a2cb7cc7942
(cvs-fileinfo-from-entries): Deal with Solaris'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47390
diff
changeset
|
471 ;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference. |
9a2cb7cc7942
(cvs-fileinfo-from-entries): Deal with Solaris'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47390
diff
changeset
|
472 (if (= (aref timestamp 8) ?0) |
9a2cb7cc7942
(cvs-fileinfo-from-entries): Deal with Solaris'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47390
diff
changeset
|
473 (setq timestamp (concat (substring timestamp 0 8) |
9a2cb7cc7942
(cvs-fileinfo-from-entries): Deal with Solaris'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47390
diff
changeset
|
474 " " (substring timestamp 9)))) |
9a2cb7cc7942
(cvs-fileinfo-from-entries): Deal with Solaris'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
47390
diff
changeset
|
475 (equal timestamp date)) |
29576
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
476 (setq type (if all 'UP-TO-DATE))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
477 ((equal date (concat "Result of merge+" timestamp)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
478 (setq type 'CONFLICT))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
479 (when type |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
480 (push (cvs-create-fileinfo type dir f "" |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
481 :base-rev rev :subtype subtype) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
482 fis)))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
483 (forward-line 1)))) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
484 fis)) |
961f303cda37
(cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28256
diff
changeset
|
485 |
28088
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
486 (provide 'pcvs-info) |
b442dfc3cef0
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff
changeset
|
487 |
56955
53103758d397
(cvs-states): Allow `ignore' on NEED-UPDATE.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54871
diff
changeset
|
488 ;; arch-tag: d85dde07-bdc2-400a-882f-92f398c7b0ba |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
34652
diff
changeset
|
489 ;;; pcvs-info.el ends here |