GNU bug report logs - #5298
file VC state not updated after a directory check in

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>

Date: Sun, 3 Jan 2010 18:15:02 UTC

Severity: normal

Done: Dan Nicolaescu <dann <at> ics.uci.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5298 in the body.
You can then email your comments to 5298 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5298; Package emacs. (Sun, 03 Jan 2010 18:15:02 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: file VC state not updated after a directory check in
Date: Sun, 3 Jan 2010 10:12:19 -0800 (PST)
mkdir /tmp/test
cd /tmp/test
bzr init
echo blah > foo
bzr add foo

emacs -Q 
C-x C-f /tmp/test/foo RET
C-x v d /tmp/test RET

Move point to "./" 

C-x v v
write something in the log-edit buffer.  
C-c C-c

now see that in the *vc-dir* the state for "foo" has changed to `up-to-date'

but the mode-line for the "foo" buffer does not show that the buffer is
up to date.
(vc-state "/tmp/test/foo") returns `added'.

The buffer content has been reverted as expected (this can be verified
by using a VCS that does keyword expansion and adding a "$Id$" in
"foo").

If the point is on the "foo" line instead of "./" everything works as
expected, the VC state is updated.  The problem only happens when
checking in directories.

"bzr" is just used as an example above, the problem happens with all VC backends.








Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5298; Package emacs. (Tue, 05 Jan 2010 02:56:02 GMT) Full text and rfc822 format available.

Message #6 received at 5298 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: 5298 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#5298: file VC state not updated after a directory check in
Date: Mon, 4 Jan 2010 18:55:34 -0800 (PST)
Dan Nicolaescu <dann <at> ics.uci.edu> writes:

  > mkdir /tmp/test
  > cd /tmp/test
  > bzr init
  > echo blah > foo
  > bzr add foo
  > 
  > emacs -Q 
  > C-x C-f /tmp/test/foo RET
  > C-x v d /tmp/test RET
  > 
  > Move point to "./" 
  > 
  > C-x v v
  > write something in the log-edit buffer.  
  > C-c C-c
  > 
  > now see that in the *vc-dir* the state for "foo" has changed to `up-to-date'
  > 
  > but the mode-line for the "foo" buffer does not show that the buffer is
  > up to date.
  > (vc-state "/tmp/test/foo") returns `added'.
  > 
  > The buffer content has been reverted as expected (this can be verified
  > by using a VCS that does keyword expansion and adding a "$Id$" in
  > "foo").
  > 
  > If the point is on the "foo" line instead of "./" everything works as
  > expected, the VC state is updated.  The problem only happens when
  > checking in directories.
  > 
  > "bzr" is just used as an example above, the problem happens with all VC backends.

This can be solved by extending `with-vc-properties' to actually do
something when passed a directory argument: apply the properties to all
buffers in that directory.

Stefan, WDYT?

--- vc.el.~1.746.~	2009-12-07 03:49:17.000000000 -0800
+++ vc.el	2010-01-04 18:51:46.000000000 -0800
@@ -791,13 +791,23 @@ in their implementation of vc-BACKEND-di
 
 (defmacro with-vc-properties (files form settings)
   "Execute FORM, then maybe set per-file properties for FILES.
+If any of FILES is actually a directory, then do the same for all
+buffers for files in that directory.
 SETTINGS is an association list of property/value pairs.  After
 executing FORM, set those properties from SETTINGS that have not yet
 been updated to their corresponding values."
   (declare (debug t))
-  `(let ((vc-touched-properties (list t)))
-     ,form
+  `(let ((vc-touched-properties (list t))
+	 (flist nil))
      (dolist (file ,files)
+       (if (file-directory-p file)
+	   (dolist (buffer (buffer-list))
+	     (let ((fname (buffer-file-name buffer)))
+	       (when (and fname (vc-string-prefix-p file fname))
+		 (push fname flist))))
+	 (push file flist)))
+     ,form
+     (dolist (file flist)
        (dolist (setting ,settings)
          (let ((property (car setting)))
            (unless (memq property vc-touched-properties)




Reply sent to Dan Nicolaescu <dann <at> ics.uci.edu>:
You have taken responsibility. (Sun, 17 Jan 2010 22:24:02 GMT) Full text and rfc822 format available.

Notification sent to Dan Nicolaescu <dann <at> ics.uci.edu>:
bug acknowledged by developer. (Sun, 17 Jan 2010 22:24:02 GMT) Full text and rfc822 format available.

Message #11 received at 5298-done <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: 5298-done <at> debbugs.gnu.org
Subject: Re: bug#5298: file VC state not updated after a directory check in
Date: Sun, 17 Jan 2010 14:23:38 -0800 (PST)
Fixed.




bug archived. Request was from Debbugs Internal Request <bug-gnu-emacs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 15 Feb 2010 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.