You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kalle Olavi Niemitalo <ko...@iki.fi> on 2005/08/19 20:56:08 UTC

[PATCH] psvn: Fix bogus comparisons of buffers to strings.

The current code is obviously wrong, and this is the right fix
(at least until psvn is changed to support multiple svn-status
buffers, in which case the major mode should be checked instead).
However, I am not sure the code *should* be fixed: I don't
understand its purpose, it has apparently never worked, and
nobody has complained, so perhaps it should be just removed
instead.


Re: [PATCH] psvn: Fix bogus comparisons of buffers to strings.

Posted by Kalle Olavi Niemitalo <ko...@iki.fi>.
Stefan Reichör <st...@xsteve.at> writes:

> I have applied that patch now.

While merging psvn.el changes from trunk to a local branch,
I noticed that you didn't apply all of the patch I posted.
I had posted this change:

>>  (defun svn-status-show-process-buffer-internal (&optional scroll-to-top)
>> -  (when (eq (current-buffer) "`svn-status-buffer-name'")
>> +  (when (string= (buffer-name) svn-status-buffer-name)
>>      (delete-other-windows))

You applied this in r15969:

 (defun svn-status-show-process-buffer-internal (&optional scroll-to-top)
-  (when (eq (current-buffer) "`svn-status-buffer-name'")
+  (when (eq (current-buffer) svn-status-buffer-name)
     (delete-other-windows))

This comparison will always return false.
I'm assuming that was inadvertent, so I'll change it soon.

Re: [PATCH] psvn: Fix bogus comparisons of buffers to strings.

Posted by Stefan Reichör <st...@xsteve.at>.
Kalle Olavi Niemitalo <ko...@iki.fi> writes:

> The current code is obviously wrong, and this is the right fix
> (at least until psvn is changed to support multiple svn-status
> buffers, in which case the major mode should be checked instead).
> However, I am not sure the code *should* be fixed: I don't
> understand its purpose, it has apparently never worked, and
> nobody has complained, so perhaps it should be just removed
> instead.

I have applied that patch now.

> [[[
> Fix bogus comparisons of buffers to strings.
>
> * contrib/client-side/psvn/psvn.el
>   (svn-status-show-process-output): Don't compare the current buffer to
>     the value of svn-status-buffer-name; it'd never match, because the
>     buffer object is not a string.  Compare the name of the buffer instead.
>   (svn-status-show-process-buffer-internal): Likewise, except the original
>     code compared the buffer to a *constant* string.
> ]]]
>
> --- contrib/client-side/psvn/psvn.el	(revision 15831 at svn.collab.net)
> +++ contrib/client-side/psvn/psvn.el	(local)
> @@ -2133,7 +2133,7 @@ (defun svn-status-create-arg-file (file-
>      (insert postfix))))
>  
>  (defun svn-status-show-process-buffer-internal (&optional scroll-to-top)
> -  (when (eq (current-buffer) "`svn-status-buffer-name'")
> +  (when (string= (buffer-name) svn-status-buffer-name)
>      (delete-other-windows))
>    (pop-to-buffer "*svn-process*")
>    (when svn-status-wash-control-M-in-process-buffers

That wrong code slipped in with a change in the docstrings from svn-status-buffer-name
`to svn-status-buffer-name'. I replaced it in a wrong place.


> @@ -2157,7 +2157,7 @@ (defun svn-status-show-process-output (c
>      (when svn-status-last-output-buffer-name
>        (if window-mode
>            (progn
> -            (when (eq (current-buffer) svn-status-buffer-name)
> +            (when (string= (buffer-name) svn-status-buffer-name)
>                (delete-other-windows))
>              (pop-to-buffer "*svn-process*")
>              (switch-to-buffer (get-buffer-create svn-status-last-output-buffer-name))

I committed that also, although I have no idea at the moment why that was used there :-|


Stefan.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org