From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date" Date: Thu, 02 Oct 2008 21:46:20 -0400 Message-ID: References: <18600.37952.844941.609726@rgrjr.rgrjr.dyndns.org> Reply-To: Glenn Morris , 737@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222999813 6639 80.91.229.12 (3 Oct 2008 02:10:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Oct 2008 02:10:13 +0000 (UTC) Cc: Dan Nicolaescu To: 737@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 03 04:11:11 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kla8L-0000sW-Ez for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Oct 2008 04:11:09 +0200 Original-Received: from localhost ([127.0.0.1]:34730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kla7H-00089C-QO for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Oct 2008 22:10:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kla7D-00088z-NO for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2008 22:09:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kla7C-00088m-Ty for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2008 22:09:59 -0400 Original-Received: from [199.232.76.173] (port=56278 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kla7C-00088j-PV for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2008 22:09:58 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42067) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kla7C-0006eG-KK for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2008 22:09:58 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9329u2V014464; Thu, 2 Oct 2008 19:09:56 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m931t3Q2010298; Thu, 2 Oct 2008 18:55:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Glenn Morris Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 03 Oct 2008 01:55:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 737 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 737-submit@emacsbugs.donarmstrong.com id=B737.12229985209073 (code B ref 737); Fri, 03 Oct 2008 01:55:03 +0000 Original-Received: (at 737) by emacsbugs.donarmstrong.com; 3 Oct 2008 01:48:40 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m931mbFx009067 for <737@emacsbugs.donarmstrong.com>; Thu, 2 Oct 2008 18:48:38 -0700 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KlZkK-0001Sv-FD; Thu, 02 Oct 2008 21:46:20 -0400 X-Spook: S Key Vickie Weaver KGB NWO morse Ansar al-Islam John X-Ran: 0Jw>:G"0A/>V$:"#|_wYe2Z/1/W${7^.eQlo-;Ecf%XxFRI`Nk=m^1RZfXgsb3(:%qbjhF X-Hue: black X-Attribution: GM In-Reply-To: <18600.37952.844941.609726@rgrjr.rgrjr.dyndns.org> (Bob Rogers's message of "Sun, 17 Aug 2008 17:12:32 -0400") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 02 Oct 2008 22:09:59 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21019 Archived-At: 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)))))