Mercurial > emacs
annotate lisp/url/vc-dav.el @ 83554:b8d9a391daf3
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-599
Merge from erc--main--0
* emacs@sv.gnu.org/emacs--devo--0--patch-600
Merge from erc--main--0
* emacs@sv.gnu.org/emacs--devo--0--patch-601
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-602
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-603
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-604
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-605
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-606
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-607
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-608
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-609
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-610
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-611
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-612
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-613
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-614
Make byte compiler correctly write circular constants
* emacs@sv.gnu.org/emacs--devo--0--patch-615
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-616
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-617
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-618
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-192
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-193
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-194
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-195
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-196
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-594
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 29 Jan 2007 22:21:19 +0000 |
parents | d04d8ccb3c41 e3694f1cb928 |
children |
rev | line source |
---|---|
54695 | 1 ;;; vc-dav.el --- vc.el support for WebDAV |
2 | |
75347 | 3 ;; Copyright (C) 2001, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
54695 | 4 |
5 ;; Author: Bill Perry <wmperry@gnu.org> | |
6 ;; Maintainer: Bill Perry <wmperry@gnu.org> | |
7 ;; Keywords: url, vc | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
11 ;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;; any later version. | |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64084 | 21 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 ;; Boston, MA 02110-1301, USA. | |
54695 | 23 |
61184
fb431b536a04
Better adhere to coding conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54770
diff
changeset
|
24 |
fb431b536a04
Better adhere to coding conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54770
diff
changeset
|
25 ;;; Commentary: |
fb431b536a04
Better adhere to coding conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54770
diff
changeset
|
26 |
fb431b536a04
Better adhere to coding conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54770
diff
changeset
|
27 ;;; Code: |
fb431b536a04
Better adhere to coding conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54770
diff
changeset
|
28 |
54695 | 29 (require 'url) |
30 (require 'url-dav) | |
31 | |
32 ;;; Required functions for a vc backend | |
33 (defun vc-dav-registered (url) | |
34 "Return t iff URL is registered with a DAV aware server." | |
35 (url-dav-vc-registered url)) | |
36 | |
37 (defun vc-dav-state (url) | |
38 "Return the current version control state of URL. | |
39 For a list of possible values, see `vc-state'." | |
40 ;; Things we can support for WebDAV | |
41 ;; | |
42 ;; up-to-date - use lockdiscovery | |
43 ;; edited - check for an active lock by us | |
44 ;; USER - use lockdiscovery + owner | |
45 ;; | |
46 ;; These don't make sense for WebDAV | |
47 ;; needs-patch | |
48 ;; needs-merge | |
49 ;; unlocked-changes | |
50 (let ((locks (url-dav-active-locks url))) | |
51 (cond | |
52 ((null locks) 'up-to-date) | |
53 ((assoc url locks) | |
54 ;; SOMEBODY has a lock... let's find out who. | |
55 (setq locks (cdr (assoc url locks))) | |
56 (if (rassoc url-dav-lock-identifier locks) | |
57 ;; _WE_ have a lock | |
58 'edited | |
59 (cdr (car locks))))))) | |
64748
875dcc490074
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
60 |
54695 | 61 (defun vc-dav-checkout-model (url) |
62 "Indicate whether URL needs to be \"checked out\" before it can be edited. | |
63 See `vc-checkout-model' for a list of possible values." | |
64 ;; The only thing we can support with webdav is 'locking | |
65 'locking) | |
66 | |
67 ;; This should figure out the version # of the file somehow. What is | |
68 ;; the most appropriate property in WebDAV to look at for this? | |
69 (defun vc-dav-workfile-version (url) | |
70 "Return the current workfile version of URL." | |
71 "Unknown") | |
72 | |
73 (defun vc-dav-register (url &optional rev comment) | |
74 "Register URL in the DAV backend." | |
75 ;; Do we need to do anything here? FIXME? | |
76 ) | |
77 | |
78 (defun vc-dav-checkin (url rev comment) | |
79 "Commit changes in URL to WebDAV. | |
80 If REV is non-nil, that should become the new revision number. | |
81 COMMENT is used as a check-in comment." | |
82 ;; This should PUT the resource and release any locks that we hold. | |
83 ) | |
84 | |
85 (defun vc-dav-checkout (url &optional editable rev destfile) | |
86 "Check out revision REV of URL into the working area. | |
87 | |
88 If EDITABLE is non-nil URL should be writable by the user and if | |
89 locking is used for URL, a lock should also be set. | |
90 | |
91 If REV is non-nil, that is the revision to check out. If REV is the | |
92 empty string, that means to check ou tht ehead of the trunk. | |
93 | |
94 If optional arg DESTFILE is given, it is an alternate filename to | |
95 write the contents to. | |
96 " | |
97 ;; This should LOCK the resource. | |
98 ) | |
99 | |
100 (defun vc-dav-revert (url &optional contents-done) | |
101 "Revert URL back to the current workfile version. | |
102 | |
103 If optional arg CONTENTS-DONE is non-nil, then the contents of FILE | |
104 have already been reverted from a version backup, and this function | |
105 only needs to update the status of URL within the backend. | |
106 " | |
107 ;; Should do a GET if !contents_done | |
108 ;; Should UNLOCK the file. | |
109 ) | |
110 | |
111 (defun vc-dav-print-log (url) | |
112 "Insert the revision log of URL into the *vc* buffer." | |
113 ) | |
114 | |
115 (defun vc-dav-diff (url &optional rev1 rev2) | |
116 "Insert the diff for URL into the *vc-diff* buffer. | |
117 If REV1 and REV2 are non-nil report differences from REV1 to REV2. | |
118 If REV1 is nil, use the current workfile version as the older version. | |
119 If REV2 is nil, use the current workfile contents as the nwer version. | |
120 | |
121 It should return a status of either 0 (no differences found), or | |
122 1 (either non-empty diff or the diff is run asynchronously). | |
123 " | |
124 ;; We should do this asynchronously... | |
125 ;; How would we do it at all, that is the question! | |
126 ) | |
127 | |
128 | |
129 | |
130 ;;; Optional functions | |
131 ;; Should be faster than vc-dav-state - but how? | |
132 (defun vc-dav-state-heuristic (url) | |
133 "Estimate the version control state of URL at visiting time." | |
134 (vc-dav-state url)) | |
135 | |
136 ;; This should use url-dav-get-properties with a depth of `1' to get | |
137 ;; all the properties. | |
138 (defun vc-dav-dir-state (url) | |
139 "find the version control state of all files in DIR in a fast way." | |
140 ) | |
141 | |
142 (defun vc-dav-workfile-unchanged-p (url) | |
143 "Return non-nil if URL is unchanged from its current workfile version." | |
144 ;; Probably impossible with webdav | |
145 ) | |
146 | |
147 (defun vc-dav-responsible-p (url) | |
148 "Return non-nil if DAV considers itself `responsible' for URL." | |
149 ;; Check for DAV support on the web server. | |
150 t) | |
151 | |
152 (defun vc-dav-could-register (url) | |
153 "Return non-nil if URL could be registered under this backend." | |
154 ;; Check for DAV support on the web server. | |
155 t) | |
156 | |
157 ;;; Unimplemented functions | |
158 ;; | |
159 ;; vc-dav-latest-on-branch-p(URL) | |
160 ;; Return non-nil if the current workfile version of FILE is the | |
161 ;; latest on its branch. There are no branches in webdav yet. | |
162 ;; | |
163 ;; vc-dav-mode-line-string(url) | |
164 ;; Return a dav-specific mode line string for URL. Are there any | |
165 ;; specific states that we want exposed? | |
166 ;; | |
167 ;; vc-dav-dired-state-info(url) | |
168 ;; Translate the `vc-state' property of URL into a string that can | |
169 ;; be used in a vc-dired buffer. Are there any extra states that | |
170 ;; we want exposed? | |
171 ;; | |
172 ;; vc-dav-receive-file(url rev) | |
173 ;; Let this backend `receive' a file that is already registered | |
174 ;; under another backend. The default just calls `register', which | |
175 ;; should be sufficient for WebDAV. | |
176 ;; | |
177 ;; vc-dav-unregister(url) | |
178 ;; Unregister URL. Not possible with WebDAV, other than by | |
179 ;; deleting the resource. | |
180 | |
181 (provide 'vc-dav) | |
54699 | 182 |
61184
fb431b536a04
Better adhere to coding conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54770
diff
changeset
|
183 ;; arch-tag: 0a0fb9fe-8190-4c0a-a179-5c291d3a467e |
fb431b536a04
Better adhere to coding conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
54770
diff
changeset
|
184 ;;; vc-dav.el ends here |