]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/vc-src.el
Update copyright year to 2016
[gnu-emacs] / lisp / vc / vc-src.el
index 3186d7254cbf5ae81844cff6599a90106ae6822b..23290428043a6fce4e51d5545c5ec569d8b5c313 100644 (file)
@@ -1,6 +1,6 @@
 ;;; vc-src.el --- support for SRC version-control  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1992-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2016 Free Software Foundation, Inc.
 
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Eric S. Raymond <esr@thyrsus.com>
@@ -35,7 +35,6 @@
 ;; - dir-extra-headers (dir)                   NOT NEEDED
 ;; - dir-printer (fileinfo)                    ??
 ;; * working-revision (file)                   OK
-;; - latest-on-branch-p (file)                 ??
 ;; * checkout-model (files)                    OK
 ;; - mode-line-string (file)                   NOT NEEDED
 ;; STATE-CHANGING FUNCTIONS
@@ -48,7 +47,6 @@
 ;; * find-revision (file rev buffer)           OK
 ;; * checkout (file &optional rev)             OK
 ;; * revert (file &optional contents-done)     OK
-;; - rollback (files)                          NOT NEEDED
 ;; - merge (file rev1 rev2)                    NOT NEEDED
 ;; - merge-news (file)                         NOT NEEDED
 ;; - steal-lock (file &optional revision)      NOT NEEDED
@@ -193,14 +191,19 @@ For a description of possible values, see `vc-check-master-templates'."
 (defun vc-src-command (buffer file-or-list &rest flags)
   "A wrapper around `vc-do-command' for use in vc-src.el.
 This function differs from vc-do-command in that it invokes `vc-src-program'."
-  (apply 'vc-do-command (or buffer "*vc*") 0 vc-src-program file-or-list flags))
+  (let (file-list)
+    (cond ((stringp file-or-list)
+          (setq file-list (list "--" file-or-list)))
+         (file-or-list
+          (setq file-list (cons "--" file-or-list))))
+    (apply 'vc-do-command (or buffer "*vc*") 0 vc-src-program file-list flags)))
 
 (defun vc-src-working-revision (file)
   "SRC-specific version of `vc-working-revision'."
-  (or (ignore-errors
-        (with-output-to-string
-          (vc-src-command standard-output file "list" "-f{1}" "@")))
-      "0"))
+  (let ((result (ignore-errors
+                 (with-output-to-string
+                   (vc-src-command standard-output file "list" "-f{1}" "@")))))
+    (if (zerop (length result)) "0" result)))
 
 ;;;
 ;;; State-changing functions
@@ -224,7 +227,7 @@ This function differs from vc-do-command in that it invokes `vc-src-program'."
                                           file
                                         (file-name-directory file)))))
 
-(defun vc-src-checkin (files comment)
+(defun vc-src-checkin (files comment &optional _rev)
   "SRC-specific version of `vc-backend-checkin'.
 REV is ignored."
   (vc-src-command nil files "commit" "-m" comment))
@@ -285,7 +288,7 @@ If LIMIT is non-nil, show no more than this many entries."
              (when limit (list "-l" (format "%s" limit)))
              vc-src-log-switches)))))
 
-(defun vc-src-diff (files &optional _async oldvers newvers buffer)
+(defun vc-src-diff (files &optional oldvers newvers buffer _async)
   "Get a difference report using src between two revisions of FILES."
   (let* ((firstfile (car files))
          (working (and firstfile (vc-working-revision firstfile))))