[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date"
From: |
Glenn Morris |
Subject: |
bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date" |
Date: |
Thu, 02 Oct 2008 21:46:20 -0400 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Bob Rogers wrote:
> 0. Identify a version-controlled directory, call it "foo", and
> create an unregistered file there; call it "bar.text". (Both CVS and
> SVN work; haven't tried others.)
>
> 1. "emacs -Q" in the "foo" directory.
>
> 2. "C-x v d RET" will correctly show the file as "unregistered".
>
> 3. Delete "foo/bar.text" via dired or in a shell.
>
> 4. Type "g" in vc-dir to update. The removed "bar.text" file is now
> listed incongruously as "up-to-date".
Dan, can you comment on this patch please? Is it correct to assume
that a non-existent file described as up-to-date must be a deleted,
unregistered one? If not, I guess removing deleted, unregistered files
must be done before the call to the backend's dir-status-files
function (basically, a version of vc-dir-hide-up-to-date that only
removes deleted, unregistered things).
It also seems to me that vc-dir-hide-up-to-date should remove deleted
unregistered files, hence the change to that function.
I'm also unsure if I need to call expand-file-name on the name part at
any point...
TIA.
*** vc-dir.el 25 Aug 2008 15:14:54 -0000 1.22
--- vc-dir.el 3 Oct 2008 01:40:02 -0000
***************
*** 978,985 ****
(eq (vc-dir-fileinfo->state info)
'up-to-date))
(setf (vc-dir-fileinfo->state info) nil))
!
! (not (vc-dir-fileinfo->needs-update
info))))))))))))
(defun vc-dir-revert-buffer-function (&optional ignore-auto noconfirm)
(vc-dir-refresh))
--- 978,994 ----
(eq (vc-dir-fileinfo->state info)
'up-to-date))
(setf (vc-dir-fileinfo->state info) nil))
! (unless
! ;; If the file does not exist, but
! ;; is described as up-to-date, it
! ;; can only be an unregistered,
! ;; deleted one (?).
! (and (eq (vc-dir-fileinfo->state info)
! 'up-to-date)
! (not (file-exists-p
! (vc-dir-fileinfo->name info))))
! (not (vc-dir-fileinfo->needs-update
! info)))))))))))))
(defun vc-dir-revert-buffer-function (&optional ignore-auto noconfirm)
(vc-dir-refresh))
***************
*** 1064,1070 ****
;; Next item is a directory.
(vc-dir-fileinfo->directory (ewoc-data next))))
;; Remove files in the up-to-date state.
! (eq (vc-dir-fileinfo->state data) 'up-to-date))
(ewoc-delete vc-ewoc crt))
(setq crt prev)))))
--- 1073,1082 ----
;; Next item is a directory.
(vc-dir-fileinfo->directory (ewoc-data next))))
;; Remove files in the up-to-date state.
! (eq (vc-dir-fileinfo->state data) 'up-to-date)
! ;; A file which was deleted without ever being registered.
! (and (eq (vc-dir-fileinfo->state data) 'unregistered)
! (not (file-exists-p (vc-dir-fileinfo->name data)))))
(ewoc-delete vc-ewoc crt))
(setq crt prev)))))
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date",
Glenn Morris <=
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Dan Nicolaescu, 2008/10/03
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Dan Nicolaescu, 2008/10/04
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Glenn Morris, 2008/10/04
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Dan Nicolaescu, 2008/10/04
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Glenn Morris, 2008/10/04
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Glenn Morris, 2008/10/04
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Glenn Morris, 2008/10/04
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Dan Nicolaescu, 2008/10/05