Merge lp:~spiv/bzr/br_to-again-423563-2.0 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/br_to-again-423563-2.0
Merge into: lp:bzr/2.0
Diff against target: 41 lines (+20/-0)
2 files modified
NEWS (+14/-0)
bzrlib/push.py (+6/-0)
To merge this branch: bzr merge lp:~spiv/bzr/br_to-again-423563-2.0
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+18593@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrew Bennetts (spiv) wrote :

This extends some simple paranoia from an earlier patch for bug 423563 to the NoSuchFile case. We already reraise unhandled FileExists errors in show_push_branch (because otherwise we get UnboundLocalErrors later), and this patch does the same for NoSuchFile errors, because a user in bug 423563 has reported this can happen too.

That NoSuchFile can occur in that situation is probably a bug, and we should fix that underlying bug, but getting the original NoSuchFile error is the first step towards diagnosing that bug.

Revision history for this message
Martin Pool (mbp) wrote :

Looks good, but please clarify in the comment why it shouldn't happen. I presume because clone... is supposed to catch and reraise it.

Also news when landing.

ok for 2.0

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2010-01-21 19:35:57 +0000
3+++ NEWS 2010-02-05 06:33:18 +0000
4@@ -5,6 +5,20 @@
5 .. contents:: List of Releases
6 :depth: 1
7
8+bzr 2.0.5 (not released yet)
9+############################
10+
11+:Codename:
12+:2.0.5:
13+
14+Bug Fixes
15+*********
16+
17+* If ``bzr push --create-prefix`` triggers an unexpected ``NoSuchFile``
18+ error, report that error rather than failing with an unhelpful
19+ ``UnboundLocalError``.
20+ (Andrew Bennetts, #423563)
21+
22 bzr 2.0.4
23 #########
24
25
26=== modified file 'bzrlib/push.py'
27--- bzrlib/push.py 2009-11-25 06:10:00 +0000
28+++ bzrlib/push.py 2010-02-05 06:33:18 +0000
29@@ -110,6 +110,12 @@
30 "\nYou may supply --create-prefix to create all"
31 " leading parent directories."
32 % location)
33+ # This shouldn't occur (because create_prefix is true, so
34+ # create_clone_on_transport should be catching NoSuchFile and
35+ # creating the missing directories) but if it does the original
36+ # NoSuchFile error will be more informative than an
37+ # UnboundLocalError for br_to.
38+ raise
39 except errors.TooManyRedirections:
40 raise errors.BzrCommandError("Too many redirections trying "
41 "to make %s." % location)

Subscribers

People subscribed via source and target branches