all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Is this a bug in vc-svn?
@ 2006-10-14 21:43 Leo
  2006-10-15 10:12 ` Richard Stallman
  2006-10-15 13:55 ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Leo @ 2006-10-14 21:43 UTC (permalink / raw)


Hi there,

I just moved to use svn yesterday. I have files version controlled in
RCS and SVN. When I open them, initially they will be using RCS as the
backend. I then change the backend to SVN. However the version number
shown in the mode line is still in RCS. Is this a bug?

This is tested in GNU Emacs 23.0.0.1 (i686-pc-linux-gnu, GTK+ Version
2.8.20) of 2006-10-04

-- 
Leo

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

* Re: Is this a bug in vc-svn?
  2006-10-14 21:43 Is this a bug in vc-svn? Leo
@ 2006-10-15 10:12 ` Richard Stallman
  2006-10-15 14:23   ` Leo
  2006-10-15 13:55 ` Stefan Monnier
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2006-10-15 10:12 UTC (permalink / raw)
  Cc: emacs-devel

Would you please test this in Emacs 22?
That is what we are actively debugging.

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

* Re: Is this a bug in vc-svn?
  2006-10-14 21:43 Is this a bug in vc-svn? Leo
  2006-10-15 10:12 ` Richard Stallman
@ 2006-10-15 13:55 ` Stefan Monnier
  2006-10-15 14:53   ` Leo
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2006-10-15 13:55 UTC (permalink / raw)
  Cc: emacs-devel

> I just moved to use svn yesterday. I have files version controlled in
> RCS and SVN.  When I open them, initially they will be using RCS as the
> backend. I then change the backend to SVN.  However the version number
> shown in the mode line is still in RCS.  Is this a bug?

Sounds like it.  Please provide a precise recipe.


        Stefan

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

* Re: Is this a bug in vc-svn?
  2006-10-15 10:12 ` Richard Stallman
@ 2006-10-15 14:23   ` Leo
  0 siblings, 0 replies; 10+ messages in thread
From: Leo @ 2006-10-15 14:23 UTC (permalink / raw)


On Sun, 15/10/06 11:12 +0100, Richard Stallman wrote:

> Would you please test this in Emacs 22?
> That is what we are actively debugging.

I will try to get an Emacs 22 running in a few days.
But for this bug, I'll provide a full test case and others can see if
it is reproducible in Emacs 22.

Thanks,
-- 
Leo

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

* Re: Is this a bug in vc-svn?
  2006-10-15 13:55 ` Stefan Monnier
@ 2006-10-15 14:53   ` Leo
  2006-10-18 12:55     ` Leo
  2006-10-20  7:55     ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Leo @ 2006-10-15 14:53 UTC (permalink / raw)


On Sun, 15/10/06 14:55 +0100, Stefan Monnier wrote:

>> I just moved to use svn yesterday. I have files version controlled in
>> RCS and SVN.  When I open them, initially they will be using RCS as the
>> backend. I then change the backend to SVN.  However the version number
>> shown in the mode line is still in RCS.  Is this a bug?
>
> Sounds like it.  Please provide a precise recipe.
>
>
>         Stefan

In shell:
      1. `cd /tmp'
      2. `mkdir wrk; cd wrk'
      3. `mkdir RCS; touch test;ci test; co -l test'
      4. `svnadmin create /tmp/repos'
      5. `svn co file:///tmp/repos .'
      6. `svn add test'
In Emacs ("emacs -Q"):
      7. C-x C-f /tmp/wrk/test RET ;; Modeline shows: RCS-1.1
      8. C-u C-x v b svn RET       ;; Modeline shows: RCS-1.1 but
         SVN-0 is expected.
      9. Add some changes to test and press `C-x v v'. After checkin
         modeline displays: SVN-1

thank you.

-- 
Leo

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

* Re: Is this a bug in vc-svn?
  2006-10-15 14:53   ` Leo
@ 2006-10-18 12:55     ` Leo
  2006-10-18 15:13       ` Stefan Monnier
  2006-10-20  7:55     ` Stefan Monnier
  1 sibling, 1 reply; 10+ messages in thread
From: Leo @ 2006-10-18 12:55 UTC (permalink / raw)


On Sun, 15/10/06 15:53 +0100, Leo wrote:

> On Sun, 15/10/06 14:55 +0100, Stefan Monnier wrote:
>
>>> I just moved to use svn yesterday. I have files version controlled in
>>> RCS and SVN.  When I open them, initially they will be using RCS as the
>>> backend. I then change the backend to SVN.  However the version number
>>> shown in the mode line is still in RCS.  Is this a bug?
>>
>> Sounds like it.  Please provide a precise recipe.
>>
>>
>>         Stefan
>
> In shell:
>       1. `cd /tmp'
>       2. `mkdir wrk; cd wrk'
>       3. `mkdir RCS; touch test;ci test; co -l test'
>       4. `svnadmin create /tmp/repos'
>       5. `svn co file:///tmp/repos .'
>       6. `svn add test'
> In Emacs ("emacs -Q"):
>       7. C-x C-f /tmp/wrk/test RET ;; Modeline shows: RCS-1.1
>       8. C-u C-x v b svn RET       ;; Modeline shows: RCS-1.1 but
>          SVN-0 is expected.
>       9. Add some changes to test and press `C-x v v'. After checkin
>          modeline displays: SVN-1
>
> thank you.

Any comments on this?

-- 
Leo

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

* Re: Is this a bug in vc-svn?
  2006-10-18 12:55     ` Leo
@ 2006-10-18 15:13       ` Stefan Monnier
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2006-10-18 15:13 UTC (permalink / raw)
  Cc: emacs-devel

>> In shell:
>> 1. `cd /tmp'
>> 2. `mkdir wrk; cd wrk'
>> 3. `mkdir RCS; touch test;ci test; co -l test'
>> 4. `svnadmin create /tmp/repos'
>> 5. `svn co file:///tmp/repos .'
>> 6. `svn add test'
>> In Emacs ("emacs -Q"):
>> 7. C-x C-f /tmp/wrk/test RET ;; Modeline shows: RCS-1.1
>> 8. C-u C-x v b svn RET       ;; Modeline shows: RCS-1.1 but
>> SVN-0 is expected.
>> 9. Add some changes to test and press `C-x v v'. After checkin
>> modeline displays: SVN-1
>> 
>> thank you.

> Any comments on this?

Sorry, I've been busy (and still am).  I'll probably have time next week,


        Stefan

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

* Re: Is this a bug in vc-svn?
  2006-10-15 14:53   ` Leo
  2006-10-18 12:55     ` Leo
@ 2006-10-20  7:55     ` Stefan Monnier
  2006-10-20 18:35       ` Leo
  2006-10-20 19:32       ` Leo
  1 sibling, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2006-10-20  7:55 UTC (permalink / raw)
  Cc: emacs-devel

>>> I just moved to use svn yesterday. I have files version controlled in
>>> RCS and SVN.  When I open them, initially they will be using RCS as the
>>> backend. I then change the backend to SVN.  However the version number
>>> shown in the mode line is still in RCS.  Is this a bug?
>> 
>> Sounds like it.  Please provide a precise recipe.
>> 
>> 
>> Stefan

> In shell:
>       1. `cd /tmp'
>       2. `mkdir wrk; cd wrk'
>       3. `mkdir RCS; touch test;ci test; co -l test'
>       4. `svnadmin create /tmp/repos'
>       5. `svn co file:///tmp/repos .'
>       6. `svn add test'
> In Emacs ("emacs -Q"):
>       7. C-x C-f /tmp/wrk/test RET ;; Modeline shows: RCS-1.1
>       8. C-u C-x v b svn RET       ;; Modeline shows: RCS-1.1 but
>          SVN-0 is expected.
>       9. Add some changes to test and press `C-x v v'. After checkin
>          modeline displays: SVN-1

The patch below should fix it.


        Stefan


Index: lisp/vc-svn.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-svn.el,v
retrieving revision 1.27
diff -u -r1.27 vc-svn.el
--- lisp/vc-svn.el	9 Feb 2006 03:47:00 -0000	1.27
+++ lisp/vc-svn.el	20 Oct 2006 07:51:17 -0000
@@ -125,8 +125,7 @@
                ;; an `error' by vc-do-command.
                (error nil))))
         (when (eq 0 status)
-          (vc-svn-parse-status t)
-          (eq 'SVN (vc-file-getprop file 'vc-backend)))))))
+          (vc-svn-parse-status file))))))
 
 (defun vc-svn-state (file &optional localp)
   "SVN-specific version of `vc-state'."
@@ -134,8 +133,7 @@
   (with-temp-buffer
     (cd (file-name-directory file))
     (vc-svn-command t 0 file "status" (if localp "-v" "-u"))
-    (vc-svn-parse-status localp)
-    (vc-file-getprop file 'vc-state)))
+    (vc-svn-parse-status file)))
 
 (defun vc-svn-state-heuristic (file)
   "SVN-specific state heuristic."
@@ -149,7 +147,7 @@
     ;; enough.  Otherwise it might fail with remote repositories.
     (with-temp-buffer
       (vc-svn-command t 0 nil "status" (if localp "-v" "-u"))
-      (vc-svn-parse-status localp))))
+      (vc-svn-parse-status))))
 
 (defun vc-svn-workfile-version (file)
   "SVN-specific version of `vc-workfile-version'."
@@ -488,10 +486,10 @@
       ;; behavior for different modules on the same server.
       (match-string 1))))
 
-(defun vc-svn-parse-status (localp)
+(defun vc-svn-parse-status (&optional filename)
   "Parse output of \"svn status\" command in the current buffer.
-Set file properties accordingly.  Unless FULL is t, parse only
-essential information."
+Set file properties accordingly.  Unless FILENAME is non-nil, parse only
+information about FILENAME and return its status."
   (let (file status)
     (goto-char (point-min))
     (while (re-search-forward
@@ -500,7 +498,9 @@
 		  (buffer-substring (point) (line-end-position))))
       (setq status (char-after (line-beginning-position)))
       (unless (eq status ??)
-	(vc-file-setprop file 'vc-backend 'SVN)
+	;; `vc-BACKEND-registered' must not set vc-backend,
+	;; which is instead set in vc-registered.
+	(unless filename (vc-file-setprop file 'vc-backend 'SVN))
 	;; Use the last-modified revision, so that searching in vc-print-log
 	;; output works.
 	(vc-file-setprop file 'vc-workfile-version (match-string 3))
@@ -522,7 +522,8 @@
 	   (if (eq (char-after (match-beginning 1)) ?*)
 	       'needs-merge
 	     'edited))
-	  (t 'edited)))))))
+	  (t 'edited)))))
+    (if filename (vc-file-getprop filename 'vc-state))))
 
 (defun vc-svn-dir-state-heuristic (dir)
   "Find the SVN state of all files in DIR, using only local information."

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

* Re: Is this a bug in vc-svn?
  2006-10-20  7:55     ` Stefan Monnier
@ 2006-10-20 18:35       ` Leo
  2006-10-20 19:32       ` Leo
  1 sibling, 0 replies; 10+ messages in thread
From: Leo @ 2006-10-20 18:35 UTC (permalink / raw)


On Fri, 20/10/06, Stefan Monnier wrote:

[...]

>
> The patch below should fix it.
>
>
>         Stefan
>
>
> Index: lisp/vc-svn.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/vc-svn.el,v
> retrieving revision 1.27
> diff -u -r1.27 vc-svn.el
> --- lisp/vc-svn.el	9 Feb 2006 03:47:00 -0000	1.27
> +++ lisp/vc-svn.el	20 Oct 2006 07:51:17 -0000
> @@ -125,8 +125,7 @@
>                 ;; an `error' by vc-do-command.
>                 (error nil))))
>          (when (eq 0 status)
> -          (vc-svn-parse-status t)
> -          (eq 'SVN (vc-file-getprop file 'vc-backend)))))))
> +          (vc-svn-parse-status file))))))
>  
>  (defun vc-svn-state (file &optional localp)
>    "SVN-specific version of `vc-state'."
> @@ -134,8 +133,7 @@
>    (with-temp-buffer
>      (cd (file-name-directory file))
>      (vc-svn-command t 0 file "status" (if localp "-v" "-u"))
> -    (vc-svn-parse-status localp)
> -    (vc-file-getprop file 'vc-state)))
> +    (vc-svn-parse-status file)))
>  
>  (defun vc-svn-state-heuristic (file)
>    "SVN-specific state heuristic."
> @@ -149,7 +147,7 @@
>      ;; enough.  Otherwise it might fail with remote repositories.
>      (with-temp-buffer
>        (vc-svn-command t 0 nil "status" (if localp "-v" "-u"))
> -      (vc-svn-parse-status localp))))
> +      (vc-svn-parse-status))))
>  
>  (defun vc-svn-workfile-version (file)
>    "SVN-specific version of `vc-workfile-version'."
> @@ -488,10 +486,10 @@
>        ;; behavior for different modules on the same server.
>        (match-string 1))))
>  
> -(defun vc-svn-parse-status (localp)
> +(defun vc-svn-parse-status (&optional filename)
>    "Parse output of \"svn status\" command in the current buffer.
> -Set file properties accordingly.  Unless FULL is t, parse only
> -essential information."
> +Set file properties accordingly.  Unless FILENAME is non-nil, parse only
> +information about FILENAME and return its status."
>    (let (file status)
>      (goto-char (point-min))
>      (while (re-search-forward
> @@ -500,7 +498,9 @@
>  		  (buffer-substring (point) (line-end-position))))
>        (setq status (char-after (line-beginning-position)))
>        (unless (eq status ??)
> -	(vc-file-setprop file 'vc-backend 'SVN)
> +	;; `vc-BACKEND-registered' must not set vc-backend,
> +	;; which is instead set in vc-registered.
> +	(unless filename (vc-file-setprop file 'vc-backend 'SVN))
>  	;; Use the last-modified revision, so that searching in vc-print-log
>  	;; output works.
>  	(vc-file-setprop file 'vc-workfile-version (match-string 3))
> @@ -522,7 +522,8 @@
>  	   (if (eq (char-after (match-beginning 1)) ?*)
>  	       'needs-merge
>  	     'edited))
> -	  (t 'edited)))))))
> +	  (t 'edited)))))
> +    (if filename (vc-file-getprop filename 'vc-state))))
>  
>  (defun vc-svn-dir-state-heuristic (dir)
>    "Find the SVN state of all files in DIR, using only local information."

Yes, it's fixed.

-- 
Leo

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

* Re: Is this a bug in vc-svn?
  2006-10-20  7:55     ` Stefan Monnier
  2006-10-20 18:35       ` Leo
@ 2006-10-20 19:32       ` Leo
  1 sibling, 0 replies; 10+ messages in thread
From: Leo @ 2006-10-20 19:32 UTC (permalink / raw)


On Fri, 20/10/06, Stefan Monnier wrote:


[...]

>
> The patch below should fix it.
>
>
>         Stefan
>

[patch]

I have applied your patches to vc.el and vc-svn.el in my working emacs
and byte-compiled them. I'm wondering if the change will take
effect.

-- 
Leo

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

end of thread, other threads:[~2006-10-20 19:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-14 21:43 Is this a bug in vc-svn? Leo
2006-10-15 10:12 ` Richard Stallman
2006-10-15 14:23   ` Leo
2006-10-15 13:55 ` Stefan Monnier
2006-10-15 14:53   ` Leo
2006-10-18 12:55     ` Leo
2006-10-18 15:13       ` Stefan Monnier
2006-10-20  7:55     ` Stefan Monnier
2006-10-20 18:35       ` Leo
2006-10-20 19:32       ` Leo

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.