From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Sharman Newsgroups: gmane.emacs.bugs Subject: can't create new file if have RCS version Date: Fri, 25 Apr 2008 09:31:28 -0400 Message-ID: <200804251331.m3PDVSH6017368@sharmanpc.mitel.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1209132439 23133 80.91.229.12 (25 Apr 2008 14:07:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Apr 2008 14:07:19 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 25 16:07:54 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JpOaX-0008Bx-MS for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Apr 2008 16:07:46 +0200 Original-Received: from localhost ([127.0.0.1]:49061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpOZr-0006Ma-Kv for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Apr 2008 10:07:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JpO1e-0001PP-C1 for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:31:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JpO1d-0001OL-7j for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:31:41 -0400 Original-Received: from [199.232.76.173] (port=54678 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpO1c-0001OF-Sw for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:31:40 -0400 Original-Received: from smtp.mitel.com ([216.191.234.102]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JpO1c-0004ZP-Fx for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:31:40 -0400 Original-Received: from localhost (smtp.mitel.com [127.0.0.1]) by smtp.mitel.com (Postfix) with ESMTP id 54F9A2C03E for ; Fri, 25 Apr 2008 09:31:29 -0400 (EDT) X-Virus-Scanned: by amavisd-new (virusonly) at mitel.com Original-Received: from smtp.mitel.com ([127.0.0.1]) by localhost (smtp.mitel.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iJH3DlXEnThX for ; Fri, 25 Apr 2008 09:31:29 -0400 (EDT) Original-Received: from sharmanpc.mitel.com (sharmanpc.mitel.com [10.35.21.61]) by smtp.mitel.com (Postfix) with ESMTP id 2BBE02C014 for ; Fri, 25 Apr 2008 09:31:29 -0400 (EDT) Original-Received: from sharmanpc.mitel.com (localhost.localdomain [127.0.0.1]) by sharmanpc.mitel.com (8.13.1/8.13.1) with ESMTP id m3PDVTjq017371 for ; Fri, 25 Apr 2008 09:31:29 -0400 Original-Received: (from sharman@localhost) by sharmanpc.mitel.com (8.13.1/8.13.1/Submit) id m3PDVSH6017368; Fri, 25 Apr 2008 09:31:28 -0400 X-Authentication-Warning: sharmanpc.mitel.com: sharman set sender to richard_sharman@mitel.com using -f X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Fri, 25 Apr 2008 10:06:40 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17880 Archived-At: 1. Create a file, check it in; do *not* also check it out with -l % date > junk % ci junk junk,v <-- junk enter description, terminated with single '.' or end of file: NOTE: This is NOT the log message! >> . initial revision: 1.1 done % ls -l junk* -r--r--r-- 1 sharman gx5000 209 Apr 25 09:10 junk,v % 2. Try and create a totally new version with emacs. E.g. find-file junk Reply "no" to the prompt "file was lost, check out version from source control". This produces an error: Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match(".r-..-..-." nil) vc-rcs-state-heuristic("/home/gx5000/sharman/tmp/junk") apply(vc-rcs-state-heuristic "/home/gx5000/sharman/tmp/junk") vc-call-backend(RCS state-heuristic "/home/gx5000/sharman/tmp/junk") vc-state("/home/gx5000/sharman/tmp/junk") vc-default-mode-line-string(RCS "/home/gx5000/sharman/tmp/junk") apply(vc-default-mode-line-string RCS "/home/gx5000/sharman/tmp/junk") vc-call-backend(RCS mode-line-string "/home/gx5000/sharman/tmp/junk") vc-mode-line("/home/gx5000/sharman/tmp/junk") vc-find-file-hook() run-hooks(find-file-hook) after-find-file(t t) find-file-noselect-1(# "~/tmp/junk" nil nil "~/tmp/junk" nil) find-file-noselect("~/tmp/junk" nil nil t) find-file("~/tmp/junk" t) call-interactively(find-file) 3. If a different file (e.g. junk2) is visited and then you try and save this as the first file (junk, in the above example) you also get an error: Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match(".r-..-..-." nil) vc-rcs-state-heuristic("/home/gx5000/sharman/tmp/junk") apply(vc-rcs-state-heuristic "/home/gx5000/sharman/tmp/junk") vc-call-backend(RCS state-heuristic "/home/gx5000/sharman/tmp/junk") vc-state("/home/gx5000/sharman/tmp/junk") vc-before-save() basic-save-buffer() save-buffer() write-file("~/tmp/junk" t) call-interactively(write-file) It seems that vc-state can't handle a case where a file doens't exist but it is under version-control. (vc-state "~/tmp/junk2") => nil (vc-state "~/tmp/junk") => error (wrong-type-argument stringp nil) string-match(".r-..-..-." nil) The function vc-state mentions new substates including removed; using that avoided the problem. % diff -c vc-hooks.el.orig vc-hooks.el *** vc-hooks.el.orig Fri Apr 25 09:27:08 2008 --- vc-hooks.el Fri Apr 25 09:28:55 2008 *************** *** 478,487 **** ;; - `conflict' (i.e. `edited' with conflict markers) ;; - `removed' ;; - `copied' and `moved' (might be handled by `removed' and `added') ! (or (vc-file-getprop file 'vc-state) ! (if (vc-backend file) ! (vc-file-setprop file 'vc-state ! (vc-call state-heuristic file))))) (defun vc-recompute-state (file) "Recompute the version control state of FILE, and return it. --- 478,490 ---- ;; - `conflict' (i.e. `edited' with conflict markers) ;; - `removed' ;; - `copied' and `moved' (might be handled by `removed' and `added') ! ;; ok, let's use removed if it doesn't exist... ! (if (file-exists-p file) ! (or (vc-file-getprop file 'vc-state) ! (if (vc-backend file) ! (vc-file-setprop file 'vc-state ! (vc-call state-heuristic file)))) ! 'removed)) (defun vc-recompute-state (file) "Recompute the version control state of FILE, and return it. % ======================================================================== In GNU Emacs 22.1.2 (i686-pc-linux-gnu, X toolkit) of 2008-03-14 on sharmanpc.mitel.com Windowing system distributor `The X.Org Foundation', version 11.0.60802000 configured using `configure '--with-x-toolkit=athena' '--without-toolkit-scroll-bars'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: C locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: url-handler-mode: t shell-dirtrack-mode: t highlight-changes-visible-mode: t display-time-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: SPC j u n k SPC l SPC s SPC - l SPC j u n k * C-x o C-p C-x o C-x o C-2 C-e M-w M-e C-y C-a M-f C-f C-f C-f C-f C-f C-f C-f C-2 C-e C-b C-b C-w C-x o l s SPC $ P W D / j u n k C-p C-a C-f C-f C-f C-f C-2 C-M-f M-w C-x o C-f C-y " C-e C-j q C-x o C-x C-f j u k n k n o q C-x C-f j u n k a s d a s d C-x C-s C-x o q C-x i C-x p C-x o q C-x C-a C-x C-e C-h f v c c c s c c c - s t a t e C-x o C-a C-2 C-e M-w C-n C-x o q M-x s h e m k d i r C-a C-k d a t e SPC > SPC j u n k 2 C-x o C-x b 8 s c C-a C-2 C-e M-w C-y M-b M-f 2 C-e C-j C-p C-p C-p C-p C-e C-j q Recent messages: Back to top level. Cannot find image file `/usr/local/share/emacs/22.1/etc/vm/message-colorful.xpm' [8 times] Mark set [2 times] Cannot find image file `/usr/local/share/emacs/22.1/etc/vm/message-colorful.xpm' Entering debugger... Cannot find image file `/usr/local/share/emacs/22.1/etc/vm/message-colorful.xpm' Back to top level. Cannot find image file `/usr/local/share/emacs/22.1/etc/vm/message-colorful.xpm' [8 times] Loading emacsbug...done Cannot find image file `/usr/local/share/emacs/22.1/etc/vm/message-colorful.xpm'