]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-git-delete-file, vc-git-rename-file): New functions.
authorDan Nicolaescu <dann@ics.uci.edu>
Mon, 23 Jul 2007 20:51:02 +0000 (20:51 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Mon, 23 Jul 2007 20:51:02 +0000 (20:51 +0000)
(vc-git-find-version): Use the result of ls-files as a parameter
for cat-file

lisp/ChangeLog
lisp/vc-git.el

index 1c2cb6e9529218ea4c03b7d4d7902f9899d30d72..09572aa1cd5fe4f8c08ca96b206a003320400b0f 100644 (file)
@@ -1,3 +1,9 @@
+2007-07-23  Alexandre Julliard <julliard@winehq.org>
+
+       * vc-git.el (vc-git-delete-file, vc-git-rename-file): New functions.
+       (vc-git-find-version): Use the result of ls-files as a parameter
+       for cat-file
+
 2007-07-23  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-perl-file-attributes)
index f1a9d009f120cb712aba5dfb2a13563de221adf4..d65d8428e6165972da351643b1d3e815360bfd69 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 
-;; Author: Alexandre Julliard
+;; Author: Alexandre Julliard <julliard@winehq.org>
 ;; Keywords: tools
 
 ;; This file is part of GNU Emacs.
 ;; - next-version (file rev)                      ??
 ;; - check-headers ()                             ??
 ;; - clear-headers ()                             ??
-;; - delete-file (file)                                   COMMENTED OUT, VERIFY IF CORRECT
-;; - rename-file (old new)                        COMMENTED OUT, VERIFY IF CORRECT
+;; - delete-file (file)                                   OK
+;; - rename-file (old new)                        OK
 ;; - find-file-hook ()                            PROBABLY NOT NEEDED
 ;; - find-file-not-found-hook ()                   PROBABLY NOT NEEDED
 
 
 (defun vc-git-find-version (file rev buffer)
   (let ((coding-system-for-read 'binary)
-        (coding-system-for-write 'binary))
+        (coding-system-for-write 'binary)
+       (fullname (substring
+                  (vc-git--run-command-string 
+                   file "ls-files" "-z" "--full-name" "--")
+                  0 -1)))
     (vc-git-command 
      buffer 0 
-     (concat (if rev rev "HEAD") ":" file) "cat-file" "blob")))
+     (concat (if rev rev "HEAD") ":" fullname) "cat-file" "blob")))
 
 (defun vc-git-checkout (file &optional editable rev)
   (vc-git-command nil0 file "checkout" (or rev "HEAD")))
              (point)
              (progn (forward-line 1) (1- (point))))))))))
 
-;; XXX verify this is correct
-;; (defun vc-git-delete-file (file)
-;;   (condition-case ()
-;;       (delete-file file)
-;;     (file-error nil))
-;;   (vc-git-command nil 0 file "update-index" "--remove"))
+(defun vc-git-delete-file (file)
+  (vc-git-command nil 0 file "rm" "-f" "--"))
 
-;; XXX verify this is correct
-;; (defun vc-git-rename-file (old new)
-;;   (vc-git-command nil 0 new old "mv"))
+(defun vc-git-rename-file (old new)
+  (vc-git-command nil 0 (list old new) "mv" "-f" "--"))
 
 \f
 ;; Internal commands