diff options
| author | Sam Steingold | 2008-05-01 17:46:27 +0000 |
|---|---|---|
| committer | Sam Steingold | 2008-05-01 17:46:27 +0000 |
| commit | a84615c77a3642de1ddc4f488017adfab586a33e (patch) | |
| tree | 7615edb64db462179ecf1db39da91520254545b8 | |
| parent | 1cb119fdbfad4ef7a6eab4c3f56ac842eacc13ce (diff) | |
| download | emacs-a84615c77a3642de1ddc4f488017adfab586a33e.tar.gz emacs-a84615c77a3642de1ddc4f488017adfab586a33e.zip | |
(vc-delete-file): Check if the file has uncommitted changed.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc.el | 21 |
2 files changed, 17 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea4dad18234..cadc3d43105 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-05-01 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * vc.el (vc-delete-file): Check if the file has uncommitted changed. | ||
| 4 | |||
| 1 | 2008-05-01 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2008-05-01 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * Makefile.in: Revert incorrect fix for claimed bootstrap breakage. | 7 | * Makefile.in: Revert incorrect fix for claimed bootstrap breakage. |
diff --git a/lisp/vc.el b/lisp/vc.el index c219f6fc604..d39aa0e8153 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -672,20 +672,17 @@ | |||
| 672 | ;; - vc-cvs-delete-file should not do a "cvs commit" immediately after | 672 | ;; - vc-cvs-delete-file should not do a "cvs commit" immediately after |
| 673 | ;; removing the file. | 673 | ;; removing the file. |
| 674 | ;; | 674 | ;; |
| 675 | ;; - vc-delete-file should check if the file contains non-checked in | ||
| 676 | ;; changes and warn about losing them. | ||
| 677 | ;; | ||
| 678 | ;; - vc-create-snapshot and vc-retrieve-snapshot should update the | 675 | ;; - vc-create-snapshot and vc-retrieve-snapshot should update the |
| 679 | ;; buffers that might be visiting the affected files. | 676 | ;; buffers that might be visiting the affected files. |
| 680 | ;; | 677 | ;; |
| 681 | ;; - Using multiple backends needs work. Given a CVS directory with some | 678 | ;; - Using multiple backends needs work. Given a CVS directory with some |
| 682 | ;; files checked into git (but not all), using C-x v l to get a log file | 679 | ;; files checked into git (but not all), using C-x v l to get a log file |
| 683 | ;; from a file only present in git, and then typing RET on some log entry, | 680 | ;; from a file only present in git, and then typing RET on some log entry, |
| 684 | ;; vc will bombs out because it wants to see the file being in CVS. | 681 | ;; vc will bombs out because it wants to see the file being in CVS. |
| 685 | ;; Those logs should likely use a local variable to hardware the VC they | 682 | ;; Those logs should likely use a local variable to hardware the VC they |
| 686 | ;; are supposed to work with. | 683 | ;; are supposed to work with. |
| 687 | ;; | 684 | ;; |
| 688 | ;; More issues here: | 685 | ;; More issues here: |
| 689 | ;; http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00664.html | 686 | ;; http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00664.html |
| 690 | 687 | ||
| 691 | ;;; Code: | 688 | ;;; Code: |
| @@ -2998,6 +2995,9 @@ specific headers." | |||
| 2998 | (define-key map "x" 'vc-dir-hide-up-to-date) | 2995 | (define-key map "x" 'vc-dir-hide-up-to-date) |
| 2999 | (define-key map "q" 'quit-window) | 2996 | (define-key map "q" 'quit-window) |
| 3000 | (define-key map "g" 'vc-dir-refresh) | 2997 | (define-key map "g" 'vc-dir-refresh) |
| 2998 | ;; PCL-CVS binds "r" to the delete function, but dann objects to ANY binding | ||
| 2999 | ;; <http://thread.gmane.org/gmane.emacs.devel/96234> | ||
| 3000 | ;; (define-key map "D" 'vc-dir-delete-file) | ||
| 3001 | (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process) | 3001 | (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process) |
| 3002 | ;; Does not work unless mouse sets point. Functions like vc-dir-find-file | 3002 | ;; Does not work unless mouse sets point. Functions like vc-dir-find-file |
| 3003 | ;; need to find the file from the mouse position, not `point'. | 3003 | ;; need to find the file from the mouse position, not `point'. |
| @@ -4037,7 +4037,12 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. | |||
| 4037 | (unless (vc-find-backend-function backend 'delete-file) | 4037 | (unless (vc-find-backend-function backend 'delete-file) |
| 4038 | (error "Deleting files under %s is not supported in VC" backend)) | 4038 | (error "Deleting files under %s is not supported in VC" backend)) |
| 4039 | (when (and buf (buffer-modified-p buf)) | 4039 | (when (and buf (buffer-modified-p buf)) |
| 4040 | (error "Please save files before deleting them")) | 4040 | (error "Please save or undo your changes before deleting %s" file)) |
| 4041 | (let ((state (vc-state file))) | ||
| 4042 | (when (eq state 'edited) | ||
| 4043 | (error "Please commit or undo your changes before deleting %s" file)) | ||
| 4044 | (when (eq state 'conflict) | ||
| 4045 | (error "Please resolve the conflicts before deleting %s" file))) | ||
| 4041 | (unless (y-or-n-p (format "Really want to delete %s? " | 4046 | (unless (y-or-n-p (format "Really want to delete %s? " |
| 4042 | (file-name-nondirectory file))) | 4047 | (file-name-nondirectory file))) |
| 4043 | (error "Abort!")) | 4048 | (error "Abort!")) |