Unlike DARCS, Pijul doesn’t store copies of files under .pijul, so this isn’t necessary
26Z3OQSDCGQDNX2DMQDZHLEUYKOILDRUINZI6E3OBTWJZHNC23FAC
;;; protection against editing files under .pijul
;;; adapted from an idea by Rob Giardine
(defun vc-pijul-find-file-hook ()
(let ((f (buffer-file-name (current-buffer))))
(and f (vc-pijul-special-file-p f)
(let* ((candidate
(let* ((f (buffer-file-name (current-buffer)))
(match
(and f (string-match
"/.pijul/\\(current\\|pristine\\)/" f))))
(and match
(concat (substring f 0 (match-beginning 0))
"/"
(substring f (match-end 0))))))
(open-instead
(and candidate
(yes-or-no-p
"This is a .pijul file, open the real file instead? "))))
(cond
(open-instead
(find-alternate-file candidate))
(t
(setq buffer-read-only t)
(push '(:propertize ".PIJUL-FILE:" face font-lock-warning-face)
mode-line-buffer-identification)))))))