Re: tramp ($Id: tramp.el,v 2.0.2.2 2001/03/03 00:06:34 grossjoh Exp $); Trampled file during sccs create (sic) admin

2001-03-28 Thread Stefan Monnier

 "Daniel" == Daniel Pittman [EMAIL PROTECTED] writes:
 Basically, the admin command was passed
 -i/r@METHOD:HOST:/PATH/TO/FILE/ where -iFILE would suffice. 
 Compounding the problem, the error wasn't noticed and the file and
 buffer destroyed.

I only have the development version of VC right now, so the patch below
won't apply properly, but you should be able to adapt it to your vc.el.

It's completely untested, so please tell us if it helps,


Stefan


@@ -177,7 +177,7 @@
(apply 'vc-do-command nil 0 "admin" nil
   (and rev (concat "-r" rev))
   "-fb"
-  (concat "-i" file)
+  (concat "-i" (file-relative-name file))
   (and comment (concat "-y" comment))
   vc-name
   switches))




Re: tramp ($Id: tramp.el,v 2.0.2.2 2001/03/03 00:06:34 grossjoh Exp $); Trampled file during sccs create (sic) admin

2001-03-28 Thread Kai Großjohann

On Tue, 27 Mar 2001, Kim Taylor wrote:

 Basically, the admin command was passed
 -i/r@METHOD:HOST:/PATH/TO/FILE/ where -iFILE would suffice.
 Compounding the problem, the error wasn't noticed and the file and
 buffer destroyed.

Could you M-x debug-on-entry RET vc-do-command RET and show me the
backtrace?

kai
-- 
Be indiscrete.  Do it continuously.




Re: tramp ($Id: tramp.el,v 2.0.2.2 2001/03/03 00:06:34 grossjoh Exp $); Trampled file during sccs create (sic) admin

2001-03-28 Thread Stefan Monnier

   [EMAIL PROTECTED] writes:
 @@ -177,7 +177,7 @@
  (apply 'vc-do-command nil 0 "admin" nil
 (and rev (concat "-r" rev))
 "-fb"
 -   (concat "-i" file)
 +   (concat "-i" (file-relative-name file))
 (and comment (concat "-y" comment))
 -   vc-name
 +(file-relative-name vc-name)
 switches))

Indeed.  Good spotting.  I'll try to get it into Emacs-21.1.

 I'm not too sure this won't break VC in a non-Tramp invocation or for folk
 using a non-default SCCS project dir (i.e not ./SCCS.)

It should be safe as long as there's no funny symlink situation.
We already do such a (file-relative-name file) inside vc-do-command,
so any such funny situation should already fail anyway.

 I wonder if the earlier construction of vc-name and/or project-dir is the
 "right" place to do this? (All in vc.el we're talking here.)

No, I think it's right to do it here, since `vc-name' is stored globally
and can be used from different directories.

 I still think the bigger concern is the unconditional(?) (delete-file file)
 in vc.el which appears to fire regardless of $? or else, as I noted once
 before, $? is falsely cleared by echo $tramp_exit_status.

Actually the second argument to vc-do-command (i.e. 0 in this case)
says that if the return value is greater than 0, vc-do-command
will signal an error, so the `delete-file' will not be executed.


Stefan




tramp ($Id: tramp.el,v 2.0.2.2 2001/03/03 00:06:34 grossjoh Exp $); Trampled file during sccs create (sic) admin

2001-03-27 Thread Kim Taylor


Enter your bug report in this message, including as much detail as you
possibly can about the problem, what you did to cause it and what the
local and remote machines are.

If you can give a simple set of instructions to make this bug happen
reliably, please include those.  Thank you for helping kill bugs in
TRAMP.
--bug report follows this line--

Initial (failed) checkin to SCCS of a remote file resulted in remote file being 
deleted and localthe associated tramp buffer too!

An empty SCCS subdirectory existed where the file resided.  I attempted to place the 
file under SCCS with C-x v v (vc-next-action).  

Basically, the admin command was passed -i/r@METHOD:HOST:/PATH/TO/FILE/ where -iFILE 
would suffice.  Compounding the problem, the error wasn't noticed and the file and 
buffer destroyed.

Here's a lightly edited excerpt from the *debug* tramp/scpx HOST* buffer (my line 
numbering):

[...]
[1]$ ls -d /export/home/www/webhosting.pncbank.com/docs/index.html ; echo 
tramp_exit_status $?
/export/home/www/webhosting.pncbank.com/docs/index.html
tramp_exit_status 0
[2]$ tramp_file_attributes /export/home/www/webhosting.pncbank.com/docs/index.html
(nil 1 6730 100 (15039 52120) (15039 52157) (15039 52157) 7821 33277 t (0 . 6987) (440 
9))
[3]$ ls -d /www/webhosting.pncbank.com/docs/SCCS ; echo tramp_exit_status $?
/www/webhosting.pncbank.com/docs/SCCS
tramp_exit_status 0
[4]$ cd /www/webhosting.pncbank.com/docs/ ; echo tramp_exit_status $?
tramp_exit_status 0
[5]$ admin -r1.1 -fb -i/r\@scpx\:weblog1\:/www/webhosting.pncbank.com/docs/index.html 
-y /r\@scpx\:weblog1\:/www/webhosting.pncbank.com/docs/SCCS/s.index.html; 
tramp_old_status=$?
ERROR [/r@scpx:weblog1:/www/webhosting.pncbank.com/docs/SCCS/s.index.html]: cannot 
create lock file (cm4)
[6]$ tramp_set_exit_status $tramp_old_status; echo tramp_exit_status $?
tramp_exit_status 1
[7]$ echo $?
0
[8]$ rm -f /www/webhosting.pncbank.com/docs/index.html ; echo ok
ok
[9]$ ls -d /www/webhosting.pncbank.com/docs/RCS/index.html\,v ; echo tramp_exit_status 
$?
/www/webhosting.pncbank.com/docs/RCS/index.html,v: No such file or directory
tramp_exit_status 2
[10]$ ls -d /www/webhosting.pncbank.com/docs/index.html\,v ; echo tramp_exit_status $?
/www/webhosting.pncbank.com/docs/index.html,v: No such file or directory
tramp_exit_status 2
[11]$ ls -d /www/webhosting.pncbank.com/docs/RCS/index.html ; echo tramp_exit_status $?
/www/webhosting.pncbank.com/docs/RCS/index.html: No such file or directory
tramp_exit_status 2
[12]$ ls -d /www/webhosting.pncbank.com/docs/SCCS/s.index.html ; echo 
tramp_exit_status $?
/www/webhosting.pncbank.com/docs/SCCS/s.index.html: No such file or directory
tramp_exit_status 2
[13]$ ls -d /www/webhosting.pncbank.com/docs/s.index.html ; echo tramp_exit_status $?
/www/webhosting.pncbank.com/docs/s.index.html: No such file or directory
tramp_exit_status 2
[14]$ ( cd /www/webhosting.pncbank.com/docs/CVS ; echo tramp_exit_status $? )
/bin/ksh: /www/webhosting.pncbank.com/docs/CVS:  not found
tramp_exit_status 1
[15]$ cd /www/webhosting.pncbank.com/docs/ ; echo tramp_exit_status $?
tramp_exit_status 0
[16]$ get; tramp_old_status=$?
ERROR: missing file arg (cm3)
[17]$ tramp_set_exit_status $tramp_old_status; echo tramp_exit_status $?
tramp_exit_status 1
[18]$ echo $?
0
[19]$ ls -d /www/webhosting.pncbank.com/docs/index.html ; echo tramp_exit_status $?
/www/webhosting.pncbank.com/docs/index.html: No such file or directory
tramp_exit_status 2
# Inserting directory `ls -al /r@scpx:weblog1:/www/webhosting.pncbank.com/docs/', 
wildcard no, fulldir yes
[20]$ /bin/ls -al /www/webhosting.pncbank.com/docs/
[...]

A few observations:

1) The admin command at line [5] was improperly constructed with the
-i option being passed a filename still in remote syntax.

2) The error code was noted on line [6]

This is where it begans to unravel.  I'd be happy for VC or tramp
(who's in charge at this point in the sequence?) to simply fail.

3) Line [7] is where evil doings begin: Who (tramp or VC?) put that
   2nd echo $? in there?  Did tramp confuse VC by turning $? from 1 to
   0?  Maybe tramp_set_exit_status need return $? in addition to
   encoding it???

Since the error at [5] was masked by combination of [6-7], line[8]
happily and 'safely' removes the original file.  Right around this
time, the emacs buffer is 'safely' discarded as well in preparation
for reading the file back from SCCS where it is presumed now to be
stored.

4) Skip ahead to the sequence at lines [16-18] and you see the same
   pattern: A failed VC command (note the missing filename!), followed
   by tramp_set_exit_status duly noting the failure but causing $? to
   be cleared.

I'll be a little wary of remote VC until we get a resolution.  I
couldn't be happier with the basic function provided by tramp itself.
Many thanks to the development community!!!

Kim

mailto:[EMAIL PROTECTED]

Emacs  : GNU Emacs 20.3.1 (sparc-sun-solaris2.6, X toolkit)
 of Thu Aug 27 1998 on tensor.vnet.net
Package: 

Re: tramp ($Id: tramp.el,v 2.0.2.2 2001/03/03 00:06:34 grossjoh Exp $); Trampled file during sccs create (sic) admin

2001-03-27 Thread Daniel Pittman

On Tue, 27 Mar 2001, Kim Taylor wrote:

[...]

 Initial (failed) checkin to SCCS of a remote file resulted in remote
 file being deleted and localthe associated tramp buffer too!

Ack! I don't have SCCS, nor do I have access to SCCS anywhere. This
means that it is untested.

I know that RCS works with the VC hacks, but that's it, I fear.

[...]

 Basically, the admin command was passed
 -i/r@METHOD:HOST:/PATH/TO/FILE/ where -iFILE would suffice. 
 Compounding the problem, the error wasn't noticed and the file and
 buffer destroyed.

Right. I am not sure /why/ this happened. You might check what the
command passed to `tramp-vc-do-command', `tramp-vc-do-command-new' and
`tramp-vc-simple-command'.

Those actually run the remote command and one of them is clearly getting
the wrong information from VC.

[...]

 A few observations:
 
 1) The admin command at line [5] was improperly constructed with the
 -i option being passed a filename still in remote syntax.

Yup.

 2) The error code was noted on line [6]
 
 This is where it begans to unravel.  I'd be happy for VC or tramp
 (who's in charge at this point in the sequence?) to simply fail.

I think that the error should have been propagated correctly to VC, but
it's hard to be sure. You might check the above functions to make sure
they return errors correctly when the remote execution fails...

[...]

 I'll be a little wary of remote VC until we get a resolution.  I
 couldn't be happier with the basic function provided by tramp itself.
 Many thanks to the development community!!!

I am sorry that the remote VC support broke things for you. If you can
reproduce the problem with RCS, or diagnose exactly what is giving the
wrong information to the `tramp-vc-do*' routines, I am happy to help
with fixing this.

Daniel

-- 
Real programmers can write assembly code in any language.   :-)  
-- Larry Wall in [EMAIL PROTECTED]