[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: |
Dan Nicolaescu |
Subject: |
bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date" |
Date: |
Thu, 2 Oct 2008 22:19:05 -0700 (PDT) |
Glenn Morris <rgm@gnu.org> writes:
> 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".
Does this happen for git?
There's a `dir-status-files' VC method that would probably take care of
this issue and vc-git.el implements it.
> 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).
I don't think that's good, it would do too many file-exists-p calls in a
big directory.
> It also seems to me that vc-dir-hide-up-to-date should remove deleted
> unregistered files, hence the change to that function.
I don't think it should be doing that.
> 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, 2008/10/02
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date",
Dan Nicolaescu <=
- 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
- bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date", Glenn Morris, 2008/10/05