You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kevin Ballard <ke...@sb.org> on 2004/09/29 08:19:38 UTC
Redundant 'svn delete' unchallenged
I just ran into an easy-to-reproduce situation that creates empty
commits. Basically, you delete a file in one working copy and commit,
then delete the same file in another working copy and commit that
without updating. The commit goes through just fine and the resulting
revision has no modified files. I would have expected it to challenge
the commit for multiple reasons:
1) The files in question didn't exist anymore in the repository
2) The resulting commit was empty
3) The directory itself was out of date
When examining the 'svn log' it shows no modified paths, and it shows
no author and no date. When examining a dump of the repo it shows no
changed nodes, yet it does list an author and a date.
A quick script to reproduce this issue is the following (make sure you
don't already have existing files/dirs named Test, Test2, or TestRepo):
========================================================
#!/bin/sh -x
svnadmin create TestRepo --fs-type fsfs
svn checkout file://${PWD}/TestRepo Test
cd Test
touch foo
svn add foo
svn commit -m 'Initial add'
cd ..
svn checkout file://${PWD}/TestRepo Test2
cd Test2
svn delete foo
svn commit -m 'Delete wc2'
cd ../Test
svn delete foo
svn commit -m 'Delete wc1'
svn update
svn log -v
cd ..
svnadmin dump TestRepo
rm -rf TestRepo Test Test2
========================================================
After running this script, my resulting log is:
========================================================
------------------------------------------------------------------------
r3 | (no author) | (no date) | 1 line
------------------------------------------------------------------------
r2 | kevin | 2004-09-29 04:17:05 -0400 (Wed, 29 Sep 2004) | 1 line
Changed paths:
D /foo
Delete wc2
------------------------------------------------------------------------
r1 | kevin | 2004-09-29 04:17:03 -0400 (Wed, 29 Sep 2004) | 1 line
Changed paths:
A /foo
Initial add
------------------------------------------------------------------------
========================================================
And my resulting repo dump is:
========================================================
SVN-fs-dump-format-version: 2
UUID: 0f25ba2f-36e5-0310-9741-f1cced0fab34
Revision-number: 0
Prop-content-length: 56
Content-length: 56
K 8
svn:date
V 27
2004-09-29T08:17:01.855677Z
PROPS-END
* Dumped revision 0.
Revision-number: 1
Prop-content-length: 111
Content-length: 111
K 7
svn:log
V 11
Initial add
K 10
svn:author
V 5
kevin
K 8
svn:date
V 27
2004-09-29T08:17:03.544880Z
PROPS-END
Node-path: foo
Node-kind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 0
Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
Content-length: 10
PROPS-END
* Dumped revision 1.
Revision-number: 2
Prop-content-length: 110
Content-length: 110
K 7
svn:log
V 10
Delete wc2
K 10
svn:author
V 5
kevin
K 8
svn:date
V 27
2004-09-29T08:17:05.492571Z
PROPS-END
Node-path: foo
Node-action: delete
* Dumped revision 2.
Revision-number: 3
Prop-content-length: 110
Content-length: 110
K 7
svn:log
V 10
Delete wc1
K 10
svn:author
V 5
kevin
K 8
svn:date
V 27
2004-09-29T08:17:06.626249Z
PROPS-END
* Dumped revision 3.
========================================================
This issue affects both svn 1.0.x and svn 1.1.x (both fsfs and BDB)
--
Kevin Ballard
kevin@sb.org
http://www.tildesoft.com
http://kevin.sb.org
Re: Redundant 'svn delete' unchallenged
Posted by kf...@collab.net.
Can you file an issue for this? I thought we had one (the recipe is
familiar), but a search of the issues database doesn't turn it up.
The behavior is "expected", by the way. Subversion does not consider
it a merge conflict if two people delete the same file, since the
result is the same (the file is gone). So the repository
automatically merges the second deletion with the revision containing
the first deletion, and then creates a new revision based on the
result of that merge.
Not saying this is good, of course, just not a surprise.
-K
Kevin Ballard <ke...@sb.org> writes:
> I just ran into an easy-to-reproduce situation that creates empty
> commits. Basically, you delete a file in one working copy and commit,
> then delete the same file in another working copy and commit that
> without updating. The commit goes through just fine and the resulting
> revision has no modified files. I would have expected it to challenge
> the commit for multiple reasons:
>
> 1) The files in question didn't exist anymore in the repository
>
> 2) The resulting commit was empty
>
> 3) The directory itself was out of date
>
> When examining the 'svn log' it shows no modified paths, and it shows
> no author and no date. When examining a dump of the repo it shows no
> changed nodes, yet it does list an author and a date.
>
> A quick script to reproduce this issue is the following (make sure you
> don't already have existing files/dirs named Test, Test2, or TestRepo):
>
> ========================================================
> #!/bin/sh -x
>
> svnadmin create TestRepo --fs-type fsfs
> svn checkout file://${PWD}/TestRepo Test
> cd Test
> touch foo
> svn add foo
> svn commit -m 'Initial add'
> cd ..
> svn checkout file://${PWD}/TestRepo Test2
> cd Test2
> svn delete foo
> svn commit -m 'Delete wc2'
> cd ../Test
> svn delete foo
> svn commit -m 'Delete wc1'
> svn update
> svn log -v
>
> cd ..
> svnadmin dump TestRepo
>
> rm -rf TestRepo Test Test2
> ========================================================
>
> After running this script, my resulting log is:
>
> ========================================================
> ------------------------------------------------------------------------
> r3 | (no author) | (no date) | 1 line
>
>
> ------------------------------------------------------------------------
> r2 | kevin | 2004-09-29 04:17:05 -0400 (Wed, 29 Sep 2004) | 1 line
> Changed paths:
> D /foo
>
> Delete wc2
> ------------------------------------------------------------------------
> r1 | kevin | 2004-09-29 04:17:03 -0400 (Wed, 29 Sep 2004) | 1 line
> Changed paths:
> A /foo
>
> Initial add
> ------------------------------------------------------------------------
> ========================================================
>
> And my resulting repo dump is:
>
> ========================================================
> SVN-fs-dump-format-version: 2
>
> UUID: 0f25ba2f-36e5-0310-9741-f1cced0fab34
>
> Revision-number: 0
> Prop-content-length: 56
> Content-length: 56
>
> K 8
> svn:date
> V 27
> 2004-09-29T08:17:01.855677Z
> PROPS-END
>
> * Dumped revision 0.
> Revision-number: 1
> Prop-content-length: 111
> Content-length: 111
>
> K 7
> svn:log
> V 11
> Initial add
> K 10
> svn:author
> V 5
> kevin
> K 8
> svn:date
> V 27
> 2004-09-29T08:17:03.544880Z
> PROPS-END
>
> Node-path: foo
> Node-kind: file
> Node-action: add
> Prop-content-length: 10
> Text-content-length: 0
> Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
> Content-length: 10
>
> PROPS-END
>
>
> * Dumped revision 1.
> Revision-number: 2
> Prop-content-length: 110
> Content-length: 110
>
> K 7
> svn:log
> V 10
> Delete wc2
> K 10
> svn:author
> V 5
> kevin
> K 8
> svn:date
> V 27
> 2004-09-29T08:17:05.492571Z
> PROPS-END
>
> Node-path: foo
> Node-action: delete
>
>
> * Dumped revision 2.
> Revision-number: 3
> Prop-content-length: 110
> Content-length: 110
>
> K 7
> svn:log
> V 10
> Delete wc1
> K 10
> svn:author
> V 5
> kevin
> K 8
> svn:date
> V 27
> 2004-09-29T08:17:06.626249Z
> PROPS-END
>
> * Dumped revision 3.
> ========================================================
>
> This issue affects both svn 1.0.x and svn 1.1.x (both fsfs and BDB)
>
> --
> Kevin Ballard
> kevin@sb.org
> http://www.tildesoft.com
> http://kevin.sb.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org