Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
all
Description
> svnadmin create repos > svn co file:///`pwd`/repos -d r > cd r > mkdir 1 > touch 1/1 > svn add 1 1/1 > svn ci -F /dev/null > svn mv 1 2 > svn mv 2/1 2/2 > svn ci -F /dev/null I see the bug, and I know what's wrong. The bug is that the second 'mv' command didn't just error out right there on the spot, as it should have. Remember that a scheduled 'mv' is just a scheduled 'cp' (add-with-history) followed by a scheduled 'rm'. And we *don't* allow something to be copied twice. In other words: svn cp A B svn cp B C is illegal, and needs to be prevented by libsvn_wc... which it's apparently not doing anymore. The second 'cp' is clobbering the entry's copyfrom-url field (which already existed from the first copy.) Here's a comment from our code, at the bottom of libsvn_wc/copy.c: /* Rabbinic Commentary Q: Why can't we 'svn cp' something that we just copied? i.e. 'svn cp foo foo2; svn cp foo2 foo3" A: It leads to inconsistencies. In the example above, foo2 has no associated repository URL, because it hasn't been committed yet. But suppose foo3 simply inherited foo's URL (i.e. foo3 'pointed' to foo as a copy ancestor by virtue of transitivity.) For one, this is not what the user would expect. That's certainly not what the user typed! Second, suppose that the user did a commit between the two 'svn cp' commands. Now foo3 really *would* point to foo2, but without that commit, it pointed to foo. Ugly inconsistency, and the user has no idea that foo3's ancestor would be different in each case. And even if somehow we *could* make foo3 point to foo2 before foo2 existed in the repository... what's to prevent a user from committing foo3 first? That would break. */
Attachments
Attachments
Issue Links
- blocks
-
SVN-2822 Propagate implied merge info on WC -> WC copy/move operations
- Closed
- depends upon
-
SVN-3357 Working Copy - Next Generation Library
- Closed
- is blocked by
-
SVN-3357 Working Copy - Next Generation Library
- Closed
- is depended upon by
-
SVN-2822 Propagate implied merge info on WC -> WC copy/move operations
- Closed
- is duplicated by
-
SVN-1670 Concatenated svn move/copy/add/delete without intermediate commit
- Closed