| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
(require 'url) |
|---|
| 30 |
(require 'url-dav) |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
(defun vc-dav-registered (url) |
|---|
| 34 |
"Return t if 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 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
(let ((locks (url-dav-active-locks url))) |
|---|
| 51 |
(cond |
|---|
| 52 |
((null locks) 'up-to-date) |
|---|
| 53 |
((assoc url locks) |
|---|
| 54 |
|
|---|
| 55 |
(setq locks (cdr (assoc url locks))) |
|---|
| 56 |
(if (rassoc url-dav-lock-identifier locks) |
|---|
| 57 |
|
|---|
| 58 |
'edited |
|---|
| 59 |
(cdr (car locks))))))) |
|---|
| 60 |
|
|---|
| 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 |
|
|---|
| 65 |
'locking) |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 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 |
|
|---|
| 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 |
|
|---|
| 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 |
|
|---|
| 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 |
|
|---|
| 108 |
|
|---|
| 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 |
|
|---|
| 125 |
|
|---|
| 126 |
) |
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 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 |
|
|---|
| 137 |
|
|---|
| 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 |
|
|---|
| 145 |
) |
|---|
| 146 |
|
|---|
| 147 |
(defun vc-dav-responsible-p (url) |
|---|
| 148 |
"Return non-nil if DAV considers itself `responsible' for URL." |
|---|
| 149 |
|
|---|
| 150 |
t) |
|---|
| 151 |
|
|---|
| 152 |
(defun vc-dav-could-register (url) |
|---|
| 153 |
"Return non-nil if URL could be registered under this backend." |
|---|
| 154 |
|
|---|
| 155 |
t) |
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
(provide 'vc-dav) |
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|