Issue488

classification
Title VC submenu under Tools
Type defect Module vc
Severity inconvenience Platform N/A
Keywords has patch Nosy List
explanation
process
These controls should only be changed by committers and tracker administrators.
Status verified   Reason
Superseder   Submitted 2009-02-27.20:01:48
Priority normal   Assigned To

Created on 2009-02-28.09:20:04 by rsparapa1, last changed 2009-05-04.19:37:15 by rsparapa.

Messages
msg1199 [hidden] ([hidden]) Date: 2009-05-04.19:37:15
Index: vc-hooks.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/vc/vc-hooks.el,v
retrieving revision 1.15
diff -u -r1.15 vc-hooks.el
--- vc-hooks.el	28 Oct 2007 17:46:57 -0000	1.15
+++ vc-hooks.el	28 Feb 2009 11:19:16 -0000
@@ -935,7 +935,7 @@
 (defconst vc-menu
   '("Version Control"
     :filter vc-menu-filter
-    [""                           vc-next-action         
buffer-file-name nil]
+    ["Next Action on"             vc-next-action         
buffer-file-name nil]
     ["Update to Latest Version"   vc-update               vc-mode]
     ["Revert to Base Version"     vc-revert-buffer        vc-mode]
     ["Undo Last Check-In"         vc-cancel-version       vc-mode]
@@ -956,48 +956,15 @@
 
 (defun vc-menu-filter (menu-items)
   (let* ((result menu-items)		; modify in-place
-	 (case-fold-search t)
-	 (type (vc-backend buffer-file-name))
 	 ;; VC works with full path!
-	 (file (if buffer-file-name
-		   buffer-file-name
-		 (expand-file-name (buffer-name))))
-	 op owner item status)
-    (setq op (cond ((null type)
-		    "Register File")
-		   ((eq type 'CVS)
-		    (setq status
-			  (vc-file-getprop buffer-file-name 'cvs-status))
-		    (if status
-			(cdr (assoc status
-				    '(("Locally Modified" . "Commit")
-				      ("Needs Merge" . "Merge with repository")
-				      ("Up-to-date" . "Do nothing to")
-				      ("Needs Checkout" . "Update"))))
-		      ;; #### - we're not gonna call cvs status just to
-		      ;; post a lousy menu...that's insane!
-		      "Next action on" 
-		      ))
-		   ;; these are all for RCS and SCCS
-		   ((not (setq owner (vc-locking-user file)))
-		    ;; VC locking user is faster now. vc-file-owner
-		    ;; is superceded by incompatible FSF version (JV).
-		    "Check out File")
-		   ((not (string-equal owner (user-login-name)))
-		    "Steal File Lock")
-		   (t "Check in File")))
+	 (file (or buffer-file-name (expand-file-name (buffer-name))))
+	 item)
     ;; We do not want the full name in the menu
     (setq file (file-name-nondirectory file))
     (while (setq item (pop menu-items))
       (and (vectorp item)
-	   (cond ((eq 'vc-next-action (aref item 1))
-		  (aset item 0 op)
-		  (aset item 3 file))
-		 ((eq 'vc-file-status (aref item 1))
-		  (aset item 2 (eq 'CVS type))
-		  (aset item 3 file))
-		 ((> (length item) 3)
-		  (aset item 3 file)))))
+	   (> (length item) 3)
+	   (aset item 3 file)))
     result))
 
 (and (featurep 'menubar)
msg1059 [hidden] ([hidden]) Date: 2009-02-28.16:03:24
See also issue 487 and issue 489, which this issue supersedes, 
for a bit of background.
msg1056 [hidden] ([hidden]) Date: 2009-02-28.09:20:04
  Message-ID: <49A862A1.1090106@mcw.edu>
Rodney Sparapani wrote:

> And sure enough, this function does not appear to be defined anywhere,
> although it is called from vc-menu-filter in vc-hooks.el
> 
> AHA!  SVN does not use locking.  So change line 968 of vc-hooks.el to
> 
>            ((or (eq type 'CVS) (eq type 'SVN))
> 
> and then it works for me!
> 

That works, but I guess it is not the most elegant solution.  Maybe,
instead of changing 968, you should place the following line before it:

((eq type 'SVN) "Next action on")

That's cleaner, more readable and apparently what is happening if
you had made the other change anyway.

One bug exterminated and another bug rises...  So, now the menu works 
(and VC is much faster than PSVN by the way).  But, when I do a Show 
History, then I get the *vc-change-log* buffer filled with the history
which is good, but then there is an error:

Debugger entered--Lisp error: (error "Marker does not point anywhere")
   goto-char(#<marker in no buffer 0x8e9534c>)
   (save-current-buffer (set-buffer (quote #<buffer "*vc-change-log*">)) 
(goto-char (process-mark p)) (vc-exec-after (quote ...)) (vc-exec-after 
(quote ...)) (vc-exec-after (quote ...)))
   (with-current-buffer (quote #<buffer "*vc-change-log*">) (goto-char 
(process-mark p)) (vc-exec-after (quote ...)) (vc-exec-after (quote 
...)) (vc-exec-after (quote ...)))
   (lambda (p s) (with-current-buffer (quote #<buffer 
"*vc-change-log*">) (goto-char ...) (vc-exec-after ...) (vc-exec-after 
...) (vc-exec-after ...)))(#<process "svn" pid 768 state:exit> "finished\n")

I think this says that (process-mark p) does not return a valid marker.
The definition of vc-exec-after is on line 943 of vc.el
and (process-mark p) is on line 962 inside that function.
Oh... and by the way, commenting out that line fixes the bug!!!
msg1054 [hidden] ([hidden]) Date: 2009-02-28.09:20:04
  Message-ID: <49A846AC.9060209@mcw.edu>
I can produce this with -vanilla, (require 'vc-hooks) and
(setq debug-on-error t).  If I leave the last part off,
then I get to see that the submenu is replaced by the entry
"No Menu" and I get the *Warnings*:

(1) (error/warning) Error in menubar filter: (void-function vc-locking-user)

And sure enough, this function does not appear to be defined anywhere,
although it is called from vc-menu-filter in vc-hooks.el

AHA!  SVN does not use locking.  So change line 968 of vc-hooks.el to

           ((or (eq type 'CVS) (eq type 'SVN))

and then it works for me!
History
Date User Action Args
2009-05-04 19:37:15rsparapasetmessages: + msg1199
keyword: + has patch
2009-02-28 16:03:25stephensetstatus: verified
priority: normal
type: defect
severity: inconvenience
platform: + N/A
nosy: - rsparapa1
messages: + msg1059
module: + vc
2009-02-28 15:58:37stephenlinkissue489 superseder
2009-02-28 15:57:38stephenlinkissue487 superseder
2009-02-28 09:20:04rsparapa1setmessages: + msg1056
2009-02-28 09:20:04rsparapa1create