svn and bzr-svn clash on commit

Bug #145148 reported by Maciej Katafiasz
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij

Bug Description

It's possible to cause a clash between SVN and bzr on commit. Tested with 0.4 r719

The command log below creates a simple testcase:

mkdir -p /tmp/bzr-svn-conflict
cd /tmp/bzr-svn-conflict
svnadmin create test

svn co file:///tmp/bzr-svn-conflict/test/ svnco
cd svnco/
echo foo > foo.txt
svn add foo.txt
svn ci -m "add file"

cd ..
bzr get test/ bzrco
cd bzrco/
echo bar > bar.txt
bzr add bar.txt
bzr ci -m "add another file"
bzr push /tmp/bzr-svn-conflict/test

cd ../svnco/
echo baz > baz.txt
svn add baz.txt
svn ci -m "add yet another file" # Things go wrong here, it commits r3 again
svn up

cd ../bzrco/
echo qux > qux.txt
bzr add qux.txt
bzr ci -m "add still more files"
bzr merge
bzr commit -m "merge"
bzr push

Revision history for this message
Maciej Katafiasz (mathrick) wrote :

Forgot to paste the backtrace I get after the last command:

bzr: ERROR: libsvn._core.SubversionException: ("File already exists: filesystem '/tmp/bzr-svn-conflict/test/db', transaction '4-1', path '/baz.txt'", 160020)

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 817, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 779, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 477, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 804, in run
    push_result = br_from.push(br_to, overwrite)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1556, in push
    _override_hook_source_branch=_override_hook_source_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1598, in _push_with_bound_branches
    result = self._basic_push(target, overwrite, stop_revision)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1617, in _basic_push
    target.update_revisions(self, stop_revision)
  File "/home/mathrick/.bazaar/plugins/svn/branch.py", line 356, in update_revisions
    push(self, other, revid)
  File "/home/mathrick/.bazaar/plugins/svn/commit.py", line 674, in push
    builder.commit(rev.message)
  File "/home/mathrick/.bazaar/plugins/svn/commit.py", line 455, in commit
    branch_batons[-1])
  File "/home/mathrick/.bazaar/plugins/svn/commit.py", line 256, in _dir_process
    new_child_path), baton, None, -1, self.pool)
  File "/home/mathrick/.bazaar/plugins/svn/errors.py", line 77, in convert
    raise convert_error(e)
SubversionException: ("File already exists: filesystem '/tmp/bzr-svn-conflict/test/db', transaction '4-1', path '/baz.txt'", 160020)

bzr 0.90.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'push']

** please send this report to <email address hidden>

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Reproduced here, thanks for the bugreport.

Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This now gives a more appropriate error message. It can't be fixed for the case where you are pushing to the root of the subversion repository, because it is impossible in Subversion to do a "R"(replace) operation on the repository root.

I've added a test to make sure that it *does* work correctly for non-root branches, and that passes ok.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Fixed in bzr.

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: none → 0.4.4
status: Triaged → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.