Closed Bug 980986 Opened 11 years ago Closed 10 years ago

qimportbz incorrectly prompts to overwrite patch if filename on bug was equal to the bug number

Categories

(Developer Services :: Mercurial: qimportbz, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

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

Attachments

(6 files, 1 obsolete file)

1) hg qdel 973703 2) hg qimportbz bz://973703 Fetching... done Parsing... done adding 973703 to series file A patch file named '973703' already exists in your patch directory. Rename patch 'add Ro and use consistent punctuation' (8387672) (r)/overwrite (o)? o applying 973703 now at: 973703 -> The file we're being prompted to overwrite did not exist prior; qimportbz just gets in a muddle because the filename on the bug matches the bug number.
Product: Other Applications → Developer Services
Assignee: emorley → nobody
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/123]
Whiteboard: [kanban:engops:https://kanbanize.com/ctrl_board/6/123] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/918] [kanban:engops:https://kanbanize.com/ctrl_board/6/123]
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/918] [kanban:engops:https://kanbanize.com/ctrl_board/6/123] [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/918] [kanban:engops:https://kanbanize.com/ctrl_board/6/123] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/923] [kanban:engops:https://kanbanize.com/ctrl_board/6/123] [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/924] [kanban:engops:https://kanbanize.com/ctrl_board/6/123]
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/924] [kanban:engops:https://kanbanize.com/ctrl_board/6/123] → [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/924]
Assignee: nobody → emorley
Status: NEW → ASSIGNED
/r/5311 - qimportbz: Remove support for Mercurial older than v1.9 /r/5313 - qimportbz: Remove support for Python older than v2.6 /r/5315 - qimportbz: pyflakes, pep8, comment & whitespace cleanup /r/5317 - qimportbz: avoid filename collisions with the temporary patch file (bug 980986) /r/5319 - qimportbz: don't rename patches to 'y' if no filename entered (bug 980986) /r/5321 - qimportbz: cleanup the "rename patch" prompt message (bug 980986) Pull down these commits: hg pull review -r 9af7b13815ba6893f1f755a465b5362bd94a6d03
Attachment #8577204 - Flags: review?(gps)
https://reviewboard.mozilla.org/r/5317/#review4295 ::: hgext/qimportbz/__init__.py (Diff revision 1) > + name = "%s_" % name I'm happy to change the suffix string, or switch to a prefix if you think more appropriate. I just thought a suffix wouldn't screw with the sort order, if there are multiple patches and for some reason the patch author gave the first one a filename that matched the bug number, and then bug number + a suffix for the later ones.
https://reviewboard.mozilla.org/r/5317/#review4381 Ship It! ::: hgext/qimportbz/__init__.py (Diff revision 1) > + ui.write("Changing patch filename to avoid conflict with temporary file.\n") > + name = "%s_" % name Suffix works here. Use ui.status() for informative messages. It is also customary to surround status messages with () to diminish their importance.
Attachment #8577204 - Flags: review?(gps) → review+
Comment on attachment 8577204 [details] MozReview Request: bz://980986/edmorley https://reviewboard.mozilla.org/r/5309/#review4387
https://reviewboard.mozilla.org/r/5317/#review4601 > Suffix works here. > > Use ui.status() for informative messages. It is also customary to surround status messages with () to diminish their importance. Agree about ui.status(), re the brackets, I can't see a precedance for this either in mq or even in Mercurial core - so I think I'll leave without for now (if only for consistency with the rest of qimportbz).
(In reply to Gregory Szorc [:gps] from comment #7) > Use ui.status() for informative messages. qimportbz now works as expected when using -q: [~/src/vctools/hgext/bzexport]$ hg qimport bz://973703 Fetching... done Parsing... done adding 973703 to series file Changing patch filename to avoid conflict with temporary file. renamed 973703 -> 973703_ [~/src/vctools/hgext/bzexport]$ hg qdel 973703_ [~/src/vctools/hgext/bzexport]$ hg qimport -q bz://973703 adding 973703 to series file [~/src/vctools/hgext/bzexport]$ The "adding 973703 to series file" comes from mq - seems like it should not be using ui.warn() here: http://selenic.com/hg/file/b7f936f47f2b/hgext/mq.py#l2153 Would you agree? (Can't face jumping through the ridiculous newsgroup patch posting hoops if you think they won't accept it)
Flags: needinfo?(gps)
I'm not sure if upstream will accept that patch. mq is mostly unloved. Come to think of it, I wouldn't be surprised if they accept it with a response like "yeah, sure."
Flags: needinfo?(gps)
Attachment #8577204 - Attachment is obsolete: true
Attachment #8618092 - Flags: review+
Attachment #8618093 - Flags: review+
Attachment #8618094 - Flags: review+
Attachment #8618095 - Flags: review+
Attachment #8618096 - Flags: review+
Attachment #8618097 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: