Merge lp:~mbp/bzr/403523-status-crash into lp:~bzr/bzr/trunk-old

Proposed by Martin Pool
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mbp/bzr/403523-status-crash
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 54 lines
To merge this branch: bzr merge lp:~mbp/bzr/403523-status-crash
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
John A Meinel Needs Fixing
Review via email: mp+9739@code.launchpad.net
To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/403523-status-crash into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>

No test cases?

I believe we have a per_inventory test suite, so you could test it at
that level.

Otherwise:

 review needs_fixing
 merge approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkp60x8ACgkQJdeBCYSNAAP0CACbBlSzUz04l/7piQcvTtWpc1Q0
V64An2icYIPmiAVlvdOGVxR8GJoXUztl
=60uL
-----END PGP SIGNATURE-----

review: Needs Fixing
Revision history for this message
Vincent Ladeuil (vila) wrote :

I was about to ask for tests then I saw https://bugs.edge.launchpad.net/bzr/+bug/403523/comments/1

From there I conclude you got that patch covered by some failing test[s].

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

It's true this is covered by a blackbox test in 2a, but I'll look at doing a per-inventory one. If it's hard I'll probably skip it though.

Revision history for this message
Robert Collins (lifeless) wrote :

> It's true this is covered by a blackbox test in 2a, but I'll look at doing a
> per-inventory one. If it's hard I'll probably skip it though.

test_inv has a comprehensive set of parameterised tests I added for apply_delta; should be trivial to add another case there - gimme a shout if its not obvious.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-08-11 02:58:23 +0000
3+++ NEWS 2009-08-11 10:35:50 +0000
4@@ -123,6 +123,9 @@
5 running send and similar commands on 2a formats.
6 (Martin Pool, #408201)
7
8+* Fix crash in some invocations of ``bzr status`` in format 2a.
9+ (Martin Pool, #403523)
10+
11 * Fixed export to existing directory: if directory is empty then export
12 will succeed, otherwise it fails with error.
13 (Alexander Belchenko, #406174)
14
15=== modified file 'bzrlib/inventory.py'
16--- bzrlib/inventory.py 2009-08-05 02:30:59 +0000
17+++ bzrlib/inventory.py 2009-08-11 10:35:50 +0000
18@@ -743,6 +743,9 @@
19 """
20 return self.has_id(file_id)
21
22+ def has_filename(self, filename):
23+ return bool(self.path2id(filename))
24+
25 def id2path(self, file_id):
26 """Return as a string the path to file_id.
27
28@@ -1363,9 +1366,6 @@
29 yield ie
30 file_id = ie.parent_id
31
32- def has_filename(self, filename):
33- return bool(self.path2id(filename))
34-
35 def has_id(self, file_id):
36 return (file_id in self._byid)
37
38
39=== modified file 'bzrlib/status.py'
40--- bzrlib/status.py 2009-03-23 14:59:43 +0000
41+++ bzrlib/status.py 2009-08-11 10:35:50 +0000
42@@ -156,11 +156,11 @@
43 to_file.write("%s %s\n" % (prefix, nonexistent))
44 if (new_is_working_tree and show_pending):
45 show_pending_merges(new, to_file, short, verbose=verbose)
46+ if nonexistents:
47+ raise errors.PathsDoNotExist(nonexistents)
48 finally:
49 old.unlock()
50 new.unlock()
51- if nonexistents:
52- raise errors.PathsDoNotExist(nonexistents)
53 finally:
54 wt.unlock()
55