diff options
| author | Juanma Barranquero | 2004-04-20 16:49:26 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2004-04-20 16:49:26 +0000 |
| commit | b349012b10a0c5a031457a8c6bd6dbfbab451f5c (patch) | |
| tree | 25caaf8370e2350496f770756f5dffff4b88d781 | |
| parent | 1525ea1e3a5f11385f2ec108accc117bdbc99846 (diff) | |
| download | emacs-b349012b10a0c5a031457a8c6bd6dbfbab451f5c.tar.gz emacs-b349012b10a0c5a031457a8c6bd6dbfbab451f5c.zip | |
(vc-svn-print-log, vc-svn-diff): Add optional BUFFER arg.
Copied from Andre Spiegel's patch of 2004-03-21.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 15 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8ac677f025f..232173168c0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2004-04-20 Juanma Barranquero <lektu@terra.es> | 1 | 2004-04-20 Juanma Barranquero <lektu@terra.es> |
| 2 | 2 | ||
| 3 | * vc-svn.el (vc-svn-print-log, vc-svn-diff): Add optional BUFFER | ||
| 4 | arg. Copied from Andre Spiegel's patch of 2004-03-21. | ||
| 5 | |||
| 3 | * calendar/time-date.el (time-to-day-in-year): Fix docstring. | 6 | * calendar/time-date.el (time-to-day-in-year): Fix docstring. |
| 4 | 7 | ||
| 5 | 2004-04-20 Kenichi Handa <handa@m17n.org> | 8 | 2004-04-20 Kenichi Handa <handa@m17n.org> |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 08af8f01977..4db9788cc3b 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -334,21 +334,22 @@ The changes are between FIRST-VERSION and SECOND-VERSION." | |||
| 334 | ;;; History functions | 334 | ;;; History functions |
| 335 | ;;; | 335 | ;;; |
| 336 | 336 | ||
| 337 | (defun vc-svn-print-log (file) | 337 | (defun vc-svn-print-log (file &optional buffer) |
| 338 | "Get change log associated with FILE." | 338 | "Get change log associated with FILE." |
| 339 | (save-current-buffer | 339 | (save-current-buffer |
| 340 | (vc-setup-buffer nil) | 340 | (vc-setup-buffer buffer) |
| 341 | (let ((inhibit-read-only t)) | 341 | (let ((inhibit-read-only t)) |
| 342 | (goto-char (point-min)) | 342 | (goto-char (point-min)) |
| 343 | ;; Add a line to tell log-view-mode what file this is. | 343 | ;; Add a line to tell log-view-mode what file this is. |
| 344 | (insert "Working file: " (file-relative-name file) "\n")) | 344 | (insert "Working file: " (file-relative-name file) "\n")) |
| 345 | (vc-svn-command | 345 | (vc-svn-command |
| 346 | t | 346 | buffer |
| 347 | (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) | 347 | (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) |
| 348 | file "log"))) | 348 | file "log"))) |
| 349 | 349 | ||
| 350 | (defun vc-svn-diff (file &optional oldvers newvers) | 350 | (defun vc-svn-diff (file &optional oldvers newvers buffer) |
| 351 | "Get a difference report using SVN between two versions of FILE." | 351 | "Get a difference report using SVN between two versions of FILE." |
| 352 | (unless buffer (setq buffer "*vc-diff*")) | ||
| 352 | (if (string= (vc-workfile-version file) "0") | 353 | (if (string= (vc-workfile-version file) "0") |
| 353 | ;; This file is added but not yet committed; there is no master file. | 354 | ;; This file is added but not yet committed; there is no master file. |
| 354 | (if (or oldvers newvers) | 355 | (if (or oldvers newvers) |
| @@ -356,7 +357,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." | |||
| 356 | ;; We regard this as "changed". | 357 | ;; We regard this as "changed". |
| 357 | ;; Diff it against /dev/null. | 358 | ;; Diff it against /dev/null. |
| 358 | ;; Note: this is NOT a "svn diff". | 359 | ;; Note: this is NOT a "svn diff". |
| 359 | (apply 'vc-do-command "*vc-diff*" | 360 | (apply 'vc-do-command buffer |
| 360 | 1 "diff" file | 361 | 1 "diff" file |
| 361 | (append (vc-switches nil 'diff) '("/dev/null"))) | 362 | (append (vc-switches nil 'diff) '("/dev/null"))) |
| 362 | ;; Even if it's empty, it's locally modified. | 363 | ;; Even if it's empty, it's locally modified. |
| @@ -365,7 +366,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." | |||
| 365 | (async (and (vc-stay-local-p file) | 366 | (async (and (vc-stay-local-p file) |
| 366 | (or oldvers newvers) ; Svn diffs those locally. | 367 | (or oldvers newvers) ; Svn diffs those locally. |
| 367 | (fboundp 'start-process)))) | 368 | (fboundp 'start-process)))) |
| 368 | (apply 'vc-svn-command "*vc-diff*" | 369 | (apply 'vc-svn-command buffer |
| 369 | (if async 'async 0) | 370 | (if async 'async 0) |
| 370 | file "diff" | 371 | file "diff" |
| 371 | (append | 372 | (append |
| @@ -377,7 +378,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." | |||
| 377 | (if async 1 ; async diff => pessimistic assumption | 378 | (if async 1 ; async diff => pessimistic assumption |
| 378 | ;; For some reason `svn diff' does not return a useful | 379 | ;; For some reason `svn diff' does not return a useful |
| 379 | ;; status w.r.t whether the diff was empty or not. | 380 | ;; status w.r.t whether the diff was empty or not. |
| 380 | (buffer-size (get-buffer "*vc-diff*")))))) | 381 | (buffer-size (get-buffer buffer)))))) |
| 381 | 382 | ||
| 382 | (defun vc-svn-diff-tree (dir &optional rev1 rev2) | 383 | (defun vc-svn-diff-tree (dir &optional rev1 rev2) |
| 383 | "Diff all files at and below DIR." | 384 | "Diff all files at and below DIR." |