You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Martin Tomes <li...@tomes.org> on 2004/04/08 09:55:22 UTC

Add/branch/switch/remove/switch issue.

I ran into this while moving our project over from CVS to Subversion and I think this is  a problem. 
  It's a slightly odd situation but not an unlikely one.

Many of the target files in our project were committed to CVS because not everyone has the tools 
required to build all of the targets.  Not unreasonable.  However, there are a lot of these targets 
and I decided that when moving to subversion they would be removed from the version control system 
so I did the following:

  - Move all files from CVS to Subversion including the targets to get a known starting point.
  - Created a branch and switched to it.
  - Made lots of changes including removing the targets.
  - Rebuilt the code.  At this point the targets appear again but not under version control.
  - Switched back to the trunk.

The final switch failed because the targets existed in the working copy, and they existed on the 
trunk in Subversion.  I had to delete my working copy and re-checkout the trunk before I could merge 
the branch into the trunk.

I have reproduced this below, once you are in this position parts of the WC are on the trunk URL and 
parts are on the branch URL and there is no way out that I could find.

Server: RedHat 8, Apache 2.0.48, Subversion 1.0.1
Client: Windows/XP, Subversion 1.0.1

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
f:\martinto\tmp>svn checkout http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk play
Checked out revision 47.
f:\martinto\tmp>cd play
F:\martinto\tmp\play>echo xxx > afile.txt
F:\martinto\tmp\play>mkdir sub
F:\martinto\tmp\play>cd sub
F:\martinto\tmp\play\sub>echo xxx > survivor.txt
F:\martinto\tmp\play\sub>echo xxx > NotReallyWanted.txt
F:\martinto\tmp\play\sub>cd ..
F:\martinto\tmp\play>svn add afile.txt sub
A         afile.txt
A         sub
A         sub\NotReallyWanted.txt
A         sub\survivor.txt
F:\martinto\tmp\play>svn commit
Adding         afile.txt
Adding         sub
Adding         sub\NotReallyWanted.txt
Adding         sub\survivor.txt
Transmitting file data ...
Committed revision 48.
F:\martinto\tmp\play>svn copy http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk/ 
http://svn.eurotherm.co.uk:81/svn/play/martinto/branches/cleanup
Committed revision 49.
F:\martinto\tmp\play>svn switch http://svn.eurotherm.co.uk:81/svn/play/martinto/branches/cleanup
At revision 49.
F:\martinto\tmp\play>cd sub/
F:\martinto\tmp\play\sub>ls
NotReallyWanted.txt
survivor.txt
F:\martinto\tmp\play\sub>svn delete NotReallyWanted.txt
D         NotReallyWanted.txt
F:\martinto\tmp\play\sub>cd ..
F:\martinto\tmp\play>svn commit
Deleting       sub\NotReallyWanted.txt

Committed revision 50.
F:\martinto\tmp\play>cd sub
F:\martinto\tmp\play\sub>ls
survivor.txt
F:\martinto\tmp\play\sub>echo xxx > NotReallyWanted.txt
F:\martinto\tmp\play\sub>cd ..
F:\martinto\tmp\play>svn switch http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk/
svn: Failed to add file 'sub/NotReallyWanted.txt': object of the same name already exists
F:\martinto\tmp\play>rm sub/NotReallyWanted.txt
F:\martinto\tmp\play>svn switch http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk/
svn: Can't copy 'sub/.svn/text-base/NotReallyWanted.txt.svn-base' to 
'sub/.svn/tmp/text-base/NotReallyWanted.txt.svn-base.tmp': The system cannot find the file specified.

Should I add this to the Issue tracker?

-- 
Martin Tomes
echo 'Martin x Tomes at controls x eurotherm x co x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'


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

Re: Switching between branches: scaling issue

Posted by John Peacock <jp...@rowman.com>.
Folker Schamel wrote:

> When using a branch for developing a particular feature
> for some longer time, then typically there are much
> more changes merged from trunk to the branch from day
> to day than the work itself done on the branch.

I hate to sound like a broken record, but svk does this very well, in that the 
local mirror of trunk can be easily merged with the local branch.  Tthe merge 
back to the trunk is only the changes between the tip of the branch and the tip 
of the trunk (as it should be).

> 
> Now when doing a merge from trunk to the branch,
> every merged file gets a new node in the svn repository,
> even if the file will be the same as in trunk, correct?

Yes, because the branch copy is now changed from being a copy of the original 
trunk file (due to the merge).  Subversion doesn't track merge history (except 
as log entries), so there is no way that it can tell that it should just update 
the pointer on the branch to point at the new version on trunk.

However, I could definitely see the utility of having a new subcommand

	svn update --freshen

which would replace the WC content of a file which was a copy with the newer 
content of the copy source, but only if there were no other local changes.  IOW, 
if the branch node was only a pointer to some other node, --freshen would 
repoint the branch node to the latest revision of the original node.  No, I 
don't know how to program this, and no I don't know how this would work with 
renames of the source node.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

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

Switching between branches: scaling issue

Posted by Folker Schamel <sc...@spinor.com>.
Hello,

When using a branch for developing a particular feature
for some longer time, then typically there are much
more changes merged from trunk to the branch from day
to day than the work itself done on the branch.

Now when doing a merge from trunk to the branch,
every merged file gets a new node in the svn repository,
even if the file will be the same as in trunk, correct?

This means, when switching between trunk and the branch,
the svn server work needed for the switch is proportional
to the (large) number of changes done on trunk
since the branch creation, not proportional to the
(small) number of differences between trunk and branch.

Is this correct?

(If yes, maybe some node hash value map can be used
to identify nodes in the branch which are equal
to the corresponding node in trunk, avoiding
the branch "degeneration"?
This also would reduce the repository size
a lot, because most merge changes in the branch
don't have to be stored separately.)

A side effect I noticed is that when switching,
also files which have been changed since branch creation
but which are equal on the trunk and branch (due to merging)
get a new file time. This can cause ugly recompiles.

Cheers,
Folker

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

Re: Add/branch/switch/remove/switch issue.

Posted by makl <ma...@tigris.org>.
Martin Tomes wrote:
> 2. A second attempt at the switch shows urls which are wrong.  
> View.dfm isn't in /itools/trunk it's in /itools/trunk/wizards.

I think this is issue 1826 
(http://subversion.tigris.org/issues/show_bug.cgi?id=1826).



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

Re: Add/branch/switch/remove/switch issue.

Posted by Martin Tomes <li...@tomes.org>.
makl wrote:
> Filed as issue 1825
> (http://subversion.tigris.org/issues/show_bug.cgi?id=1825).

I have recreated the original problem I had by dumping the repository, removing the newer revisions 
and loading it into a new repository.

There is a lot of code in the repository, here is a log of an attempt to do a a switch from a branch 
to the trunk with files in the way of ones which are in the switch destination:

 >svn switch http://svn.eurotherm.co.uk:81/svn/repo/itools/trunk/
svn: Failed to add file 'wizards/iToolsWz.dll': object of the same name already exists
UU wizards\View.dfm
UU wizards\Main.dfm
 >cd wizards
 >svn status iToolsWz.dll
I      iToolsWz.dll
 >del iToolsWz.dll
del iToolsWz.dll
 >cd ..
 >svn switch http://svn.eurotherm.co.uk:81/svn/repo/itools/trunk/
svn: REPORT request failed on '/svn/repo/!svn/vcc/default'
svn:
File not found: revision '58', path '/itools/trunk/View.dfm'


The status on iToolsWz.dll shows an I because dll files are in the ignore list.  There appear to be 
a couple of problems:

   1. When Subversion finds an object of the same name which already exists it stops prematurely. 
There are a lot more changed files than View.dfm and Main.dfm.  It looks like it processes that 
directory and then gives up.
   2. A second attempt at the switch shows urls which are wrong.  View.dfm isn't in /itools/trunk 
it's in /itools/trunk/wizards.

A switch when there are no objects of the same name which already exist works fine.  If you need any 
more information let me know, I will keep this repository and working copy for a while.

-- 
Martin Tomes
echo 'Martin x Tomes at controls x eurotherm x co x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'

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

Re: Add/branch/switch/remove/switch issue.

Posted by makl <ma...@tigris.org>.
Filed as issue 1825
(http://subversion.tigris.org/issues/show_bug.cgi?id=1825).



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

Re: Add/branch/switch/remove/switch issue.

Posted by makl <ma...@tigris.org>.
>> F:\martinto\tmp\play>svn switch http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk/
>>svn: Failed to add file 'sub/NotReallyWanted.txt': object of the same name already exists
>>F:\martinto\tmp\play>rm sub/NotReallyWanted.txt
>>F:\martinto\tmp\play>svn switch http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk/
>>svn: Can't copy 'sub/.svn/text-base/NotReallyWanted.txt.svn-base' to 
>>'sub/.svn/tmp/text-base/NotReallyWanted.txt.svn-base.tmp': The system cannot find the file specified.
> 
> 
> I *think* this particular bug is either already fixed, or already
> filed.  Philip and makl have been working on a number of 'svn switch'
> bugs that look like this, whereby 'svn switch' isn't restartable when it
> should be.  Philip, makl... comments?

This is new. I will file an issue for it.



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

Re: Add/branch/switch/remove/switch issue.

Posted by Ben Collins-Sussman <su...@collab.net>.
On Thu, 2004-04-08 at 04:55, Martin Tomes wrote:

> The final switch failed because the targets existed in the working copy, and they existed on the 
> trunk in Subversion.  I had to delete my working copy and re-checkout the trunk before I could merge 
> the branch into the trunk.

Sure.  This is absolutely intentional.  One of the main design tenets of
Subversion is:  "never *ever* lose data".  That means that 'svn up' (and
'svn switch', which is just a variant of update) will *never* overwrite
unversioned data with versioned data.  It will bail out and tell you
why.

> I have reproduced this below, once you are in this position parts of the WC are on the trunk URL and 
> parts are on the branch URL and there is no way out that I could find.

Sure there is:  delete all the unversioned files, and re-run 'up' or
'switch'.  Or just checkout a new working copy.


> F:\martinto\tmp\play>svn switch http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk/
> svn: Failed to add file 'sub/NotReallyWanted.txt': object of the same name already exists
> F:\martinto\tmp\play>rm sub/NotReallyWanted.txt
> F:\martinto\tmp\play>svn switch http://svn.eurotherm.co.uk:81/svn/play/martinto/trunk/
> svn: Can't copy 'sub/.svn/text-base/NotReallyWanted.txt.svn-base' to 
> 'sub/.svn/tmp/text-base/NotReallyWanted.txt.svn-base.tmp': The system cannot find the file specified.

I *think* this particular bug is either already fixed, or already
filed.  Philip and makl have been working on a number of 'svn switch'
bugs that look like this, whereby 'svn switch' isn't restartable when it
should be.  Philip, makl... comments?



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