bzrlib patch processor has unchecked iteration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned | ||
Breezy |
Triaged
|
Medium
|
Unassigned |
Bug Description
In bzrlib/patches.py, at line 281 is an iter_lines.next() call. If .next() has ended, Python will throw a StopIteration exception. I have a patch file (included below) which does cause this exception to be thrown, which means no hunk is returned.
The quick way to fix this is to wrap the call in a try block:
try:
if isinstance(
if isinstance(
except StopIteration, e:
Here's the diff that causes the failure:
Index: cvsanaly/
=======
--- cvsanaly/
+++ cvsanaly/
@@ -2,6 +2,13 @@
* pycvsanaly2/
+ Do not use the current commit_id for links of old paths, but the
+ 'from' commit_id.
+
+2009-02-26 Carlos Garcia Campos <email address hidden>
+
+ * pycvsanaly2/
+
Remove the leading '/' when inserting into files cache if the
original path doesn't start with '/' (cvs).
Changed in bzr: | |
status: | Incomplete → Confirmed |
importance: | Undecided → Wishlist |
tags: | added: check-for-breezy |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | removed: check-for-breezy |
Wrong diff, I take it?