Mercurial > emacs
annotate lisp/vc/vc-dav.el @ 110149:4ac2b883320e
Forgor to save ChangeLog for previous commit.
author | Jan D. <jan.h.d@swipnet.se> |
---|---|
date | Thu, 02 Sep 2010 12:20:20 +0200 |
parents | 280c8ae2476d |
children | 1b626601d32d 417b1e4d63cd |
rev | line source |
---|---|
96198
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
1 ;;; vc-dav.el --- vc.el support for WebDAV |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
2 |
106815 | 3 ;; Copyright (C) 2001, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
96198
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
4 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
5 ;; Author: Bill Perry <wmperry@gnu.org> |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
6 ;; Maintainer: Bill Perry <wmperry@gnu.org> |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
7 ;; Keywords: url, vc |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
108970
diff
changeset
|
8 ;; Package: vc |
96198
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
9 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
13 ;; (at your option) any later version. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
14 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
18 ;; GNU General Public License for more details. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
19 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
22 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
23 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
24 ;;; Commentary: |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
25 |
96199
8322a8f8ab08
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96198
diff
changeset
|
26 ;;; Todo: |
8322a8f8ab08
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96198
diff
changeset
|
27 ;; |
8322a8f8ab08
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96198
diff
changeset
|
28 ;; - Some methods need to be updated to match the current vc.el. |
8322a8f8ab08
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96198
diff
changeset
|
29 ;; - rename "version" -> "revision" |
8322a8f8ab08
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96198
diff
changeset
|
30 ;; - some methods need to take a fileset as a parameter instead of a |
8322a8f8ab08
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96198
diff
changeset
|
31 ;; single file. |
8322a8f8ab08
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96198
diff
changeset
|
32 |
96198
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
33 ;;; Code: |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
34 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
35 (require 'url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
36 (require 'url-dav) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
37 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
38 ;;; Required functions for a vc backend |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
39 (defun vc-dav-registered (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
40 "Return t if URL is registered with a DAV aware server." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
41 (url-dav-vc-registered url)) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
42 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
43 (defun vc-dav-state (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
44 "Return the current version control state of URL. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
45 For a list of possible values, see `vc-state'." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
46 ;; Things we can support for WebDAV |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
47 ;; |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
48 ;; up-to-date - use lockdiscovery |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
49 ;; edited - check for an active lock by us |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
50 ;; USER - use lockdiscovery + owner |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
51 ;; |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
52 ;; These don't make sense for WebDAV |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
53 ;; needs-patch |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
54 ;; needs-merge |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
55 ;; unlocked-changes |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
56 (let ((locks (url-dav-active-locks url))) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
57 (cond |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
58 ((null locks) 'up-to-date) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
59 ((assoc url locks) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
60 ;; SOMEBODY has a lock... let's find out who. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
61 (setq locks (cdr (assoc url locks))) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
62 (if (rassoc url-dav-lock-identifier locks) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
63 ;; _WE_ have a lock |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
64 'edited |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
65 (cdr (car locks))))))) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
66 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
67 (defun vc-dav-checkout-model (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
68 "Indicate whether URL needs to be \"checked out\" before it can be edited. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
69 See `vc-checkout-model' for a list of possible values." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
70 ;; The only thing we can support with webdav is 'locking |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
71 'locking) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
72 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
73 ;; This should figure out the version # of the file somehow. What is |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
74 ;; the most appropriate property in WebDAV to look at for this? |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
75 (defun vc-dav-workfile-version (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
76 "Return the current workfile version of URL." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
77 "Unknown") |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
78 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
79 (defun vc-dav-register (url &optional rev comment) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
80 "Register URL in the DAV backend." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
81 ;; Do we need to do anything here? FIXME? |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
82 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
83 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
84 (defun vc-dav-checkin (url rev comment) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
85 "Commit changes in URL to WebDAV. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
86 If REV is non-nil, that should become the new revision number. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
87 COMMENT is used as a check-in comment." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
88 ;; This should PUT the resource and release any locks that we hold. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
89 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
90 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
91 (defun vc-dav-checkout (url &optional editable rev destfile) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
92 "Check out revision REV of URL into the working area. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
93 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
94 If EDITABLE is non-nil URL should be writable by the user and if |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
95 locking is used for URL, a lock should also be set. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
96 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
97 If REV is non-nil, that is the revision to check out. If REV is the |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
98 empty string, that means to check ou tht ehead of the trunk. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
99 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
100 If optional arg DESTFILE is given, it is an alternate filename to |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
101 write the contents to. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
102 " |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
103 ;; This should LOCK the resource. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
104 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
105 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
106 (defun vc-dav-revert (url &optional contents-done) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
107 "Revert URL back to the current workfile version. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
108 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
109 If optional arg CONTENTS-DONE is non-nil, then the contents of FILE |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
110 have already been reverted from a version backup, and this function |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
111 only needs to update the status of URL within the backend. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
112 " |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
113 ;; Should do a GET if !contents_done |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
114 ;; Should UNLOCK the file. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
115 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
116 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
117 (defun vc-dav-print-log (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
118 "Insert the revision log of URL into the *vc* buffer." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
119 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
120 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
121 (defun vc-dav-diff (url &optional rev1 rev2) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
122 "Insert the diff for URL into the *vc-diff* buffer. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
123 If REV1 and REV2 are non-nil report differences from REV1 to REV2. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
124 If REV1 is nil, use the current workfile version as the older version. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
125 If REV2 is nil, use the current workfile contents as the nwer version. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
126 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
127 It should return a status of either 0 (no differences found), or |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
128 1 (either non-empty diff or the diff is run asynchronously). |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
129 " |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
130 ;; We should do this asynchronously... |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
131 ;; How would we do it at all, that is the question! |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
132 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
133 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
134 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
135 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
136 ;;; Optional functions |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
137 ;; Should be faster than vc-dav-state - but how? |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
138 (defun vc-dav-state-heuristic (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
139 "Estimate the version control state of URL at visiting time." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
140 (vc-dav-state url)) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
141 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
142 ;; This should use url-dav-get-properties with a depth of `1' to get |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
143 ;; all the properties. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
144 (defun vc-dav-dir-state (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
145 "find the version control state of all files in DIR in a fast way." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
146 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
147 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
148 (defun vc-dav-workfile-unchanged-p (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
149 "Return non-nil if URL is unchanged from its current workfile version." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
150 ;; Probably impossible with webdav |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
151 ) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
152 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
153 (defun vc-dav-responsible-p (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
154 "Return non-nil if DAV considers itself `responsible' for URL." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
155 ;; Check for DAV support on the web server. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
156 t) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
157 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
158 (defun vc-dav-could-register (url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
159 "Return non-nil if URL could be registered under this backend." |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
160 ;; Check for DAV support on the web server. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
161 t) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
162 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
163 ;;; Unimplemented functions |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
164 ;; |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
165 ;; vc-dav-latest-on-branch-p(URL) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
166 ;; Return non-nil if the current workfile version of FILE is the |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
167 ;; latest on its branch. There are no branches in webdav yet. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
168 ;; |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
169 ;; vc-dav-mode-line-string(url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
170 ;; Return a dav-specific mode line string for URL. Are there any |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
171 ;; specific states that we want exposed? |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
172 ;; |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
173 ;; vc-dav-dired-state-info(url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
174 ;; Translate the `vc-state' property of URL into a string that can |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
175 ;; be used in a vc-dired buffer. Are there any extra states that |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
176 ;; we want exposed? |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
177 ;; |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
178 ;; vc-dav-receive-file(url rev) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
179 ;; Let this backend `receive' a file that is already registered |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
180 ;; under another backend. The default just calls `register', which |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
181 ;; should be sufficient for WebDAV. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
182 ;; |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
183 ;; vc-dav-unregister(url) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
184 ;; Unregister URL. Not possible with WebDAV, other than by |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
185 ;; deleting the resource. |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
186 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
187 (provide 'vc-dav) |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
188 |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
189 ;; arch-tag: 0a0fb9fe-8190-4c0a-a179-5c291d3a467e |
0c1619dd6a24
* vc-dav.el: Move here from url/vc-dav.el.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff
changeset
|
190 ;;; vc-dav.el ends here |