bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#161: marked as done (can't create new file if have RCS version)


From: Emacs bug Tracking System
Subject: bug#161: marked as done (can't create new file if have RCS version)
Date: Mon, 30 Jun 2008 17:35:03 -0700

Your message dated Mon, 30 Jun 2008 20:27:15 -0400
with message-id <address@hidden>
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 address@hidden
immediately.)


-- 
161: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=161
Emacs Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: can't create new file if have RCS version Date: Fri, 25 Apr 2008 09:31:28 -0400
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'




--- End Message ---
--- Begin Message --- Subject: #161 Date: Mon, 30 Jun 2008 20:27:15 -0400
2008-06-11  Stefan Monnier  <address@hidden>

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


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]