Topfile-checking pre-commit hook can't deal with trying to reopen a different ticket

Bug #1248491 reported by Laurens Van Houtven
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Twisted/Trac Integration
New
Low
Unassigned

Bug Description

When reviewing #2053, I had an issue where the topfile claimed this was 2503. I accidentally put that as the ticket this fixed in the commit message.

This lead to the following confusing message when trying to undo that commit:

trunk ❯ svn status ⏎
A + twisted/test/test_import.py
D twisted/topfiles/2503.removal
trunk ❯ svn commit -m "Unmerge remove-test-import-2053

Reopens: #2053

This branch accidentally had the wrong topfile.
"
Adding twisted/test/test_import.py
Deleting twisted/topfiles/2503.removal
svn: E165001: Commit failed (details follow):
svn: E165001: Commit blocked by pre-commit hook (exit code 1) with output:
Must remove a <ticket>.{feature,bugfix,doc,removal,misc} file for re-opened tickets. For further details, refer to http://twistedmatrix.com/trac/wiki/ReviewProcess#Newsfiles

This resulted in having to reopen #2503 (the ticket that was accidentally closed by the commit message, even though it was already closed), and then manually setting it back to fixed.

I'm not entirely sure what the resolution for this is. It does appear that at least the error message could be better. Since this apparently hasn't happened before in Twisted's history (or at least as far as JP can recall), this is probably not very high priority, especially since there is a workaround.

Revision history for this message
Laurens Van Houtven (lvh) wrote :

So, I think the real issue is when you try to Reopen a ticket that is different from the name of the topfile that you're trying to remove in that commit.

There's a good argument to be made for *NOT* fixing that. Just as I made the mistake of closing the wrong ticket, someone might try to reopen the wrong ticket!

So perhaps just the message should be fixed and a reference to the workaround?

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

I think the bug is that the commit hook let you "Fixes:" a ticket that was already closed. If it hadn't allowed that then you wouldn't have put merged the wrong changeset to trunk in the first place.

If you'd accidentally "Fixes:" a ticket that happened to be open then you would have been able to revert the merge in the usual way (and you would have wanted to "Reopen:" the same ticket you closed - which would have matched the topfile - so everything would have worked).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.