@@ -221,18 +221,21 @@ def absorb_applied(trans, iw, patch_name, temp_name, edit_fun):
221
221
# Pop any patch on top of the patch we're refreshing.
222
222
to_pop = trans .applied [trans .applied .index (patch_name ) + 1 :]
223
223
if len (to_pop ) > 1 :
224
- popped = trans .pop_patches (lambda pn : pn in to_pop )
225
- assert not popped # no other patches were popped
224
+ popped_extra = trans .pop_patches (lambda pn : pn in to_pop )
225
+ assert not popped_extra # no other patches were popped
226
226
trans .push_patch (temp_name , iw )
227
- assert to_pop .pop () == temp_name
227
+ top_name = to_pop .pop ()
228
+ assert top_name == temp_name
228
229
229
230
# Absorb the temp patch.
230
231
temp_cd = trans .patches [temp_name ].data
231
232
assert trans .patches [patch_name ] == temp_cd .parent
232
233
trans .patches [patch_name ] = trans .stack .repository .commit (
233
234
edit_fun (trans .patches [patch_name ].data .set_tree (temp_cd .tree )))
234
- popped = trans .delete_patches (lambda pn : pn == temp_name , quiet = True )
235
- assert not popped # the temp patch was topmost
235
+ popped_extra = trans .delete_patches (
236
+ lambda pn : pn == temp_name , quiet = True
237
+ )
238
+ assert not popped_extra # the temp patch was topmost
236
239
temp_absorbed = True
237
240
238
241
# Push back any patch we were forced to pop earlier.
@@ -255,8 +258,8 @@ def absorb_unapplied(trans, iw, patch_name, temp_name, edit_fun):
255
258
if we had to leave it for the user to deal with."""
256
259
257
260
# Pop the temp patch.
258
- popped = trans .pop_patches (lambda pn : pn == temp_name )
259
- assert not popped # the temp patch was topmost
261
+ popped_extra = trans .pop_patches (lambda pn : pn == temp_name )
262
+ assert not popped_extra # the temp patch was topmost
260
263
261
264
# Try to create the new tree of the refreshed patch. (This is the
262
265
# same operation as pushing the temp patch onto the patch we're
@@ -275,8 +278,10 @@ def absorb_unapplied(trans, iw, patch_name, temp_name, edit_fun):
275
278
# the temp patch.
276
279
trans .patches [patch_name ] = trans .stack .repository .commit (
277
280
edit_fun (patch_cd .set_tree (new_tree )))
278
- popped = trans .delete_patches (lambda pn : pn == temp_name , quiet = True )
279
- assert not popped # the temp patch was not applied
281
+ popped_extra = trans .delete_patches (
282
+ lambda pn : pn == temp_name , quiet = True
283
+ )
284
+ assert not popped_extra # the temp patch was not applied
280
285
return True
281
286
else :
282
287
# Nope, we couldn't create the new tree, so we'll just have to
0 commit comments