Open Bug 1053548 Opened 12 years ago Updated 9 years ago

Reject likely unedited mq folds

Categories

(Developer Services :: Mercurial: hg.mozilla.org, defect)

defect
Not set
normal

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: glandium, Assigned: gps)

Details

(Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/885] )

Attachments

(1 file)

See, for example: https://hg.mozilla.org/mozilla-central/rev/6b285759568c hg log -k '* * *' suggests that happens quite often. How this happens, essentially is when two patches are folded with mq, their summaries are concatenated and '* * *' is added in between. I think we should detect those '* * *' and reject changesets containing them.
This would be good to do, there are just a few cases it would break at present, eg: https://hg.mozilla.org/mozilla-central/rev/b72560289748 (|hg qbackout -s| style output [1]) https://hg.mozilla.org/mozilla-central/rev/eeb213ed89b1 (cairo backport, presumably done by script) [1] https://hg.mozilla.org/hgcustom/version-control-tools/file/201f04d2215d/hgext/qbackout/__init__.py#l226
Though we could just special-case the backouts for now.
Product: Release Engineering → Developer Services
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/146]
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/146] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/880] [kanban:engops:https://kanbanize.com/ctrl_board/6/146]
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/880] [kanban:engops:https://kanbanize.com/ctrl_board/6/146] [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/884] [kanban:engops:https://kanbanize.com/ctrl_board/6/146] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/884] [kanban:engops:https://kanbanize.com/ctrl_board/6/146] [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/885] [kanban:engops:https://kanbanize.com/ctrl_board/6/146]
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/885] [kanban:engops:https://kanbanize.com/ctrl_board/6/146] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/885]
Assignee: nobody → gps
Status: NEW → ASSIGNED
Comment on attachment 8807648 [details] hghooks: reject likely unedited commit message folds (bug 1053548); https://reviewboard.mozilla.org/r/90742/#review91168 ::: hghooks/mozhghooks/commit-message.py:35 (Diff revision 1) > ]] > > trySyntax = re.compile(r'\btry:') > > +# A line with "* * *" is likely an unedited commit message fold. > +RE_MESSAGE_FOLD = re.compile('^\* \* \*$', re.MULTILINE) We may want to match ^***$ too. There are more than a few in the mercurial history. ::: hghooks/mozhghooks/commit-message.py:67 (Diff revision 1) > message("Rev {rev} contains 'r?' in the commit message. Please use 'r=' instead.") > return False > > + if RE_MESSAGE_FOLD.search(desc): > + message('Rev {rev} contains a likely unedited commit message fold. ' > + 'Please edit the commit message to remove `* * *`.') Might be worth being more explicit here, because I can imagine people not looking further and just removing the separator line, and creating weird commit messages.
Attachment #8807648 - Flags: review?(mh+mozilla)
Forgot to add: this is better than nothing, but I don't quite like that this relies on a client-side hook. Not everyone using mercurial uses vct.
This hook runs on the server. It is also possible to run some of these hooks on clients. Although that isn't their target audience.
QA Contact: hwine → klibby
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: