]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/vc-mtn.el
Update copyright year to 2014 by running admin/update-copyright.
[gnu-emacs] / lisp / vc / vc-mtn.el
index 8429b2b213d592cbaabf422a57822fcbd0f0df13..ea071c8586a8b413ea9760153ca94dd9ad17fd0f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; vc-mtn.el --- VC backend for Monotone  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-201 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: vc
@@ -72,7 +72,7 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
 ;;;###autoload (defun vc-mtn-registered (file)
 ;;;###autoload   (if (vc-find-root file vc-mtn-admin-format)
 ;;;###autoload       (progn
-;;;###autoload         (load "vc-mtn")
+;;;###autoload         (load "vc-mtn" nil t)
 ;;;###autoload         (vc-mtn-registered file))))
 
 (defun vc-mtn-revision-granularity () 'repository)
@@ -86,6 +86,9 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
       (vc-file-setprop file 'vc-mtn-root
                        (vc-find-root file vc-mtn-admin-format))))
 
+(defun vc-mtn-find-admin-dir (file)
+  "Return the administrative directory of FILE."
+  (expand-file-name vc-mtn-admin-dir (vc-mtn-root file)))
 
 (defun vc-mtn-registered (file)
   (let ((root (vc-mtn-root file)))
@@ -123,10 +126,13 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
             ((match-end 2) (push (list (match-string 3) 'added) result))))
     (funcall update-function result)))
 
+;; -dir-status called from vc-dir, which loads vc, which loads vc-dispatcher.
+(declare-function vc-exec-after "vc-dispatcher" (code))
+
 (defun vc-mtn-dir-status (dir update-function)
   (vc-mtn-command (current-buffer) 'async dir "status")
-  (vc-exec-after
-   `(vc-mtn-after-dir-status (quote ,update-function))))
+  (vc-run-delayed
+   (vc-mtn-after-dir-status update-function)))
 
 (defun vc-mtn-working-revision (file)
   ;; If `mtn' fails or returns status>0, or if the search fails, just
@@ -202,6 +208,10 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
 ;;   )
 
 (defun vc-mtn-print-log (files buffer &optional _shortlog start-revision limit)
+  "Print commit logs associated with FILES into specified BUFFER.
+_SHORTLOG is ignored.
+If START-REVISION is non-nil, it is the newest revision to show.
+If LIMIT is non-nil, show no more than this many entries."
   (apply 'vc-mtn-command buffer 0 files "log"
         (append
          (when start-revision (list "--from" (format "%s" start-revision)))
@@ -229,6 +239,8 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
 ;; (defun vc-mtn-show-log-entry (revision)
 ;;   )
 
+(autoload 'vc-switches "vc")
+
 (defun vc-mtn-diff (files &optional rev1 rev2 buffer)
   "Get a difference report using monotone between two revisions of FILES."
   (apply 'vc-mtn-command (or buffer "*vc-diff*") 1 files "diff"