unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>, emacs-devel@gnu.org
Subject: Re: vc-revert broken for Subversion files
Date: Sun, 22 Jul 2007 23:50:46 +0200	[thread overview]
Message-ID: <87d4ykt8eh.fsf@ambire.localdomain> (raw)
In-Reply-To: <200707221859.l6MIxbA9014188@oogie-boogie.ics.uci.edu> (Dan Nicolaescu's message of "Sun\, 22 Jul 2007 11\:59\:37 -0700")

() Dan Nicolaescu <dann@ics.uci.edu>
() 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	other threads:[~2007-07-22 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-22 15:21 vc-revert broken for Subversion files Bob Rogers
2007-07-22 18:22 ` timotheus
2007-07-22 21:08   ` Bob Rogers
2007-07-22 18:59 ` Dan Nicolaescu
2007-07-22 21:50   ` Thien-Thi Nguyen [this message]
2007-07-23 18:06     ` Richard Stallman
     [not found]       ` <87k5sq51lc.fsf@ambire.localdomain>
2007-07-24 16:45         ` Richard Stallman
2007-07-25 19:49           ` Stefan Monnier
2007-07-25 22:16             ` Thien-Thi Nguyen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d4ykt8eh.fsf@ambire.localdomain \
    --to=ttn@gnuvola.org \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    --cc=rogers-emacs@rgrjr.dyndns.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).