Closed Bug 914269 Opened 11 years ago Closed 11 years ago

Imported patches have redundant header lines

Categories

(Developer Services :: Mercurial: qimportbz, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gps, Assigned: emorley)

Details

Attachments

(1 file)

I just ran |hg qimport bz://891766| and the resulting raw file in my mq directory has redundant patch header lines:

# vim: se ft=diff :
# HG changeset patch
# User Askeing Yen <fyen@mozilla.com>
# Date 1378694797 -28800
Bug 891766 - Add gecko's git commit info in B2G build. r=?

# HG changeset patch
# User Askeing Yen <fyen@mozilla.com>
# Date 1378694797 -28800
# Node ID b98ce9700d948d465f5a7a38a628bc3733fa4549
# Parent  c7cc85e13f7ab547bcf062985d5ddb2eb09f2e6a
Bug 891766 - Add gecko's git commit info in B2G build. r=?

diff --git a/toolkit/content/buildconfig.html b/toolkit/content/buildconfig.html
--- a/toolkit/content/buildconfig.html
+++ b/toolkit/content/buildconfig.html
<actual diff>

I'm running Mercurial 2.7.0.

The raw patch in the referenced bug seems fine and |hg qimport -n foo https://bug891766.bugzilla.mozilla.org/attachment.cgi?id=801374| did the right thing, so this smells like a qimportbz bug.
Attached patch Patch v1Splinter Review
Strip the original header from imported patches, to avoid duplication when we add the cleaned up version later on. Borrows the regexp from:
http://selenic.com/hg/file/79e5de2bfa8c/mercurial/patch.py#l163
Attachment #801936 - Flags: review?(sphink)
Assignee: nobody → emorley
Status: NEW → ASSIGNED
Comment on attachment 801936 [details] [diff] [review]
Patch v1

Review of attachment 801936 [details] [diff] [review]:
-----------------------------------------------------------------

Ugh, another magic regex copy/paste. But once again, the original isn't usefully accessible.

I haven't actually tried this, but the approach seems sound given where you got the regex from. Thanks!
Attachment #801936 - Flags: review?(sphink) → review+
Cheers :-)

https://hg.mozilla.org/users/robarnold_cmu.edu/qimportbz/rev/e1be488e64f4
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Other Applications → Developer Services
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: