unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: don@donarmstrong.com (Emacs bug Tracking System)
To: Glenn Morris <rgm@gnu.org>
Subject: bug#161: marked as done (can't create new file if have RCS version)
Date: Mon, 30 Jun 2008 17:35:03 -0700	[thread overview]
Message-ID: <handler.161.D161.121487205424861.ackdone@emacsbugs.donarmstrong.com> (raw)
In-Reply-To: 200804251331.m3PDVSH6017368@sharmanpc.mitel.com

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]


Your message dated Mon, 30 Jun 2008 20:27:15 -0400
with message-id <18537.31203.466189.199680@fencepost.gnu.org>
and subject line #161
has caused the Emacs bug report #161,
regarding can't create new file if have RCS version
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
161: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=161
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 12258 bytes --]

From: Richard Sharman <richard_sharman@mitel.com>
To: bug-gnu-emacs@gnu.org
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>


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(#<buffer junk> "~/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 <return> l SPC <backspace> s SPC - 
l SPC j u n k * <return> C-x o C-p C-x o C-x o C-2 
C-e M-w M-e <return> <return> 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 <return> 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 <backspace> n k <return> n o <return> q C-x C-f 
j u n k <return> a s d a s d <return> C-x C-s C-x o 
q C-x i C-x p C-x o q <switch-frame> <help-echo> <switch-frame> 
<switch-frame> <help-echo> <switch-frame> <switch-frame> 
<switch-frame> <help-echo> <help-echo> <down-mouse-1> 
<mouse-movement> <mouse-1> C-x <help-echo> C-a <help-echo> 
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> C-x 
C-e <help-echo> <help-echo> <help-echo> <help-echo> 
<switch-frame> <down-mouse-1> <mouse-movement> <mouse-1> 
C-h f v c c <backspace> <backspace> c <backspace> s 
c <backspace> c <backspace> <backspace> c - s t a t 
e <return> <help-echo> <down-mouse-1> <mouse-1> <down-mouse-5> 
<mouse-5> <down-mouse-4> <mouse-4> <help-echo> <down-mouse-2> 
<help-echo> <mouse-2> <help-echo> <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> C-x o C-a C-2 C-e M-w C-n 
<return> C-x o q M-x s h e <tab> <return> m k d i r 
C-a C-k d a t e SPC > SPC j u n k 2 <return> C-x o 
C-x b 8 s c <tab> <backspace> <backspace> <backspace> 
<return> C-a C-2 C-e M-w <return> <return> C-y M-b 
M-f 2 C-e C-j C-p C-p C-p C-p C-e C-j q <switch-frame> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<down-mouse-4> <mouse-4> <down-mouse-4> <mouse-4> <double-down-mouse-4> 
<double-mouse-4> <help-echo> <switch-frame> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu> 
<report-emacs-bug>

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'




[-- Attachment #3: Type: message/rfc822, Size: 1300 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: 161-done@emacsbugs.donarmstrong.com
Subject: #161
Date: Mon, 30 Jun 2008 20:27:15 -0400
Message-ID: <18537.31203.466189.199680@fencepost.gnu.org>


2008-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>

    * vc-rcs.el (vc-rcs-state-heuristic): Don't assume the file exists.


      reply	other threads:[~2008-07-01  0:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <18537.31203.466189.199680@fencepost.gnu.org>
2008-04-25 13:31 ` can't create new file if have RCS version Richard Sharman
2008-07-01  0:35   ` Emacs bug Tracking System [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=handler.161.D161.121487205424861.ackdone@emacsbugs.donarmstrong.com \
    --to=don@donarmstrong.com \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

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