diff options
| author | Dan Nicolaescu | 2010-06-08 23:48:29 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-06-08 23:48:29 -0700 |
| commit | 00fd1147bf88bdeb05832536d64db77f0e0ec3ac (patch) | |
| tree | 3ba4b956c3449890dcea708a158aa6fbc5defd1e | |
| parent | fab43c76d009176eff8c12a8cd19a0d1ed87156a (diff) | |
| download | emacs-00fd1147bf88bdeb05832536d64db77f0e0ec3ac.tar.gz emacs-00fd1147bf88bdeb05832536d64db77f0e0ec3ac.zip | |
Add optional support for resetting VC properties.
* lisp/vc-dispatcher.el (vc-resynch-window): Add new optional argument,
call vc-file-clearprops when true.
(vc-resynch-buffer): Add new optional argument, pass it down.
(vc-resynch-buffers-in-directory): Likewise.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/vc-dispatcher.el | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 681db215f37..0faeb774b49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2010-06-09 Dan Nicolaescu <dann@ics.uci.edu> | 1 | 2010-06-09 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 2 | ||
| 3 | Add optional support for resetting VC properties. | ||
| 4 | * vc-dispatcher.el (vc-resynch-window): Add new optional argument, | ||
| 5 | call vc-file-clearprops when true. | ||
| 6 | (vc-resynch-buffer): Add new optional argument, pass it down. | ||
| 7 | (vc-resynch-buffers-in-directory): Likewise. | ||
| 8 | |||
| 3 | Improve support for special markup in the VC commit message. | 9 | Improve support for special markup in the VC commit message. |
| 4 | * vc-mtn.el (vc-mtn-checkin): Add support for Author: and Date: markup. | 10 | * vc-mtn.el (vc-mtn-checkin): Add support for Author: and Date: markup. |
| 5 | * vc-hg.el (vc-hg-checkin): Add support for Date:. | 11 | * vc-hg.el (vc-hg-checkin): Add support for Date:. |
diff --git a/lisp/vc-dispatcher.el b/lisp/vc-dispatcher.el index 7892fed158f..00c580c2638 100644 --- a/lisp/vc-dispatcher.el +++ b/lisp/vc-dispatcher.el | |||
| @@ -446,7 +446,7 @@ ARG and NO-CONFIRM are passed on to `revert-buffer'." | |||
| 446 | (revert-buffer arg no-confirm t)) | 446 | (revert-buffer arg no-confirm t)) |
| 447 | (vc-restore-buffer-context context))) | 447 | (vc-restore-buffer-context context))) |
| 448 | 448 | ||
| 449 | (defun vc-resynch-window (file &optional keep noquery) | 449 | (defun vc-resynch-window (file &optional keep noquery reset-vc-info) |
| 450 | "If FILE is in the current buffer, either revert or unvisit it. | 450 | "If FILE is in the current buffer, either revert or unvisit it. |
| 451 | The choice between revert (to see expanded keywords) and unvisit | 451 | The choice between revert (to see expanded keywords) and unvisit |
| 452 | depends on KEEP. NOQUERY if non-nil inhibits confirmation for | 452 | depends on KEEP. NOQUERY if non-nil inhibits confirmation for |
| @@ -457,6 +457,8 @@ editing!" | |||
| 457 | (and (string= buffer-file-name file) | 457 | (and (string= buffer-file-name file) |
| 458 | (if keep | 458 | (if keep |
| 459 | (when (file-exists-p file) | 459 | (when (file-exists-p file) |
| 460 | (when reset-vc-info | ||
| 461 | (vc-file-clearprops file)) | ||
| 460 | (vc-revert-buffer-internal t noquery) | 462 | (vc-revert-buffer-internal t noquery) |
| 461 | 463 | ||
| 462 | ;; VC operations might toggle the read-only state. In | 464 | ;; VC operations might toggle the read-only state. In |
| @@ -477,24 +479,24 @@ editing!" | |||
| 477 | (declare-function vc-dir-resynch-file "vc-dir" (&optional fname)) | 479 | (declare-function vc-dir-resynch-file "vc-dir" (&optional fname)) |
| 478 | (declare-function vc-string-prefix-p "vc" (prefix string)) | 480 | (declare-function vc-string-prefix-p "vc" (prefix string)) |
| 479 | 481 | ||
| 480 | (defun vc-resynch-buffers-in-directory (directory &optional keep noquery) | 482 | (defun vc-resynch-buffers-in-directory (directory &optional keep noquery reset-vc-info) |
| 481 | "Resync all buffers that visit files in DIRECTORY." | 483 | "Resync all buffers that visit files in DIRECTORY." |
| 482 | (dolist (buffer (buffer-list)) | 484 | (dolist (buffer (buffer-list)) |
| 483 | (let ((fname (buffer-file-name buffer))) | 485 | (let ((fname (buffer-file-name buffer))) |
| 484 | (when (and fname (vc-string-prefix-p directory fname)) | 486 | (when (and fname (vc-string-prefix-p directory fname)) |
| 485 | (with-current-buffer buffer | 487 | (with-current-buffer buffer |
| 486 | (vc-resynch-buffer fname keep noquery)))))) | 488 | (vc-resynch-buffer fname keep noquery reset-vc-info)))))) |
| 487 | 489 | ||
| 488 | (defun vc-resynch-buffer (file &optional keep noquery) | 490 | (defun vc-resynch-buffer (file &optional keep noquery reset-vc-info) |
| 489 | "If FILE is currently visited, resynch its buffer." | 491 | "If FILE is currently visited, resynch its buffer." |
| 490 | (if (string= buffer-file-name file) | 492 | (if (string= buffer-file-name file) |
| 491 | (vc-resynch-window file keep noquery) | 493 | (vc-resynch-window file keep noquery reset-vc-info) |
| 492 | (if (file-directory-p file) | 494 | (if (file-directory-p file) |
| 493 | (vc-resynch-buffers-in-directory file keep noquery) | 495 | (vc-resynch-buffers-in-directory file keep noquery reset-vc-info) |
| 494 | (let ((buffer (get-file-buffer file))) | 496 | (let ((buffer (get-file-buffer file))) |
| 495 | (when buffer | 497 | (when buffer |
| 496 | (with-current-buffer buffer | 498 | (with-current-buffer buffer |
| 497 | (vc-resynch-window file keep noquery)))))) | 499 | (vc-resynch-window file keep noquery reset-vc-info)))))) |
| 498 | ;; Try to avoid unnecessary work, a *vc-dir* buffer is only present | 500 | ;; Try to avoid unnecessary work, a *vc-dir* buffer is only present |
| 499 | ;; if this is true. | 501 | ;; if this is true. |
| 500 | (when vc-dir-buffers | 502 | (when vc-dir-buffers |