Merge lp:~spiv/bzr/dir_to-423563 into lp:bzr/2.0
Proposed by
Andrew Bennetts
Status: | Merged |
---|---|
Approved by: | Martin Pool |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~spiv/bzr/dir_to-423563 |
Merge into: | lp:bzr/2.0 |
Diff against target: |
86 lines (+27/-12) 4 files modified
NEWS (+4/-0) bzrlib/branch.py (+3/-10) bzrlib/push.py (+9/-2) bzrlib/tests/blackbox/test_push.py (+11/-0) |
To merge this branch: | bzr merge lp:~spiv/bzr/dir_to-423563 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pool | Approve | ||
bzr-core | Pending | ||
Review via email: mp+15232@code.launchpad.net |
To post a comment you must log in.
This fixes bug 423563, a traceback when doing push --use-existing-dir to a location that exists and contains a .bzr directory that is not actually a valid BzrDir. This patch will cause a simple error instead: "Target directory FOO already contains a .bzr directory, but it is not valid."
(I think there's a deeper API issue I haven't addressed here: part of the problem is that BzrDir. open_from_ transport doesn't differentiate between "doesn't exist" and "exists but has corrupt/invalid bzrdir". Similarly, Branch. create_ clone_on_ transport raises FileExists both for "the destination directory already exists (use_existing_dir would suppress this)" and for "cannot create a bzrdir in the destination because one already exists." So the obvious use of the API that tries open_from_ transport, and simply falls back to create_ clone_on_ transport needs some pretty precise error handling to do the right thing in all cases. I think solving that properly would be a lot of work, though.)
This patch I think is small and safe enough that it's a candidate for 2.0.x.