emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vc-revert broken for Subversion files


From: Thien-Thi Nguyen
Subject: Re: vc-revert broken for Subversion files
Date: Sun, 22 Jul 2007 23:50:46 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

() Dan Nicolaescu <address@hidden>
() Sun, 22 Jul 2007 11:59:37 -0700

   This is a problem introduced a few days ago by changes to VC. vc now
   uses remove-if-not which is a function in cl-seq.el 
   You can work around this by doing: 
   M-x load-library RET cl RET
   M-x load-library RET cl-seq RET

   Hopefully someone will fix the code soon... 

a quick scan shows another problem in the same func where remove-if-not
was introduced (vc-stay-local-p): docstrings sez "return non-nil", but
if FILE is a list, the function returns a symbol, either `yes' or `no'.
furthermore, the docstring makes no mention of the case when FILE is a
list.  furthermore, there is no ChangeLog entry.  this last problem is
very grave, causing the quick scan mentioned at the beginning of this
paragraph to balloon into lots of time-wasting C-x v g digging.  grrr.

below is a patch.  here is a ChangeLog entry:

        * vc-hooks.el (vc-stay-local-p): Fix bug: Avoid remove-if-not.
        Also, when FILE is a list, return non-nil if any of the files
        are should stay local.  Update docstring.

note to whoever really understands the intent of vc-stay-local-p: the
opposite sense for FILE as list may be what you really want; please
review carefully.

thi


____________________________________________________________
*** vc-hooks.el 22 Jul 2007 19:04:10 -0000      1.195
--- vc-hooks.el 22 Jul 2007 21:42:22 -0000
***************
*** 159,167 ****
  
  (defun vc-stay-local-p (file)
    "Return non-nil if VC should stay local when handling FILE.
! This uses the `repository-hostname' backend operation."
    (if (listp file)
!       (if (remove-if-not (lambda (x) (not (vc-stay-local-p x))) file) 'no 
'yes)
      (let* ((backend (vc-backend file))
           (sym (vc-make-backend-sym backend 'stay-local))
           (stay-local (if (boundp sym) (symbol-value sym) t)))
--- 159,169 ----
  
  (defun vc-stay-local-p (file)
    "Return non-nil if VC should stay local when handling FILE.
! This uses the `repository-hostname' backend operation.
! If FILE is a list of files, return non-nil if any of them
! individually should stay local."
    (if (listp file)
!       (delq nil (mapcar 'vc-stay-local-p file))
      (let* ((backend (vc-backend file))
           (sym (vc-make-backend-sym backend 'stay-local))
           (stay-local (if (boundp sym) (symbol-value sym) t)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]