Merge lp:~jelmer/brz/workingtree-keyerror into lp:brz/3.2

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/workingtree-keyerror
Merge into: lp:brz/3.2
Diff against target: 24 lines (+5/-2)
1 file modified
breezy/git/workingtree.py (+5/-2)
To merge this branch: bzr merge lp:~jelmer/brz/workingtree-keyerror
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+403489@code.launchpad.net

Commit message

Handle KeyError when dirname was removed earlier.

Description of the change

Handle KeyError when dirname was removed earlier.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/workingtree.py'
2--- breezy/git/workingtree.py 2021-05-24 23:37:25 +0000
3+++ breezy/git/workingtree.py 2021-05-30 16:29:42 +0000
4@@ -647,7 +647,10 @@
5 raise errors.BadFilenameEncoding(
6 relpath, osutils._fs_enc)
7 if not self.is_versioned(relpath.decode(osutils._fs_enc)):
8- dirnames.remove(name)
9+ try:
10+ dirnames.remove(name)
11+ except ValueError:
12+ pass # removed earlier
13 for name in filenames:
14 if self.mapping.is_special_file(name):
15 continue
16@@ -984,7 +987,7 @@
17 if conflicted:
18 self.index[path] = self.index[path]._replace(flags=self.index[path].flags | FLAG_STAGEMASK)
19 else:
20- self.index[path] = self.index[path]._replace(flags=self.index[path].flags &~ FLAG_STAGEMASK)
21+ self.index[path] = self.index[path]._replace(flags=self.index[path].flags & ~FLAG_STAGEMASK)
22
23 def add_conflicts(self, new_conflicts):
24 with self.lock_tree_write():

Subscribers

People subscribed via source and target branches