Article View: gnu.emacs.bug
Article #87326Re: version control
From: Lawrence R. Dodd
Date: Sat, 01 Oct 1994 14:53
Date: Sat, 01 Oct 1994 14:53
63 lines
3281 bytes
3281 bytes
::: "LB" == Len Berman <berman@watson.ibm.com> writes:
LB> Using 19.25.1 on RS/6000 running AIX, I have the following problem.
LB> If I start emacs, edit a file, enter it into version control using vi,
LB> delete the ,v file, and then try to enter it into version control,
LB> emacs won't let me. It thinks the file is still in version control even
LB> though the backup has been removed. (BTW-emacs doesn't ask for confirmation
LB> before removing the read-only backup which I think it should.)
LB> If I move the version control file, I get the same problem, i.e. I can't
LB> enter the file in verison control again.
LB> I am attaching a dribble file of commands that illustrate the problem
LB> although I'm not sure it will help in this case.
LB> tmp/int2<backspace>1.c<return>vi!rm int1.c,v<return>in<tab> ,<tab>vi
I've experienced this as well. The problem is that the function vc-name
returns the name of the master file for FILE despite it not existing. This
occurs because
(vc-file-getprop file 'vc-name)
returns non-nil in that function. That is, the buffer property `vc-name' is
still associated with file FILE
The solution is to check for the existence of the master file as
well. However, it might be a good idea to clear that property out
for FILE. I do both below.
Sat Oct 1 10:40:31 1994 Lawrence R. Dodd <dodd@roebling.poly.edu>
* vc-hooks.el (vc-name): If FILE's master file exists return it.
Otherwise, clear FILE's vc-name buffer property.
cd /usr/local/lib/emacs/19.27/lisp/
diff -c vc-hooks.el.orig vc-hooks.el
*** vc-hooks.el.orig Thu May 19 17:58:26 1994
--- vc-hooks.el Sat Oct 1 10:39:20 1994
***************
*** 101,107 ****
(defun vc-name (file)
"Return the master name of a file, nil if it is not registered."
! (or (vc-file-getprop file 'vc-name)
(let ((name-and-type (vc-registered file)))
(if name-and-type
(progn
--- 101,113 ----
(defun vc-name (file)
"Return the master name of a file, nil if it is not registered."
! (or (let (master (vc-file-getprop file 'vc-name))
! (if master
! ;; If there is a master file and it exists, return it.
! (if (file-exists-p master)
! master
! ;; If it does not exist, clear vc-name buffer property.
! (vc-file-setprop buffer-file-name 'vc-name nil))))
(let ((name-and-type (vc-registered file)))
(if name-and-type
(progn
Technical Details
Message-ID:
<9410011451.AA08102@roebling.poly.edu>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!roebling.poly.EDU!doddReferences:
<9409271445.AA17546@france.watson.ibm.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,912b148eadd41177 X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-10-01 20:56:22 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!roebling.poly.EDU!dodd From: dodd@roebling.poly.EDU (Lawrence R. Dodd) Newsgroups: gnu.emacs.bug Subject: Re: version control Date: 1 Oct 1994 10:53:32 -0400 Organization: GNUs Not Usenet Lines: 65 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <9410011451.AA08102@roebling.poly.edu> References: <9409271445.AA17546@france.watson.ibm.com> Reply-To: dodd@roebling.poly.edu