diff options
| author | Dan Nicolaescu | 2007-07-25 15:03:05 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-07-25 15:03:05 +0000 |
| commit | b747d346a22726e41ade73a477973732ccb7be30 (patch) | |
| tree | 37db64e5feb1f9775ee75db034724f991c553303 | |
| parent | 2c0ebf75eddeb9a5af0af4af2bc7e23793f17268 (diff) | |
| download | emacs-b747d346a22726e41ade73a477973732ccb7be30.tar.gz emacs-b747d346a22726e41ade73a477973732ccb7be30.zip | |
* vc-git.el (vc-git-log-view-mode): Port to the multi-file vc interface.
(vc-git-create-snapshot, vc-git-retrieve-snapshot): New functions.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc-git.el | 43 |
2 files changed, 34 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b4f3d4b8af..eaabf87af3e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-07-25 Alexandre Julliard <julliard@winehq.org> | ||
| 2 | |||
| 3 | * vc-git.el (vc-git-log-view-mode): Port to the multi-file vc interface. | ||
| 4 | (vc-git-create-snapshot, vc-git-retrieve-snapshot): New functions. | ||
| 5 | |||
| 1 | 2007-07-25 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 6 | 2007-07-25 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 2 | 7 | ||
| 3 | * ps-print.el (ps-multibyte-buffer): Docstring fix. | 8 | * ps-print.el (ps-multibyte-buffer): Docstring fix. |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 43cddbc3cf2..f48fb201bbe 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -40,7 +40,6 @@ | |||
| 40 | ;; - check if more functions could use vc-git-command instead | 40 | ;; - check if more functions could use vc-git-command instead |
| 41 | ;; of start-process. | 41 | ;; of start-process. |
| 42 | ;; - changelog generation | 42 | ;; - changelog generation |
| 43 | ;; - working with revisions other than HEAD | ||
| 44 | 43 | ||
| 45 | ;; Implement the rest of the vc interface. See the comment at the | 44 | ;; Implement the rest of the vc interface. See the comment at the |
| 46 | ;; beginning of vc.el. The current status is: | 45 | ;; beginning of vc.el. The current status is: |
| @@ -73,8 +72,11 @@ | |||
| 73 | ;; * checkout (file &optional editable rev) OK | 72 | ;; * checkout (file &optional editable rev) OK |
| 74 | ;; * revert (file &optional contents-done) OK | 73 | ;; * revert (file &optional contents-done) OK |
| 75 | ;; - rollback (files) ?? PROBABLY NOT NEEDED | 74 | ;; - rollback (files) ?? PROBABLY NOT NEEDED |
| 76 | ;; - merge (file rev1 rev2) NEEDED | 75 | ;; - merge (file rev1 rev2) It would be possible to merge changes into |
| 77 | ;; - merge-news (file) NEEDED | 76 | ;; a single file, but when committing they |
| 77 | ;; wouldn't be identified as a merge by git, | ||
| 78 | ;; so it's probably not a good idea. | ||
| 79 | ;; - merge-news (file) see `merge' | ||
| 78 | ;; - steal-lock (file &optional version) NOT NEEDED | 80 | ;; - steal-lock (file &optional version) NOT NEEDED |
| 79 | ;; HISTORY FUNCTIONS | 81 | ;; HISTORY FUNCTIONS |
| 80 | ;; * print-log (files &optional buffer) OK | 82 | ;; * print-log (files &optional buffer) OK |
| @@ -84,7 +86,7 @@ | |||
| 84 | ;; - logentry-check () ?? | 86 | ;; - logentry-check () ?? |
| 85 | ;; - comment-history (file) ?? | 87 | ;; - comment-history (file) ?? |
| 86 | ;; - update-changelog (files) ?? | 88 | ;; - update-changelog (files) ?? |
| 87 | ;; * diff (file &optional rev1 rev2 buffer) PORT TO NEW VC INTERFACE | 89 | ;; * diff (file &optional rev1 rev2 buffer) OK |
| 88 | ;; - revision-completion-table (file) NEEDED? | 90 | ;; - revision-completion-table (file) NEEDED? |
| 89 | ;; - diff-tree (dir &optional rev1 rev2) OK | 91 | ;; - diff-tree (dir &optional rev1 rev2) OK |
| 90 | ;; - annotate-command (file buf &optional rev) OK | 92 | ;; - annotate-command (file buf &optional rev) OK |
| @@ -92,9 +94,9 @@ | |||
| 92 | ;; - annotate-current-time () ?? NOT NEEDED | 94 | ;; - annotate-current-time () ?? NOT NEEDED |
| 93 | ;; - annotate-extract-revision-at-line () OK | 95 | ;; - annotate-extract-revision-at-line () OK |
| 94 | ;; SNAPSHOT SYSTEM | 96 | ;; SNAPSHOT SYSTEM |
| 95 | ;; - create-snapshot (dir name branchp) NEEDED | 97 | ;; - create-snapshot (dir name branchp) OK |
| 96 | ;; - assign-name (file name) NOT NEEDED | 98 | ;; - assign-name (file name) NOT NEEDED |
| 97 | ;; - retrieve-snapshot (dir name update) NEEDED | 99 | ;; - retrieve-snapshot (dir name update) OK, needs to handle the `name' arg |
| 98 | ;; MISCELLANEOUS | 100 | ;; MISCELLANEOUS |
| 99 | ;; - make-version-backups-p (file) ?? | 101 | ;; - make-version-backups-p (file) ?? |
| 100 | ;; - repository-hostname (dirname) ?? | 102 | ;; - repository-hostname (dirname) ?? |
| @@ -310,14 +312,11 @@ | |||
| 310 | ("^Date: \\(.+\\)" (1 'change-log-date)) | 312 | ("^Date: \\(.+\\)" (1 'change-log-date)) |
| 311 | ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))) | 313 | ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))) |
| 312 | 314 | ||
| 313 | (defun vc-git-diff (file &optional rev1 rev2 buffer) | 315 | (defun vc-git-diff (files &optional rev1 rev2 buffer) |
| 314 | (let ((name (file-relative-name file)) | 316 | (let ((buf (or buffer "*vc-diff*"))) |
| 315 | (buf (or buffer "*vc-diff*"))) | ||
| 316 | (if (and rev1 rev2) | 317 | (if (and rev1 rev2) |
| 317 | (vc-git-command buf 0 name "diff-tree" "-p" rev1 rev2 "--") | 318 | (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 "--") |
| 318 | (vc-git-command buf 0 name "diff-index" "-p" (or rev1 "HEAD") "--")) | 319 | (vc-git-command buf 1 files "diff-index" "--exit-code" "-p" (or rev1 "HEAD") "--")))) |
| 319 | ;; git-diff-index doesn't set exit status like diff does | ||
| 320 | (if (vc-git-workfile-unchanged-p file) 0 1))) | ||
| 321 | 320 | ||
| 322 | (defun vc-git-diff-tree (dir &optional rev1 rev2) | 321 | (defun vc-git-diff-tree (dir &optional rev1 rev2) |
| 323 | (vc-git-diff dir rev1 rev2)) | 322 | (vc-git-diff dir rev1 rev2)) |
| @@ -338,6 +337,22 @@ | |||
| 338 | (and (looking-at "[0-9a-f]+") | 337 | (and (looking-at "[0-9a-f]+") |
| 339 | (buffer-substring-no-properties (match-beginning 0) (match-end 0))))) | 338 | (buffer-substring-no-properties (match-beginning 0) (match-end 0))))) |
| 340 | 339 | ||
| 340 | ;;; SNAPSHOT SYSTEM | ||
| 341 | |||
| 342 | (defun vc-git-create-snapshot (dir name branchp) | ||
| 343 | (let ((default-directory dir)) | ||
| 344 | (and (vc-git-command nil 0 nil "update-index" "--refresh") | ||
| 345 | (if branchp | ||
| 346 | (vc-git-command nil 0 nil "checkout" "-b" name) | ||
| 347 | (vc-git-command nil 0 nil "tag" name))))) | ||
| 348 | |||
| 349 | (defun vc-git-retrieve-snapshot (dir name update) | ||
| 350 | (let ((default-directory dir)) | ||
| 351 | (vc-git-command nil 0 nil "checkout" name) | ||
| 352 | ;; FIXME: update buffers if `update' is true | ||
| 353 | )) | ||
| 354 | |||
| 355 | |||
| 341 | ;;; MISCELLANEOUS | 356 | ;;; MISCELLANEOUS |
| 342 | 357 | ||
| 343 | (defun vc-git-previous-version (file rev) | 358 | (defun vc-git-previous-version (file rev) |
| @@ -397,7 +412,7 @@ | |||
| 397 | (vc-git-command nil 0 (list old new) "mv" "-f" "--")) | 412 | (vc-git-command nil 0 (list old new) "mv" "-f" "--")) |
| 398 | 413 | ||
| 399 | 414 | ||
| 400 | ;; Internal commands | 415 | ;;; Internal commands |
| 401 | 416 | ||
| 402 | (defun vc-git-root (file) | 417 | (defun vc-git-root (file) |
| 403 | (vc-find-root file ".git")) | 418 | (vc-find-root file ".git")) |