From: Dan Nicolaescu <dann@ics.uci.edu>
To: Glenn Morris <rgm@gnu.org>
Cc: 737@emacsbugs.donarmstrong.com
Subject: bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date"
Date: Thu, 2 Oct 2008 22:19:05 -0700 (PDT) [thread overview]
Message-ID: <200810030519.m935J5EL021457@mothra.ics.uci.edu> (raw)
In-Reply-To: <n1r66ye9hv.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu, 02 Oct 2008 21:46:20 -0400")
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)))))
>
next prev parent reply other threads:[~2008-10-03 5:19 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-17 21:12 bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date" Bob Rogers
2008-10-03 1:46 ` Glenn Morris
2008-10-03 5:19 ` Dan Nicolaescu [this message]
2008-10-03 7:07 ` Glenn Morris
2008-10-03 19:06 ` Dan Nicolaescu
2008-10-04 5:38 ` Dan Nicolaescu
2008-10-05 0:44 ` Glenn Morris
2008-10-05 1:04 ` Dan Nicolaescu
2008-10-05 1:27 ` Glenn Morris
2008-10-05 1:45 ` Glenn Morris
2008-10-05 2:01 ` Glenn Morris
2008-10-05 15:40 ` Dan Nicolaescu
2008-10-05 23:47 ` Glenn Morris
2008-10-05 2:24 ` Dan Nicolaescu
2008-10-05 2:10 ` Nick Roberts
2008-10-05 23:43 ` Glenn Morris
2008-10-06 0:33 ` Dan Nicolaescu
2008-10-06 6:26 ` Nick Roberts
2008-10-06 7:33 ` Glenn Morris
2008-10-06 7:53 ` Dan Nicolaescu
2008-10-06 9:12 ` Nick Roberts
2008-10-08 7:43 ` Glenn Morris
2008-10-09 4:52 ` Dan Nicolaescu
2008-10-10 1:39 ` Glenn Morris
2009-01-07 5:30 ` Stefan Monnier
2009-01-07 19:35 ` Dan Nicolaescu
2009-01-08 16:44 ` Stefan Monnier
2008-10-05 2:17 ` Nick Roberts
2009-01-07 5:33 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200810030519.m935J5EL021457@mothra.ics.uci.edu \
--to=dann@ics.uci.edu \
--cc=737@emacsbugs.donarmstrong.com \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.