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.

Full log


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)




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.