]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/vc-mtn.el
Update copyright year to 2015
[gnu-emacs] / lisp / vc / vc-mtn.el
index 145fdeb93d8c5659ad5b8d03b2cbd3e08b104796..d783572678c1b7a79dc0f6d6dd80ac1150a94808 100644 (file)
@@ -1,6 +1,6 @@
 ;;; vc-mtn.el --- VC backend for Monotone  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: vc
@@ -79,7 +79,8 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
 (defun vc-mtn-checkout-model (_files) 'implicit)
 
 (defun vc-mtn-root (file)
-  (setq file (if (file-directory-p file)
+  (setq file (expand-file-name file)
+       file (if (file-directory-p file)
                  (file-name-as-directory file)
                (file-name-directory file)))
   (or (vc-file-getprop file 'vc-mtn-root)
@@ -126,10 +127,11 @@ 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.
+;; dir-status-files 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)
+(defun vc-mtn-dir-status-files (dir _files update-function)
   (vc-mtn-command (current-buffer) 'async dir "status")
   (vc-run-delayed
    (vc-mtn-after-dir-status update-function)))
@@ -154,9 +156,6 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
       (re-search-forward "\\(?:Current b\\|B\\)ranch:  *\\(.*\\)\n?\nChanges against parent \\(.*\\)")
       (match-string 1))))
 
-(defun vc-mtn-workfile-unchanged-p (file)
-  (not (eq (vc-mtn-state file) 'edited)))
-
 ;; Mode-line rewrite code copied from vc-arch.el.
 
 (defcustom vc-mtn-mode-line-rewrite
@@ -179,11 +178,10 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
              (_ ?:))
            branch)))
 
-(defun vc-mtn-register (files &optional _rev _comment)
+(defun vc-mtn-register (files &optional _comment)
   (vc-mtn-command nil 0 files "add"))
 
 (defun vc-mtn-responsible-p (file) (vc-mtn-root file))
-(defun vc-mtn-could-register (file) (vc-mtn-root file))
 
 (declare-function log-edit-extract-headers "log-edit" (headers string))
 
@@ -204,9 +202,6 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   (unless contents-done
     (vc-mtn-command nil 0 file "revert")))
 
-;; (defun vc-mtn-rollback (files)
-;;   )
-
 (defun vc-mtn-print-log (files buffer &optional _shortlog start-revision limit)
   "Print commit logs associated with FILES into specified BUFFER.
 _SHORTLOG is ignored.
@@ -241,9 +236,11 @@ If LIMIT is non-nil, show no more than this many entries."
 
 (autoload 'vc-switches "vc")
 
-(defun vc-mtn-diff (files &optional rev1 rev2 buffer)
+(defun vc-mtn-diff (files &optional rev1 rev2 buffer async)
   "Get a difference report using monotone between two revisions of FILES."
-  (apply 'vc-mtn-command (or buffer "*vc-diff*") 1 files "diff"
+  (apply 'vc-mtn-command (or buffer "*vc-diff*")
+        (if async 'async 1)
+        files "diff"
          (append
            (vc-switches 'mtn 'diff)
            (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2)))))