diff options
| author | Dan Nicolaescu | 2007-07-23 20:51:02 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-07-23 20:51:02 +0000 |
| commit | 8b38ce2038e41c31aba39cd8fabfade7b1c8892b (patch) | |
| tree | c90092a5ddba27ce3b2c7800847dbdbc1ded67ec | |
| parent | d4443a0d7d0f65bd73a2059a46cb9992ffbfd779 (diff) | |
| download | emacs-8b38ce2038e41c31aba39cd8fabfade7b1c8892b.tar.gz emacs-8b38ce2038e41c31aba39cd8fabfade7b1c8892b.zip | |
(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
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/vc-git.el | 27 |
2 files changed, 19 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c2cb6e9529..09572aa1cd5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-07-23 Alexandre Julliard <julliard@winehq.org> | ||
| 2 | |||
| 3 | * vc-git.el (vc-git-delete-file, vc-git-rename-file): New functions. | ||
| 4 | (vc-git-find-version): Use the result of ls-files as a parameter | ||
| 5 | for cat-file | ||
| 6 | |||
| 1 | 2007-07-23 Michael Albinus <michael.albinus@gmx.de> | 7 | 2007-07-23 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 8 | ||
| 3 | * net/tramp.el (tramp-perl-file-attributes) | 9 | * net/tramp.el (tramp-perl-file-attributes) |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index f1a9d009f12..d65d8428e61 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Alexandre Julliard | 5 | ;; Author: Alexandre Julliard <julliard@winehq.org> |
| 6 | ;; Keywords: tools | 6 | ;; Keywords: tools |
| 7 | 7 | ||
| 8 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| @@ -101,8 +101,8 @@ | |||
| 101 | ;; - next-version (file rev) ?? | 101 | ;; - next-version (file rev) ?? |
| 102 | ;; - check-headers () ?? | 102 | ;; - check-headers () ?? |
| 103 | ;; - clear-headers () ?? | 103 | ;; - clear-headers () ?? |
| 104 | ;; - delete-file (file) COMMENTED OUT, VERIFY IF CORRECT | 104 | ;; - delete-file (file) OK |
| 105 | ;; - rename-file (old new) COMMENTED OUT, VERIFY IF CORRECT | 105 | ;; - rename-file (old new) OK |
| 106 | ;; - find-file-hook () PROBABLY NOT NEEDED | 106 | ;; - find-file-hook () PROBABLY NOT NEEDED |
| 107 | ;; - find-file-not-found-hook () PROBABLY NOT NEEDED | 107 | ;; - find-file-not-found-hook () PROBABLY NOT NEEDED |
| 108 | 108 | ||
| @@ -237,10 +237,14 @@ | |||
| 237 | 237 | ||
| 238 | (defun vc-git-find-version (file rev buffer) | 238 | (defun vc-git-find-version (file rev buffer) |
| 239 | (let ((coding-system-for-read 'binary) | 239 | (let ((coding-system-for-read 'binary) |
| 240 | (coding-system-for-write 'binary)) | 240 | (coding-system-for-write 'binary) |
| 241 | (fullname (substring | ||
| 242 | (vc-git--run-command-string | ||
| 243 | file "ls-files" "-z" "--full-name" "--") | ||
| 244 | 0 -1))) | ||
| 241 | (vc-git-command | 245 | (vc-git-command |
| 242 | buffer 0 | 246 | buffer 0 |
| 243 | (concat (if rev rev "HEAD") ":" file) "cat-file" "blob"))) | 247 | (concat (if rev rev "HEAD") ":" fullname) "cat-file" "blob"))) |
| 244 | 248 | ||
| 245 | (defun vc-git-checkout (file &optional editable rev) | 249 | (defun vc-git-checkout (file &optional editable rev) |
| 246 | (vc-git-command nil0 file "checkout" (or rev "HEAD"))) | 250 | (vc-git-command nil0 file "checkout" (or rev "HEAD"))) |
| @@ -383,16 +387,11 @@ | |||
| 383 | (point) | 387 | (point) |
| 384 | (progn (forward-line 1) (1- (point)))))))))) | 388 | (progn (forward-line 1) (1- (point)))))))))) |
| 385 | 389 | ||
| 386 | ;; XXX verify this is correct | 390 | (defun vc-git-delete-file (file) |
| 387 | ;; (defun vc-git-delete-file (file) | 391 | (vc-git-command nil 0 file "rm" "-f" "--")) |
| 388 | ;; (condition-case () | ||
| 389 | ;; (delete-file file) | ||
| 390 | ;; (file-error nil)) | ||
| 391 | ;; (vc-git-command nil 0 file "update-index" "--remove")) | ||
| 392 | 392 | ||
| 393 | ;; XXX verify this is correct | 393 | (defun vc-git-rename-file (old new) |
| 394 | ;; (defun vc-git-rename-file (old new) | 394 | (vc-git-command nil 0 (list old new) "mv" "-f" "--")) |
| 395 | ;; (vc-git-command nil 0 new old "mv")) | ||
| 396 | 395 | ||
| 397 | 396 | ||
| 398 | ;; Internal commands | 397 | ;; Internal commands |