You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kent Karlsson <ke...@popwire.com> on 2002/11/14 17:27:20 UTC

Switch bug

Ive found a rather anoying switch-bug that I couldnt find in the 
issuetracker. It seems it deletes parts of the name of a file when 
switching to a branch where the file never existed and afterwards it 
seems to think that it really is a part of that branch.

Im running r3782. Attached is a script that gives this exact error 
every time for me.

Is this a known bug?

-- kent

[kent:/tmp/svntest] kent% ../test_bug.sh
+ REPOS=file:///tmp/svntest/bug_repos
+ TRUNK=file:///tmp/svntest/bug_repos/trunk
+ BRANCH=file:///tmp/svntest/bug_repos/branch/kent
+ FILE=kalle.h
+ rm -rf bug bug_repos
+ svnadmin create bug_repos
+ svn mkdir file:///tmp/svntest/bug_repos/trunk 
file:///tmp/svntest/bug_repos/branch -m 'Creating structure'

Committed revision 1.

Committed revision 2.
+ svn co file:///tmp/svntest/bug_repos/trunk bug
Checked out revision 2.
+ cd bug
+ svn cp file:///tmp/svntest/bug_repos/trunk 
file:///tmp/svntest/bug_repos/branch/kent -m 'Branching alles'

Committed revision 3.
+ touch kalle.h kalle.h.tmp
+ svn add kalle.h kalle.h.tmp
A         kalle.h
A         kalle.h.tmp
+ svn commit -m 'Adding a file'
Adding         kalle.h
Adding         kalle.h.tmp
Transmitting file data ..
Committed revision 4.
+ svnlook tree ../bug_repos
/
  trunk/
   kalle.h.tmp
   kalle.h
  branch/
   kent/
+ svn switch file:///tmp/svntest/bug_repos/branch/kent
D  .h.tmp
D  .h
Updated to revision 4.
+ svn info kalle.h.tmp
Path: kalle.h.tmp
Name: kalle.h.tmp
Url: file:///tmp/svntest/bug_repos/branch/kent/kalle.h.tmp
Revision: 4
Node Kind: file
Schedule: normal
Last Changed Author: kent
Last Changed Rev: 4
Last Changed Date: 2002-11-14 18:22:34 +0100 (Thu, 14 Nov 2002)
Text Last Updated: 2002-11-14 18:22:33 +0100 (Thu, 14 Nov 2002)
Checksum: 1B2M2Y8AsgTpgAmY7PhCfg==



Re: Switch bug

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> I'm not.

Okay.

> > I'll grab it tonight or tomorrow morning (working on some other stuff
> > right now).
> 
> I'll leave it to you.

Yessir!

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Switch bug

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

> If you're working on it, just assign the issue to yourself.  Otherwise

I'm not.

> I'll grab it tonight or tomorrow morning (working on some other stuff
> right now).

I'll leave it to you.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Switch bug

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> It's the same bug as the one Kent reported, but it just happens that I
> used "/branch/b1" and "/trunk/foo" which happen to be the same length
> (I saw the truncation and was curious :) and this happens

aaaaaaaaaahhhhhhhhhhh.

Heh.  Yup.  Looks like a fairly simple brain-o, though.

If you're working on it, just assign the issue to yourself.  Otherwise
I'll grab it tonight or tomorrow morning (working on some other stuff
right now).

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Switch bug

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

> Philip Martin <ph...@codematters.co.uk> writes:
> > > Did it delete `wc', or did it rename it to `b1'?
> > 
> > No, it's really gone.
> 
> Wow.  That's so... losing.
> 
> I've filed new issue #988.

Thanks, I'm having some local HTTP problems.

It's the same bug as the one Kent reported, but it just happens that I
used "/branch/b1" and "/trunk/foo" which happen to be the same length
(I saw the truncation and was curious :) and this happens

edit_path (c=0xbffff5c0, path=0x80b8580 "/trunk/foo")
    at ../svn/subversion/libsvn_repos/delta.c:159
159       const char *editor_path = path + strlen (c->edit_base_path);
(gdb) p path
$2 = 0x80b8580 "/trunk/foo"
(gdb) p c->edit_base_path
$3 = 0x80812f0 "/branch/b1"
(gdb) n
160       if (*editor_path == '/')
(gdb) p editor_path
$4 = 0x80b858a "" 

Something has obviously gone wrong, it makes no sense to mix those
paths.


-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Switch bug

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> > Did it delete `wc', or did it rename it to `b1'?
> 
> No, it's really gone.

Wow.  That's so... losing.

I've filed new issue #988.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Switch bug

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

> Philip Martin <ph...@codematters.co.uk> writes:
> > ../svn/subversion/libsvn_subr/io.c:682: (apr_err=2, src_err=0)
> > svn: No such file or directory
> > svn: svn_io_set_file_read_write: failed to set file 'wc/.svn/log' read-write
> > 
> > and
> > 
> > $ ls wc
> > ls: wc: No such file or directory
> > 
> > it's deleted my working copy.
> 
> Did it delete `wc', or did it rename it to `b1'?

No, it's really gone.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Switch bug

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> ../svn/subversion/libsvn_subr/io.c:682: (apr_err=2, src_err=0)
> svn: No such file or directory
> svn: svn_io_set_file_read_write: failed to set file 'wc/.svn/log' read-write
> 
> and
> 
> $ ls wc
> ls: wc: No such file or directory
> 
> it's deleted my working copy.

Did it delete `wc', or did it rename it to `b1'?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Switch bug

Posted by Philip Martin <ph...@codematters.co.uk>.
Kent Karlsson <ke...@popwire.com> writes:

> Ive found a rather anoying switch-bug that I couldnt find in the
> issuetracker. It seems it deletes parts of the name of a file when
> switching to a branch where the file never existed and afterwards it
> seems to think that it really is a part of that branch.

Yikes!  Something is seriously wrong.  This script

REPO=file://${PWD}/repo
svnadmin create repo
svn mkdir  $REPO/trunk $REPO/branch
svn cp     $REPO/trunk $REPO/branch/b1
svn mkdir  $REPO/trunk/foo
svn co     $REPO/trunk wc
ls wc
svn switch $REPO/branch/b1 wc

gives this error

../svn/subversion/libsvn_subr/io.c:682: (apr_err=2, src_err=0)
svn: No such file or directory
svn: svn_io_set_file_read_write: failed to set file 'wc/.svn/log' read-write

and

$ ls wc
ls: wc: No such file or directory

it's deleted my working copy.

Please raise an issue.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org