Skip to content

Fix delete passthrough regression

Fixes a bug that was exposed by the announce() refactor in commit 62613f0b:

  • Passthrough objects didn't have an id_me() method, so the announce call in do_delete was failing, even when the debug level wouldn't print it.

This is the output of the test against master without the fix: (The test succeeds against 3.43)

$ ./singletest delete
Test delete
--- delete.chk  2018-03-28 12:33:02.000000000 -0500
+++ -   2018-03-28 12:45:36.255966348 -0500
@@ -1,9 +1,21 @@
 # Use --quiet so that adding commits to the test files doesn't break the test
 read <liftlog.fi
 1..$ delete --quiet
-inspect
-
-read <testrepo.fi
-1..$ delete --quiet
-inspect
-
+Traceback (most recent call last):
+  File "/temp/reposurgeon/reposurgeon", line 14008, in <module>
+    main()
+  File "/temp/reposurgeon/reposurgeon", line 13998, in main
+    cmd.Cmd.onecmd(interpreter, interpreter.precmd(arg))
+  File "/usr/local/lib/python2.7/cmd.py", line 221, in onecmd
+    return func(arg)
+  File "/temp/reposurgeon/reposurgeon", line 9798, in do_script
+    self.onecmd(self.precmd(scriptline))
+  File "/temp/reposurgeon/reposurgeon", line 8926, in onecmd
+    cmd.Cmd.onecmd(self, line)
+  File "/usr/local/lib/python2.7/cmd.py", line 221, in onecmd
+    return func(arg)
+  File "/temp/reposurgeon/reposurgeon", line 11169, in do_delete
+    self.chosen().squash(self.selection, set(["--delete"]) | parse.options)
+  File "/temp/reposurgeon/reposurgeon", line 6711, in squash
+    announce(DEBUG_DELETE, "Deletion list is %s" % [self.events[x].id_me() for x in selected])
+AttributeError: 'Passthrough' object has no attribute 'id_me'

Merge request reports