You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Patrick Heinemann <he...@informatik.uni-tuebingen.de> on 2004/12/06 15:28:02 UTC

Problems with update after moving several directories

Dear all,

I have recently changed the directory layout of our software, e.g.
$> cd trunk/
$> svn move IPC/ inter_process_com
D + IPC
A + inter_process_com
$> svn commit
commited revision 1005
and so on...

Now I tried to update a users working copy which he had changed meanwhile at 
some files. The result was:
$> cd trunk/
$> svn update
svn: Cannot replace a directory from within

What does that mean? The moved directories all are subdirectories of the 
trunk/ directory. This even happens with
$> cd ..
$> svn update trunk/
svn: Cannot replace a directory from within

Is there a problem with updating working directories when main directories 
where moved or is it just because the working directory was changed in the 
meantime?
This should not be the behaviour of a versioning system, right?

Please help,
Patrick Heinemann
-- 
Dipl.-Technoinform. Patrick Heinemann
Universitaet Tuebingen, WSI - RA, Sand 1, D-72076 Tuebingen, Germany
Phone: ( +49 / 0 ) 70 71 / 29 - 78 989   Fax: ( +49 / 0 ) 70 71 / 29 - 50 91
mailto:heinemann@informatik.uni-tuebingen.de
http://www-ra.informatik.uni-tuebingen.de

Attempto Tübingen - Robot Soccer Team
http://www-ra.informatik.uni-tuebingen.de/forschung/robocup/welcome_e.html


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


Re: Problems with update after moving several directories

Posted by John Szakmeister <jo...@szakmeister.net>.
On Thursday 09 December 2004 04:28, Patrick Heinemann wrote:
> Hi,
>
> I am still looking for a solution to this problem, or a suggestion what
> went wrong...
> Maybe my last posting was a little misunderstanding, but I would still
> like to know why this error occured when I was trying to update the
> users working copy. Although this user solved the problem brute force,
> I still have other users that are likely to face the same problem when
> updating to the new layout...
>
> Best,
> Patrick
>
> On Tuesday 07 December 2004 14:24, Patrick Heinemann wrote:
> > On Monday 06 December 2004 18:14, kfogel@collab.net wrote:
> > > Patrick Heinemann <he...@informatik.uni-tuebingen.de> writes:
> > > > I have recently changed the directory layout of our software,
> > > > e.g. $> cd trunk/
> > > > $> svn move IPC/ inter_process_com
> > > > D + IPC
> > > > A + inter_process_com
> > > > $> svn commit
> > > > commited revision 1005
> > > > and so on...
> > > >
> > > > Now I tried to update a users working copy which he had changed
> > > > meanwhile at some files. The result was:
> > > > $> cd trunk/
> > > > $> svn update
> > > > svn: Cannot replace a directory from within

I generally see this error occur when the top-level directory has been 
moved for a working copy.  i.e.:
  svnadmin create repo
  svn co file://`pwd`/repo wc
  svn mkdir wc/trunk
  svn ci -m '' wc
  svn co file://`pwd`/repo/trunk trunk
  svn mv wc/trunk wc/new-name
  svn update trunk

The last command fails because it believes it's root in the trunk/ 
directory, but that no longer exists.  In the perfect world, it should Do 
the Right Thing and effectively switch to the new directory.  
Unfortunately, no one has sat down to try to fix this bug.

In your case, perhaps we haven't seen the whole transcript.  The following 
works for me:
  :: svnadmin create repo
  :: svn co file://`pwd`/repo wc
  Checked out revision 0.
  :: svn mkdir wc/trunk wc/trunk/A
  A         wc/trunk
  A         wc/trunk/A
  :: svn ci -m '' wc
  Adding         wc/trunk
  Adding         wc/trunk/A

  Committed revision 1.
  :: svn co file://`pwd`/repo/trunk trunk
  A  trunk/A
  Checked out revision 1.
  :: svn mv wc/trunk/A wc/trunk/B
  A         wc/trunk/B
  D         wc/trunk/A
  :: svn ci -m '' wc
  Deleting       wc/trunk/A
  Adding         wc/trunk/B

  Committed revision 2.
  :: svn up trunk
  A  trunk/B
  D  trunk/A
  Updated to revision 2.
  :: svn --version
  svn, version 1.1.1 (r11581)
     compiled Nov 27 2004, 21:42:07


-John

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

Re: Problems with update after moving several directories

Posted by Patrick Heinemann <he...@informatik.uni-tuebingen.de>.
Hi,

I am still looking for a solution to this problem, or a suggestion what went 
wrong...
Maybe my last posting was a little misunderstanding, but I would still like to 
know why this error occured when I was trying to update the users working 
copy. Although this user solved the problem brute force, I still have other 
users that are likely to face the same problem when updating to the new 
layout...

Best,
Patrick

On Tuesday 07 December 2004 14:24, Patrick Heinemann wrote:
> On Monday 06 December 2004 18:14, kfogel@collab.net wrote:
> > Patrick Heinemann <he...@informatik.uni-tuebingen.de> writes:
> > > I have recently changed the directory layout of our software, e.g.
> > > $> cd trunk/
> > > $> svn move IPC/ inter_process_com
> > > D + IPC
> > > A + inter_process_com
> > > $> svn commit
> > > commited revision 1005
> > > and so on...
> > >
> > > Now I tried to update a users working copy which he had changed
> > > meanwhile at some files. The result was:
> > > $> cd trunk/
> > > $> svn update
> > > svn: Cannot replace a directory from within
> > >
> > > What does that mean? The moved directories all are subdirectories of
> > > the trunk/ directory. This even happens with
> > > $> cd ..
> > > $> svn update trunk/
> > > svn: Cannot replace a directory from within
> > >
> > > Is there a problem with updating working directories when main
> > > directories where moved or is it just because the working directory was
> > > changed in the meantime?
> >
> > Without knowing that user's local changes, it's impossible to say why
> > this is happening.  What were his local changes before the update?
>
> Unfortunately the user followed the brute force way meanwhile, i.e.
> checkout the new version and copying the changed files to the new working
> set as a change...
> Well, the changes included only small changes in four or five files. No
> directory moves or file copies whatsoever, if that's what you mean!?
>
> > > This should not be the behaviour of a versioning system, right?
> >
> > Subversion's bug tracker "should" be empty, too :-).
>
> Sorry about that, I didn't mean it that way! :-)
>
> > -Karl
>
> Patrick

-- 
Dipl.-Technoinform. Patrick Heinemann
Universitaet Tuebingen, WSI - RA, Sand 1, D-72076 Tuebingen, Germany
Phone: ( +49 / 0 ) 70 71 / 29 - 78 989   Fax: ( +49 / 0 ) 70 71 / 29 - 50 91
mailto:heinemann@informatik.uni-tuebingen.de
http://www-ra.informatik.uni-tuebingen.de

Attempto Tübingen - Robot Soccer Team
http://www-ra.informatik.uni-tuebingen.de/forschung/robocup/welcome_e.html


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


Re: Problems with update after moving several directories

Posted by Patrick Heinemann <he...@informatik.uni-tuebingen.de>.
On Monday 06 December 2004 18:14, kfogel@collab.net wrote:
> Patrick Heinemann <he...@informatik.uni-tuebingen.de> writes:
> > I have recently changed the directory layout of our software, e.g.
> > $> cd trunk/
> > $> svn move IPC/ inter_process_com
> > D + IPC
> > A + inter_process_com
> > $> svn commit
> > commited revision 1005
> > and so on...
> >
> > Now I tried to update a users working copy which he had changed meanwhile
> > at some files. The result was:
> > $> cd trunk/
> > $> svn update
> > svn: Cannot replace a directory from within
> >
> > What does that mean? The moved directories all are subdirectories of the
> > trunk/ directory. This even happens with
> > $> cd ..
> > $> svn update trunk/
> > svn: Cannot replace a directory from within
> >
> > Is there a problem with updating working directories when main
> > directories where moved or is it just because the working directory was
> > changed in the meantime?
>
> Without knowing that user's local changes, it's impossible to say why
> this is happening.  What were his local changes before the update?

Unfortunately the user followed the brute force way meanwhile, i.e. checkout 
the new version and copying the changed files to the new working set as a 
change...
Well, the changes included only small changes in four or five files. No 
directory moves or file copies whatsoever, if that's what you mean!?

> > This should not be the behaviour of a versioning system, right?
>
> Subversion's bug tracker "should" be empty, too :-).

Sorry about that, I didn't mean it that way! :-)

> -Karl

Patrick
-- 
Dipl.-Technoinform. Patrick Heinemann
Universitaet Tuebingen, WSI - RA, Sand 1, D-72076 Tuebingen, Germany
Phone: ( +49 / 0 ) 70 71 / 29 - 78 989   Fax: ( +49 / 0 ) 70 71 / 29 - 50 91
mailto:heinemann@informatik.uni-tuebingen.de
http://www-ra.informatik.uni-tuebingen.de

Attempto Tübingen - Robot Soccer Team
http://www-ra.informatik.uni-tuebingen.de/forschung/robocup/welcome_e.html


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


Re: Problems with update after moving several directories

Posted by kf...@collab.net.
Patrick Heinemann <he...@informatik.uni-tuebingen.de> writes:
> I have recently changed the directory layout of our software, e.g.
> $> cd trunk/
> $> svn move IPC/ inter_process_com
> D + IPC
> A + inter_process_com
> $> svn commit
> commited revision 1005
> and so on...
> 
> Now I tried to update a users working copy which he had changed meanwhile at 
> some files. The result was:
> $> cd trunk/
> $> svn update
> svn: Cannot replace a directory from within
> 
> What does that mean? The moved directories all are subdirectories of the 
> trunk/ directory. This even happens with
> $> cd ..
> $> svn update trunk/
> svn: Cannot replace a directory from within
> 
> Is there a problem with updating working directories when main directories 
> where moved or is it just because the working directory was changed in the 
> meantime?

Without knowing that user's local changes, it's impossible to say why
this is happening.  What were his local changes before the update?

> This should not be the behaviour of a versioning system, right?

Subversion's bug tracker "should" be empty, too :-).

-Karl

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

Re: Problems with update after moving several directories

Posted by François Beausoleil <fb...@ftml.net>.

On 07/12/2004 09:49, Brass Tilde wrote:
>>3) I 'mkdir' the missing top-level directories 'trunk', 'branch' and
>>'tags'.
>>4) I "svn add" them. (Possible design oversight: why not a "svn mkdir"
>>command to do that sort of thing as a single operation?)
> 
> 
> I can't respond to the rest of your post, but as to this: there is "a 'svn
> mkdir' command that will do that sort of thing as a single operation".  See
> 'svn help mkdir' for more info.  :-)

There's now RSVN, which could create all three directories as a single 
atomic operation:
    https://opensvn.csie.org/traccgi/rsvn/trac.cgi/wiki

Bye !
François

Re: Problems with update after moving several directories

Posted by Brass Tilde <br...@insightbb.com>.
> 3) I 'mkdir' the missing top-level directories 'trunk', 'branch' and
> 'tags'.
> 4) I "svn add" them. (Possible design oversight: why not a "svn mkdir"
> command to do that sort of thing as a single operation?)

I can't respond to the rest of your post, but as to this: there is "a 'svn
mkdir' command that will do that sort of thing as a single operation".  See
'svn help mkdir' for more info.  :-)


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

Re: Problems with update after moving several directories

Posted by Steve Hosgood <st...@xlimaging.com>.
On Mon, 2004-12-06 at 15:28, Patrick Heinemann wrote:
> Dear all,
> 
> I have recently changed the directory layout of our software, e.g.
> $> cd trunk/
> $> svn move IPC/ inter_process_com
> D + IPC
> A + inter_process_com
> $> svn commit
> commited revision 1005
> and so on...
> 

Hmm: I don't have an answer for Patrick, but I have seen what might be a
related problem - possibly a bug in "svn move" handling. Here's what
happened to me as best I've been able to work out:

1) I checked out project X
2) I realise that when we'd created the project X repository, we should
have had top-level 'trunk' 'branch' and 'tags' directories. Instead the
component directories of the project itself are at top level. Never mind
- this is SVN, not CVS, so I can move them!
3) I 'mkdir' the missing top-level directories 'trunk', 'branch' and
'tags'.
4) I "svn add" them. (Possible design oversight: why not a "svn mkdir"
command to do that sort of thing as a single operation?)
5) I do some "svn move" commands to shift the project's top-level
directories "Software", "Docs" and "Hardware" into the 'trunk'
directory. (Nuisance misfeature: "svn move" apparently won't take
multiple files/directories and move them all into one directory
destination like Un*x's "mv" or "cp" commands will.)
6) That's got the directory tree looking like I want it!
7) I spend a while further down the tree sorting out a memory leak in
the code.
8) Commit time!
9) I forget whether or not I committed just my memory-leak fix in the
".../Software" subdirectory or whether 'svn' moaned about the directory
tree having been restructured when I tried. Whatever:
10) I go right to the top directory and do a "svn commit" in order to
get the new directory structure into version-control.
11) SVN refuses, pointing out that someone else has committed changes to
the system whilst I've been working on my memory leak.
12) I do an "svn update" to fix that.
13) I repeat my "svn commit" command.
14) DISASTER!! I notice some "D" (deleted) messages amongst the "svn
commit" summary report, then people around the office start complaining
that some of their recently-added files have gone missing after they do
a "svn update" to pick up the new directory structure.

It seems that what happened was that SVN had memorised a specific "move
list" of directories and files that needed moving as a result of my
original "svn move" commands. However, by the time I came to commit the
changes, people had added more files and subdirectories. But my "move
list" wasn't updated to reflect that despite me issuing a "svn update"
command prior to my "svn commit".

So those other users' new files got dropped on the floor. It took the
best part of a day to find what was missing and resurrect them.

Surely, if SVN did create a "move list", it should have limited itself
to just a top-level view, i.e. "move directory .../Software (and all
below it) to .../trunk/Software" and therefore avoid worrying about
whether a specific low-level file .../Software/Gadget6/gui.c had
actually existed at the time I issued the "svn move" order?

Steve.


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