File: vc-eldav.el

package info (click to toggle)
eldav 0.8.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 144 kB
  • sloc: lisp: 1,098; sh: 34; makefile: 2
file content (91 lines) | stat: -rw-r--r-- 2,483 bytes parent folder | download | duplicates (5)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
;;; vc-eldav.el --- VC backend for eldav.

;; Copyright (C) 2002 Yuuichi Teranishi <teranisi@gohome.org>

;; Author: Yuuichi Teranishi  <teranisi@gohome.org>
;; Keywords: WebDAV

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.

;;; Commenty:
;;

;;; Commentary:
;;

(require 'eldav)

;;; Code:

;; vc backend
(defun vc-eldav-state (file)
  (if (file-exists-p file)
      (let* ((eldav-inhibit-propfind-cache t)
	     (locks (eldav-lockinfo-list (eldav-file-name-url file))))
	(cond
	 ((null locks) 'up-to-date)
	 ((member eldav-lock-identifier
		  (mapcar 'eldav-lockinfo-owner locks))
	  'edited)
	 (t (eldav-lockinfo-owner (car locks)))))
    'up-to-date))

(defun vc-eldav-checkout-model (file)
  'locking)

(defun vc-eldav-workfile-version (file)
  "1.0")

(defun vc-eldav-checkin (file rev comment)
  ;; Release.
  (let ((url (eldav-file-name-url file)))
    (dolist (lockinfo (eldav-lockinfo-list-search 'owner eldav-lock-identifier
						  (eldav-lockinfo-list url)))
      (eldav-unlock url (eldav-lockinfo-token lockinfo)))))

(defun vc-eldav-checkout (file &optional editable rev destfile)
  ;; LOCK the file.
  (eldav-lock (eldav-file-name-url file)))

(defun vc-eldav-revert (file &optional contents-done)
  (unless contents-done
    (insert-file-contents file)))

(defun vc-eldav-print-log (file)
  ;; do nothing.
  )

(defun vc-eldav-diff (file &optional rev1 rev2)
  ;; do nothing.
  )

(defun vc-eldav-workfile-unchanged-p (file)
  )

(defun vc-eldav-dav-responsible-p (url)
  t)

(defun vc-dav-could-register (url)
  t)

(defun vc-eldav-steal-lock (file rev)
  (let ((url (eldav-file-name-url file)))
    (dolist (lockinfo (eldav-lockinfo-list url))
      (eldav-unlock url (eldav-lockinfo-token lockinfo)))))

(provide 'vc-eldav)

;;; vc-eldav.el ends here