Mercurial > emacs
annotate lisp/vc-mtn.el @ 99794:45ea5b2748da
*** empty log message ***
author | Martin Rudalics <rudalics@gmx.at> |
---|---|
date | Sat, 22 Nov 2008 11:42:00 +0000 |
parents | 0a12c040f6e2 |
children | fc3d57499127 |
rev | line source |
---|---|
78791 | 1 ;;; vc-mtn.el --- VC backend for Monotone |
2 | |
79721 | 3 ;; Copyright (C) 2007, 2008 Free Software Foundation, Inc. |
78791 | 4 |
5 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> | |
6 ;; Keywords: | |
7 | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94563
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94563
diff
changeset
|
9 |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94563
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
78791 | 11 ;; 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:
94563
diff
changeset
|
12 ;; 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:
94563
diff
changeset
|
13 ;; (at your option) any later version. |
78791 | 14 |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94563
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
78791 | 16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; 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:
94563
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
78791 | 22 |
23 ;;; Commentary: | |
24 | |
25 ;; | |
26 | |
96125
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
27 ;;; TODO: |
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
28 |
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
29 ;; - The `previous-version' VC method needs to be supported, 'D' in |
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
30 ;; log-view-mode uses it. |
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
31 |
78791 | 32 ;;; Code: |
33 | |
34 (eval-when-compile (require 'cl) (require 'vc)) | |
35 | |
99785
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
36 (defcustom vc-mtn-diff-switches t |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
37 "String or list of strings specifying switches for monotone diff under VC. |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
38 If nil, use the value of `vc-diff-switches'. |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
39 If you want to force an empty list of arguments, use t." |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
40 :type '(choice (const :tag "Unspecified" nil) |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
41 (const :tag "None" t) |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
42 (string :tag "Argument String") |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
43 (repeat :tag "Argument List" |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
44 :value ("") |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
45 string)) |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
46 :version "23.1" |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
47 :group 'vc) |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
48 |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
49 (define-obsolete-variable-alias 'vc-mtn-command 'vc-mtn-program "23.1") |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
50 (defcustom vc-mtn-program "mtn" |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
51 "Name of the monotone executable." |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
52 :type 'string |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
53 :group 'vc) |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
54 |
78791 | 55 ;; Clear up the cache to force vc-call to check again and discover |
56 ;; new functions when we reload this file. | |
57 (put 'Mtn 'vc-functions nil) | |
58 | |
99785
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
59 (unless (executable-find vc-mtn-program) |
78791 | 60 ;; vc-mtn.el is 100% non-functional without the `mtn' executable. |
61 (setq vc-handled-backends (delq 'Mtn vc-handled-backends))) | |
62 | |
63 ;;;###autoload | |
64 (defconst vc-mtn-admin-dir "_MTN") | |
65 ;;;###autoload | |
66 (defconst vc-mtn-admin-format (concat vc-mtn-admin-dir "/format")) | |
67 | |
68 ;;;###autoload (defun vc-mtn-registered (file) | |
69 ;;;###autoload (if (vc-find-root file vc-mtn-admin-format) | |
70 ;;;###autoload (progn | |
71 ;;;###autoload (load "vc-mtn") | |
72 ;;;###autoload (vc-mtn-registered file)))) | |
73 | |
74 (defun vc-mtn-revision-granularity () 'repository) | |
94563
a0bb8ca25a33
Clean up vc*-revision-granularity and vc*-checkout-model.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
94521
diff
changeset
|
75 (defun vc-mtn-checkout-model (files) 'implicit) |
78791 | 76 |
77 (defun vc-mtn-root (file) | |
78 (setq file (if (file-directory-p file) | |
79 (file-name-as-directory file) | |
80 (file-name-directory file))) | |
81 (or (vc-file-getprop file 'vc-mtn-root) | |
82 (vc-file-setprop file 'vc-mtn-root | |
83 (vc-find-root file vc-mtn-admin-format)))) | |
84 | |
85 | |
86 (defun vc-mtn-registered (file) | |
87 (let ((root (vc-mtn-root file))) | |
88 (when root | |
89 (vc-mtn-state file)))) | |
90 | |
91 (defun vc-mtn-command (buffer okstatus files &rest flags) | |
92 "A wrapper around `vc-do-command' for use in vc-mtn.el." | |
93564
eeb1bb8489e4
(vc-mtn-command): Avoid localization of messages.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93144
diff
changeset
|
93 (let ((process-environment |
eeb1bb8489e4
(vc-mtn-command): Avoid localization of messages.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93144
diff
changeset
|
94 ;; Avoid localization of messages so we can parse the output. |
eeb1bb8489e4
(vc-mtn-command): Avoid localization of messages.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93144
diff
changeset
|
95 (cons "LC_MESSAGES=C" process-environment))) |
99785
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
96 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-mtn-program |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
97 files flags))) |
78791 | 98 |
99 (defun vc-mtn-state (file) | |
100 ;; If `mtn' fails or returns status>0, or if the search files, just | |
101 ;; return nil. | |
102 (ignore-errors | |
103 (with-temp-buffer | |
104 (vc-mtn-command t 0 file "status") | |
105 (goto-char (point-min)) | |
93144
33c08cf9fb3a
(vc-mtn-state): Support the added state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92692
diff
changeset
|
106 (re-search-forward |
33c08cf9fb3a
(vc-mtn-state): Support the added state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92692
diff
changeset
|
107 "^ \\(?:\\(patched\\)\\|\\(added\\) \\(?:.*\\)\\)\\|no changes$") |
33c08cf9fb3a
(vc-mtn-state): Support the added state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92692
diff
changeset
|
108 (cond ((match-end 1) 'edited) |
33c08cf9fb3a
(vc-mtn-state): Support the added state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92692
diff
changeset
|
109 ((match-end 2) 'added) |
33c08cf9fb3a
(vc-mtn-state): Support the added state.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
92692
diff
changeset
|
110 (t 'up-to-date))))) |
78791 | 111 |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
78791
diff
changeset
|
112 (defun vc-mtn-working-revision (file) |
78791 | 113 ;; If `mtn' fails or returns status>0, or if the search fails, just |
114 ;; return nil. | |
115 (ignore-errors | |
116 (with-temp-buffer | |
117 (vc-mtn-command t 0 file "status") | |
118 (goto-char (point-min)) | |
119 (re-search-forward "Current branch: \\(.*\\)\nChanges against parent \\(.*\\)") | |
120 (match-string 2)))) | |
121 | |
122 (defun vc-mtn-workfile-branch (file) | |
123 ;; If `mtn' fails or returns status>0, or if the search files, just | |
124 ;; return nil. | |
125 (ignore-errors | |
126 (with-temp-buffer | |
127 (vc-mtn-command t 0 file "status") | |
128 (goto-char (point-min)) | |
129 (re-search-forward "Current branch: \\(.*\\)\nChanges against parent \\(.*\\)") | |
130 (match-string 1)))) | |
131 | |
132 (defun vc-mtn-workfile-unchanged-p (file) | |
133 (not (eq (vc-mtn-state file) 'edited))) | |
134 | |
135 ;; Mode-line rewrite code copied from vc-arch.el. | |
136 | |
137 (defcustom vc-mtn-mode-line-rewrite | |
138 '(("\\`[^:/#]*[:/#]" . "")) ;Drop the host part. | |
139 "Rewrite rules to shorten Mtn's revision names on the mode-line." | |
140 :type '(repeat (cons regexp string)) | |
80261
4af0bb174714
* textmodes/css-mode.el (css-indent-offset, css-electric-keys):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
79721
diff
changeset
|
141 :version "22.2" |
78791 | 142 :group 'vc) |
143 | |
144 (defun vc-mtn-mode-line-string (file) | |
145 "Return string for placement in modeline by `vc-mode-line' for FILE." | |
146 (let ((branch (vc-mtn-workfile-branch file))) | |
147 (dolist (rule vc-mtn-mode-line-rewrite) | |
148 (if (string-match (car rule) branch) | |
149 (setq branch (replace-match (cdr rule) t nil branch)))) | |
150 (format "Mtn%c%s" | |
151 (case (vc-state file) | |
94521
2a61c5f918a5
Change 'needs-patch to 'needs-update.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
93564
diff
changeset
|
152 ((up-to-date needs-update) ?-) |
78791 | 153 (added ?@) |
154 (t ?:)) | |
155 branch))) | |
156 | |
157 (defun vc-mtn-register (files &optional rest) | |
158 (vc-mtn-command nil 0 files "add")) | |
159 | |
160 (defun vc-mtn-responsible-p (file) (vc-mtn-root file)) | |
161 (defun vc-mtn-could-register (file) (vc-mtn-root file)) | |
162 | |
163 (defun vc-mtn-checkin (files rev comment) | |
164 (vc-mtn-command nil 0 files "commit" "-m" comment)) | |
165 | |
85139
8ba0e30716a5
Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
78791
diff
changeset
|
166 (defun vc-mtn-find-revision (file rev buffer) |
78791 | 167 (vc-mtn-command buffer 0 file "cat" "-r" rev)) |
168 | |
169 ;; (defun vc-mtn-checkout (file &optional editable rev) | |
170 ;; ) | |
171 | |
172 (defun vc-mtn-revert (file &optional contents-done) | |
173 (unless contents-done | |
174 (vc-mtn-command nil 0 file "revert"))) | |
175 | |
176 ;; (defun vc-mtn-roolback (files) | |
177 ;; ) | |
178 | |
179 (defun vc-mtn-print-log (files &optional buffer) | |
180 (vc-mtn-command buffer 0 files "log")) | |
181 | |
85478
786d3a985758
* term/x-win.el (x-gtk-stock-map, icon-map-list)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85462
diff
changeset
|
182 (defvar log-view-message-re) |
786d3a985758
* term/x-win.el (x-gtk-stock-map, icon-map-list)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85462
diff
changeset
|
183 (defvar log-view-file-re) |
786d3a985758
* term/x-win.el (x-gtk-stock-map, icon-map-list)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85462
diff
changeset
|
184 (defvar log-view-font-lock-keywords) |
96125
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
185 (defvar log-view-per-file-logs) |
85478
786d3a985758
* term/x-win.el (x-gtk-stock-map, icon-map-list)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85462
diff
changeset
|
186 |
78791 | 187 (define-derived-mode vc-mtn-log-view-mode log-view-mode "Mtn-Log-View" |
96125
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
188 ;; Don't match anything. |
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
189 (set (make-local-variable 'log-view-file-re) "\\`a\\`") |
673e286487b1
(vc-mtn-log-view-mode): Set log-view-per-file-logs and
Dan Nicolaescu <dann@ics.uci.edu>
parents:
94847
diff
changeset
|
190 (set (make-local-variable 'log-view-per-file-logs) nil) |
78791 | 191 ;; TODO: Use a more precise regexp than "[ |/]+" to avoid false positives |
192 ;; in the ChangeLog text. | |
193 (set (make-local-variable 'log-view-message-re) | |
194 "^[ |/]+Revision: \\([0-9a-f]+\\)") | |
195 (require 'add-log) ;For change-log faces. | |
196 (set (make-local-variable 'log-view-font-lock-keywords) | |
197 (append log-view-font-lock-keywords | |
198 '(("^[ |]+Author: \\(.*\\)" (1 'change-log-email)) | |
199 ("^[ |]+Date: \\(.*\\)" (1 'change-log-date-face)))))) | |
200 | |
85141
b16f7408cd3f
Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
85139
diff
changeset
|
201 ;; (defun vc-mtn-show-log-entry (revision) |
78791 | 202 ;; ) |
203 | |
204 (defun vc-mtn-diff (files &optional rev1 rev2 buffer) | |
99785
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
205 "Get a difference report using monotone between two revisions of FILES." |
78791 | 206 (apply 'vc-mtn-command (or buffer "*vc-diff*") 1 files "diff" |
99785
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
207 (append |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
208 (vc-switches (if vc-mtn-diff-switches 'mtn) 'diff) |
0a12c040f6e2
(vc-mtn-diff-switches): New option.
Glenn Morris <rgm@gnu.org>
parents:
96213
diff
changeset
|
209 (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2))))) |
78791 | 210 |
211 (defun vc-mtn-annotate-command (file buf &optional rev) | |
212 (apply 'vc-mtn-command buf 0 file "annotate" | |
213 (if rev (list "-r" rev)))) | |
214 | |
96213
09da7727f35f
* vc-hg.el (vc-annotate-convert-time, vc-default-status-printer):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96125
diff
changeset
|
215 (declare-function vc-annotate-convert-time "vc-annotate" (time)) |
09da7727f35f
* vc-hg.el (vc-annotate-convert-time, vc-default-status-printer):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96125
diff
changeset
|
216 |
78791 | 217 (defconst vc-mtn-annotate-full-re |
218 "^ *\\([0-9a-f]+\\)\\.* by [^ ]+ \\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\): ") | |
219 (defconst vc-mtn-annotate-any-re | |
220 (concat "^\\(?: +: \\|" vc-mtn-annotate-full-re "\\)")) | |
221 | |
222 (defun vc-mtn-annotate-time () | |
223 (when (looking-at vc-mtn-annotate-any-re) | |
224 (goto-char (match-end 0)) | |
225 (let ((year (match-string 2))) | |
226 (if (not year) | |
227 ;; Look for the date on a previous line. | |
228 (save-excursion | |
229 (get-text-property (1- (previous-single-property-change | |
230 (point) 'vc-mtn-time nil (point-min))) | |
231 'vc-mtn-time)) | |
232 (let ((time (vc-annotate-convert-time | |
233 (encode-time 0 0 0 | |
234 (string-to-number (match-string 4)) | |
235 (string-to-number (match-string 3)) | |
236 (string-to-number year) | |
237 t)))) | |
238 (let ((inhibit-read-only t) | |
239 (inhibit-modification-hooks t)) | |
240 (put-text-property (match-beginning 0) (match-end 0) | |
241 'vc-mtn-time time)) | |
242 time))))) | |
243 | |
244 (defun vc-mtn-annotate-extract-revision-at-line () | |
245 (save-excursion | |
246 (when (or (looking-at vc-mtn-annotate-full-re) | |
247 (re-search-backward vc-mtn-annotate-full-re nil t)) | |
248 (match-string 1)))) | |
249 | |
250 ;;; Revision completion. | |
251 | |
252 (defun vc-mtn-list-tags () | |
253 (with-temp-buffer | |
254 (vc-mtn-command t 0 nil "list" "tags") | |
255 (goto-char (point-min)) | |
256 (let ((tags ())) | |
257 (while (re-search-forward "^[^ ]+" nil t) | |
258 (push (match-string 0) tags)) | |
259 tags))) | |
260 | |
261 (defun vc-mtn-list-branches () | |
262 (with-temp-buffer | |
263 (vc-mtn-command t 0 nil "list" "branches") | |
264 (goto-char (point-min)) | |
265 (let ((branches ())) | |
266 (while (re-search-forward "^.+" nil t) | |
267 (push (match-string 0) branches)) | |
268 branches))) | |
269 | |
270 (defun vc-mtn-list-revision-ids (prefix) | |
271 (with-temp-buffer | |
272 (vc-mtn-command t 0 nil "complete" "revision" prefix) | |
273 (goto-char (point-min)) | |
274 (let ((ids ())) | |
275 (while (re-search-forward "^.+" nil t) | |
276 (push (match-string 0) ids)) | |
277 ids))) | |
278 | |
85461
abd6fdb45765
(vc-mtn-revision-completion-table):Make it work when the arg is a list of files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85141
diff
changeset
|
279 (defun vc-mtn-revision-completion-table (files) |
78791 | 280 ;; TODO: Implement completion for for selectors |
281 ;; TODO: Implement completion for composite selectors. | |
85461
abd6fdb45765
(vc-mtn-revision-completion-table):Make it work when the arg is a list of files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85141
diff
changeset
|
282 (lexical-let ((files files)) |
abd6fdb45765
(vc-mtn-revision-completion-table):Make it work when the arg is a list of files.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85141
diff
changeset
|
283 ;; What about using `files'?!? --Stef |
78791 | 284 (lambda (string pred action) |
285 (cond | |
286 ;; "Tag" selectors. | |
287 ((string-match "\\`t:" string) | |
288 (complete-with-action action | |
289 (mapcar (lambda (tag) (concat "t:" tag)) | |
290 (vc-mtn-list-tags)) | |
291 string pred)) | |
292 ;; "Branch" selectors. | |
293 ((string-match "\\`b:" string) | |
294 (complete-with-action action | |
295 (mapcar (lambda (tag) (concat "b:" tag)) | |
296 (vc-mtn-list-branches)) | |
297 string pred)) | |
298 ;; "Head" selectors. Not sure how they differ from "branch" selectors. | |
299 ((string-match "\\`h:" string) | |
300 (complete-with-action action | |
301 (mapcar (lambda (tag) (concat "h:" tag)) | |
302 (vc-mtn-list-branches)) | |
303 string pred)) | |
304 ;; "ID" selectors. | |
305 ((string-match "\\`i:" string) | |
306 (complete-with-action action | |
307 (mapcar (lambda (tag) (concat "i:" tag)) | |
308 (vc-mtn-list-revision-ids | |
309 (substring string (match-end 0)))) | |
310 string pred)) | |
311 (t | |
312 (complete-with-action action | |
313 '("t:" "b:" "h:" "i:" | |
314 ;; Completion not implemented for these. | |
315 "a:" "c:" "d:" "e:" "l:") | |
316 string pred)))))) | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94563
diff
changeset
|
317 |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94563
diff
changeset
|
318 |
78791 | 319 |
320 (provide 'vc-mtn) | |
321 | |
322 ;; arch-tag: 2b89ffbc-cbb8-405a-9080-2eafd4becb70 | |
323 ;;; vc-mtn.el ends here |