unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* pcl-cvs: suppress empty dirs?
@ 2006-05-06 22:35 Robin Dunn
  2006-05-07  4:22 ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Robin Dunn @ 2006-05-06 22:35 UTC (permalink / raw)


Hi,

I've just started using a emacs 22.0.50 snapshot and have been able to 
migrate all of my prior settings and customizations, but there is one 
new 'feature' that is bugging me.  When I do a cvs-examine in pcl-cvs 
then any old empty directories still in the repository are showing up 
with "new-dir  Need-Update" which is real annoying.  I'd rather that 
they just didn't show up at all like in the old version.  I've tried 
setting cvs-auto-remove-directories, and adding a regex to 
cvs-parse-ignored-messages, but still no luck.  Does anybody know how to 
suppress these lines?  They come from the cvs server like this:

cvs server: New directory `this/is/the/pathname' -- ignored

Robin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pcl-cvs: suppress empty dirs?
  2006-05-06 22:35 pcl-cvs: suppress empty dirs? Robin Dunn
@ 2006-05-07  4:22 ` Stefan Monnier
  2006-05-12 12:09   ` Jérôme
  2006-05-16 22:11   ` pcl-cvs: suppress empty dirs? Robin Dunn
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2006-05-07  4:22 UTC (permalink / raw)


> feature' that is bugging me.  When I do a cvs-examine in pcl-cvs then any
> old empty directories still in the repository are showing up with "new-dir
> Need-Update" which is real annoying.

Yes, it's annoying, but it can be very useful if it really means what
it says.  To get rid of the warning, add the entry to the .cvsignore file
(with a final /).


        Stefan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pcl-cvs: suppress empty dirs?
  2006-05-07  4:22 ` Stefan Monnier
@ 2006-05-12 12:09   ` Jérôme
  2006-05-16  6:41     ` detection of coding-system in cvs-retrieve-revision (was: pcl-cvs: suppress empty dirs?) Stefan Monnier
  2006-05-16 22:11   ` pcl-cvs: suppress empty dirs? Robin Dunn
  1 sibling, 1 reply; 10+ messages in thread
From: Jérôme @ 2006-05-12 12:09 UTC (permalink / raw)


I am in the same testing situation.
I face again the problem discussed in

http://groups.google.fr/group/gnu.emacs.help/index/browse_frm/thread/7e593f35d0d991eb

Is there any better solution than patching - again -
cvs-retrieve-revision

^ permalink raw reply	[flat|nested] 10+ messages in thread

* detection of coding-system in cvs-retrieve-revision (was: pcl-cvs: suppress empty dirs?)
  2006-05-12 12:09   ` Jérôme
@ 2006-05-16  6:41     ` Stefan Monnier
  2006-05-16  7:52       ` Jérôme
  2006-05-20  3:21       ` RichH
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2006-05-16  6:41 UTC (permalink / raw)


> I am in the same testing situation.
> I face again the problem discussed in

> http://groups.google.fr/group/gnu.emacs.help/index/browse_frm/thread/7e593f35d0d991eb

> Is there any better solution than patching - again -
> cvs-retrieve-revision

Contacting the author would be a good way to maximize the chances that the
problem gets fixed, so that you won't have to re-patch again and again.

Does the patch below do the right thing?


        Stefan


Index: lisp/pcvs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/pcvs.el,v
retrieving revision 1.90
diff -u -r1.90 pcvs.el
--- lisp/pcvs.el	6 Feb 2006 14:33:34 -0000	1.90
+++ lisp/pcvs.el	16 May 2006 06:40:12 -0000
@@ -1722,16 +1722,22 @@
 	  (message "Retrieving revision %s..." rev)
 	  ;; Discard stderr output to work around the CVS+SSH+libc
 	  ;; problem when stdout and stderr are the same.
-	  (let ((res (apply 'call-process cvs-program nil '(t nil) nil
-			    "-q" "update" "-p"
-			    ;; If `rev' is HEAD, don't pass it at all:
-			    ;; the default behavior is to get the head
-			    ;; of the current branch whereas "-r HEAD"
-			    ;; stupidly gives you the head of the trunk.
-			    (append (unless (equal rev "HEAD") (list "-r" rev))
-				    (list file)))))
+	  (let ((res
+                 (let ((coding-system-for-read 'binary))
+                   (apply 'call-process cvs-program nil '(t nil) nil
+                          "-q" "update" "-p"
+                          ;; If `rev' is HEAD, don't pass it at all:
+                          ;; the default behavior is to get the head
+                          ;; of the current branch whereas "-r HEAD"
+                          ;; stupidly gives you the head of the trunk.
+                          (append (unless (equal rev "HEAD") (list "-r" rev))
+                                  (list file))))))
 	    (when (and res (not (and (equal 0 res))))
 	      (error "Something went wrong retrieving revision %s: %s" rev res))
+            ;; Figure out the encoding used and decode the byte-sequence
+            ;; into a sequence of chars.
+            (decode-coding-inserted-region
+             (point-min) (point-max) file t nil nil t)
 	    (set-buffer-modified-p nil)
 	    (let ((buffer-file-name (expand-file-name file)))
 	      (after-find-file))

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: detection of coding-system in cvs-retrieve-revision (was: pcl-cvs: suppress empty dirs?)
  2006-05-16  6:41     ` detection of coding-system in cvs-retrieve-revision (was: pcl-cvs: suppress empty dirs?) Stefan Monnier
@ 2006-05-16  7:52       ` Jérôme
  2006-05-20  3:21       ` RichH
  1 sibling, 0 replies; 10+ messages in thread
From: Jérôme @ 2006-05-16  7:52 UTC (permalink / raw)


Hello
Yes, It seems to do the right thing

Sorry not to contact you directly, but I thought that you were one of
the contributors of the original thread.

And I really start using Emacs 22 only a little while ago.

Thanks again.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pcl-cvs: suppress empty dirs?
  2006-05-07  4:22 ` Stefan Monnier
  2006-05-12 12:09   ` Jérôme
@ 2006-05-16 22:11   ` Robin Dunn
  2006-05-17  3:32     ` Eli Zaretskii
                       ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Robin Dunn @ 2006-05-16 22:11 UTC (permalink / raw)


Stefan Monnier wrote:
>> feature' that is bugging me.  When I do a cvs-examine in pcl-cvs then any
>> old empty directories still in the repository are showing up with "new-dir
>> Need-Update" which is real annoying.
> 
> Yes, it's annoying, but it can be very useful if it really means what
> it says.  

We've got about 10 years or so of revisions in the CVS repository of a 
very active project and have ended up with a lot of directories that are 
now empty (no current revisions, just stuff in the Attic) and so with 
this new 'feature' of pcl-cvs we can end up with 150+ lines of garbage 
in the buffer hiding the few lines that really mean something.  If the 
cvs output says that it is "ignored" shouldn't pcl-cvs ignore it too?

> To get rid of the warning, add the entry to the .cvsignore file
> (with a final /).

The problem with this is that I also use CVS repositories that I don't 
have write access too, so instead of the new-dir lines I'll end up with 
lines telling me that .cvsignore has been updated.

I've written a small script to wrap cvs such that if "update" is on the 
command line it pipes cvs's output through grep to remove the lines that 
are confusing pcl-cvs.  It works fine on Linux and OS X, but so far I 
can't seem to get the pcl-cvs on Windows to execute anything but an .exe 
file...


#!/bin/bash

CVS=/usr/bin/cvs
TRIM=no

for a in "$@"; do
     if [ "$a" == "update" ]; then
	TRIM=yes
     fi
done

if [ "$TRIM" == "yes" ]; then
     $CVS "$@" 2>&1 | grep -ve "New directory.*ignored"
else
     $CVS "$@"
fi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pcl-cvs: suppress empty dirs?
  2006-05-16 22:11   ` pcl-cvs: suppress empty dirs? Robin Dunn
@ 2006-05-17  3:32     ` Eli Zaretskii
  2006-05-17 20:27     ` Steinar Bang
       [not found]     ` <mailman.1963.1147897698.9609.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2006-05-17  3:32 UTC (permalink / raw)


> From: Robin Dunn <robin@alldunn.com>
> Date: Tue, 16 May 2006 15:11:11 -0700
> 
> I've written a small script to wrap cvs such that if "update" is on the 
> command line it pipes cvs's output through grep to remove the lines that 
> are confusing pcl-cvs.  It works fine on Linux and OS X, but so far I 
> can't seem to get the pcl-cvs on Windows to execute anything but an .exe 
> file...

If you convert the script to a Windows batch file, you will have no
problem running it on Windows, exactly like you run shell scripts on
Unix and GNU/Linux.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pcl-cvs: suppress empty dirs?
  2006-05-16 22:11   ` pcl-cvs: suppress empty dirs? Robin Dunn
  2006-05-17  3:32     ` Eli Zaretskii
@ 2006-05-17 20:27     ` Steinar Bang
       [not found]     ` <mailman.1963.1147897698.9609.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Steinar Bang @ 2006-05-17 20:27 UTC (permalink / raw)


>>>>> Robin Dunn <robin@alldunn.com>:

> We've got about 10 years or so of revisions in the CVS repository of
> a very active project and have ended up with a lot of directories
> that are now empty (no current revisions, just stuff in the Attic)
> and so with this new 'feature' of pcl-cvs we can end up with 150+
> lines of garbage in the buffer hiding the few lines that really mean
> something.

I agree.  If this is the default behaviour of the next Emacs, I will
have to see if I can get an older pcl-cvs to run, overriding the one
distributed with emacs.

Which would be both a hazzle and a pity, from my POV.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: detection of coding-system in cvs-retrieve-revision (was: pcl-cvs: suppress empty dirs?)
  2006-05-16  6:41     ` detection of coding-system in cvs-retrieve-revision (was: pcl-cvs: suppress empty dirs?) Stefan Monnier
  2006-05-16  7:52       ` Jérôme
@ 2006-05-20  3:21       ` RichH
  1 sibling, 0 replies; 10+ messages in thread
From: RichH @ 2006-05-20  3:21 UTC (permalink / raw)



Should I report pcl-cvs bugs to you?

cvs-commit of things in multiple directories is broken
in the latest win32 version (22.0.50.1).  There seems to
be an extra -f on the second execution of cvs.

Cheers,
Rich


In article <87iro6qxrp.fsf-monnier+gnu.emacs.help@gnu.org>, 
monnier@iro.umontreal.ca says...
> > I am in the same testing situation.
> > I face again the problem discussed in
> 
> > http://groups.google.fr/group/gnu.emacs.help/index/browse_frm/thread/7e593f35d0d991eb
> 
> > Is there any better solution than patching - again -
> > cvs-retrieve-revision
> 
> Contacting the author would be a good way to maximize the chances that the
> problem gets fixed, so that you won't have to re-patch again and again.
> 
> Does the patch below do the right thing?
> 
> 
>         Stefan
> 
> 
> Index: lisp/pcvs.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/pcvs.el,v
> retrieving revision 1.90
> diff -u -r1.90 pcvs.el
> --- lisp/pcvs.el	6 Feb 2006 14:33:34 -0000	1.90
> +++ lisp/pcvs.el	16 May 2006 06:40:12 -0000
> @@ -1722,16 +1722,22 @@
>  	  (message "Retrieving revision %s..." rev)
>  	  ;; Discard stderr output to work around the CVS+SSH+libc
>  	  ;; problem when stdout and stderr are the same.
> -	  (let ((res (apply 'call-process cvs-program nil '(t nil) nil
> -			    "-q" "update" "-p"
> -			    ;; If `rev' is HEAD, don't pass it at all:
> -			    ;; the default behavior is to get the head
> -			    ;; of the current branch whereas "-r HEAD"
> -			    ;; stupidly gives you the head of the trunk.
> -			    (append (unless (equal rev "HEAD") (list "-r" rev))
> -				    (list file)))))
> +	  (let ((res
> +                 (let ((coding-system-for-read 'binary))
> +                   (apply 'call-process cvs-program nil '(t nil) nil
> +                          "-q" "update" "-p"
> +                          ;; If `rev' is HEAD, don't pass it at all:
> +                          ;; the default behavior is to get the head
> +                          ;; of the current branch whereas "-r HEAD"
> +                          ;; stupidly gives you the head of the trunk.
> +                          (append (unless (equal rev "HEAD") (list "-r" rev))
> +                                  (list file))))))
>  	    (when (and res (not (and (equal 0 res))))
>  	      (error "Something went wrong retrieving revision %s: %s" rev res))
> +            ;; Figure out the encoding used and decode the byte-sequence
> +            ;; into a sequence of chars.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pcl-cvs: suppress empty dirs?
       [not found]     ` <mailman.1963.1147897698.9609.help-gnu-emacs@gnu.org>
@ 2006-06-06 15:23       ` Jérôme
  0 siblings, 0 replies; 10+ messages in thread
From: Jérôme @ 2006-06-06 15:23 UTC (permalink / raw)


It is quite straightforward to patch pcvs-parse.el to have the Emacs 21
behavior.
See patch below.
Maybe it would be good to add an option to let people choose the
behavior they want.
I will try to suggest this to the maintainer of this package


*** c:/emacs-22/lisp/pcvs-parse.el	Tue May 30 12:15:49 2006
--- c:/emacs-22/lisp/pcvs-parse.el.orig	Mon May 01 13:43:48 2006
***************
*** 265,285 ****
         ;; [-n update] A new (or pruned) directory appeared but isn't
traversed
         (and
  	(cvs-match "New directory `\\(.*\\)' -- ignored$" (dir 1))
! 	(cvs-parsed-fileinfo 'MESSAGE " " (file-name-as-directory dir)))
  	;; These messages either correspond to a true new directory
  	;; that an update will bring in, or to a directory that's empty
  	;; on the current branch (either because it only exists in other
  	;; branches, or because it's been removed).
! ;; 	(if (ignore-errors
! ;; 	      (with-temp-buffer
! ;; 		(insert-file-contents (expand-file-name
! ;; 				       ".cvsignore" (file-name-directory dir)))
! ;; 		(goto-char (point-min))
! ;; 		(re-search-forward
! ;; 		 (concat "^" (regexp-quote (file-name-nondirectory dir)) "/$")
! ;; 		 nil t)))
! ;; 	    t		       ;The user requested to ignore those messages.
! ;; 	  (cvs-parsed-fileinfo '(NEED-UPDATE . NEW-DIR) dir t)))

         ;; File removed, since it is removed (by third party) in
repository.
         (and
--- 265,285 ----
         ;; [-n update] A new (or pruned) directory appeared but isn't
traversed
         (and
  	(cvs-match "New directory `\\(.*\\)' -- ignored$" (dir 1))
! 	;; (cvs-parsed-fileinfo 'MESSAGE " " (file-name-as-directory dir))
  	;; These messages either correspond to a true new directory
  	;; that an update will bring in, or to a directory that's empty
  	;; on the current branch (either because it only exists in other
  	;; branches, or because it's been removed).
! 	(if (ignore-errors
! 	      (with-temp-buffer
! 		(insert-file-contents (expand-file-name
! 				       ".cvsignore" (file-name-directory dir)))
! 		(goto-char (point-min))
! 		(re-search-forward
! 		 (concat "^" (regexp-quote (file-name-nondirectory dir)) "/$")
! 		 nil t)))
! 	    t		       ;The user requested to ignore those messages.
! 	  (cvs-parsed-fileinfo '(NEED-UPDATE . NEW-DIR) dir t)))

         ;; File removed, since it is removed (by third party) in
repository.
         (and

Steinar Bang a écrit :

>
> I agree.  If this is the default behaviour of the next Emacs, I will
> have to see if I can get an older pcl-cvs to run, overriding the one
> distributed with emacs.
> 
> Which would be both a hazzle and a pity, from my POV.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-06-06 15:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-06 22:35 pcl-cvs: suppress empty dirs? Robin Dunn
2006-05-07  4:22 ` Stefan Monnier
2006-05-12 12:09   ` Jérôme
2006-05-16  6:41     ` detection of coding-system in cvs-retrieve-revision (was: pcl-cvs: suppress empty dirs?) Stefan Monnier
2006-05-16  7:52       ` Jérôme
2006-05-20  3:21       ` RichH
2006-05-16 22:11   ` pcl-cvs: suppress empty dirs? Robin Dunn
2006-05-17  3:32     ` Eli Zaretskii
2006-05-17 20:27     ` Steinar Bang
     [not found]     ` <mailman.1963.1147897698.9609.help-gnu-emacs@gnu.org>
2006-06-06 15:23       ` Jérôme

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).