Creating a patch that can be checked in

  • Revision slug: Creating_a_patch_that_can_be_checked_in
  • Revision title: Creating a patch that can be checked in
  • Revision id: 234534
  • Created:
  • Creator: HeliosBryan
  • Is current revision? No
  • Comment Insert username configuration to make it easier for users new to MQ; 16 words added

Revision Content

A lot of Mozilla developers and volunteers these days are using checkin-needed keyword to find a checkin-buddy that can help them pushing their amazing stuff on mozilla-inbound, and maybe you're among them.

This is really cool and everybody is more than happy to help you comple your work, because we all benefit from it. However, there is something you can do to help people pushing your patch.

Here are some hints to speed up the landing of your checkin-needed patch:

  • Set yourself as author of the patch. Maybe you don't know that Mercurial can do this for you if you use Mercurial Queues (and you should really use them). Just edit your Mercurial.ini or $HOME/.hgrc adding an uppercase -U option to qnew command, it will set hg username (you) as author of any qnew patch (username setting is under [ui]):
    [defaults]
    diff = -p -U 8
    qdiff = -p -U 8
    qnew = -U
    
    [ui]
    username = Firstname Lastname <firstname.lastname@example.net>
    
  • Set the title of the patch. Again if you use Mercurial Queues this is really easy: ensure the patch you want to edit is the current one with hg qtop, then hg qrefresh -m "Bug 12345 - Test bug", or hg qrefresh -e will launch your editor where you can just type-in or paste title, save and close editor. You can set a default editor in the [ui] section of Mercurial.ini or $HOME/.hgrc.
  • If the bug includes more patches and not all of them should be pushed, use the whiteboard to specify which patch is ready to be pushed.
  • If the patch should be pushed to a specific branch (like comm-central, or a project branch) rather than mozilla-inbound (or a release branch) use the whiteboard to specify where the patch should be pushed.
  • Before asking checkin-needed, pull the latest branch and ensure your patch applies cleanly. Bitrotted patches usually take more time before being pushed. With Mercurial Queues you can just hg qpop -a, hg pull, hg update default, hg qpush (repeat hg qpush for all patches in queue), fix any merge patches and qrefresh them one by one if you notice failures, then attach the updated patches.

  • You can directly attach the patch that lives in /your_repository_folder/.hg/patches/mypatch.diff to the bug, or even better export the top applied patch in the queue with hg export qtip > path_to_temp_patches/exportedpatch.diff and attach this file (the latter method should guarantee 8 lines of context for easier reviews).

These small steps will take you just a few seconds, but will save a lot of work for people willing to help you.

Revision Source

<p>A lot of Mozilla developers and volunteers these days are using <em>checkin-needed</em> keyword to find a checkin-buddy that can help them pushing their amazing stuff on mozilla-inbound, and maybe you're among them.</p>
<p>This is really cool and everybody is more than happy to help you comple your work, because we all benefit from it.<strong> However, there is something you can do to help people pushing your patch.</strong></p>
<p>Here are some hints to speed up the landing of your checkin-needed patch:</p>
<ul> <li><strong>Set yourself as author of the patch</strong>. Maybe you don't know that Mercurial can do this for you if you use <a href="/en/Mercurial_Queues" title="Mercurial Queues">Mercurial Queues</a> (and you should really use them). Just edit your<em> Mercurial.ini</em> or <em>$HOME/.hgrc</em> adding an uppercase <em>-U</em> option to <em>qnew</em> command, it will set hg <em>username</em> (you) as author of any qnew patch (<em>username</em> setting is under <em>[ui]</em>):<br> <pre>[defaults]
diff = -p -U 8
qdiff = -p -U 8
qnew = -U

[ui]
username = Firstname Lastname &lt;firstname.lastname@example.net&gt;
</pre> </li> <li><strong>Set the title of the patch</strong>. Again if you use <a href="/en/Mercurial_Queues" title="Mercurial Queues">Mercurial Queues</a> this is really easy: ensure the patch you want to edit is the current one with <code>hg qtop</code>, then<em> <code>hg qrefresh -m "Bug 12345 - Test bug"</code></em>, or <code>hg qrefresh -e</code> will launch your editor where you can just type-in or paste title, save and close editor. You can set a default editor in the <em>[ui]</em> section of <em>Mercurial.ini </em> or <em>$HOME/.hgrc</em>.</li> <li>If the bug includes more patches and not all of them should be pushed, <strong>use the whiteboard to specify which patch is ready</strong> to be pushed.</li> <li>If the patch should be pushed to a specific branch (like comm-central, or a project branch) rather than mozilla-inbound (or a release branch) <strong>use the whiteboard to specify where the patch should be pushed</strong>.</li> <li> <p>Before asking <em>checkin-needed</em>, pull the latest branch and <strong>ensure your patch applies cleanly</strong>. Bitrotted patches usually take more time before being pushed. With <a href="/en/Mercurial_Queues" title="Mercurial Queues">Mercurial Queues</a> you can just <code>hg qpop -a, hg pull, hg update default, hg qpush</code> (repeat <code>hg qpush</code> for all patches in queue), fix any merge patches and qrefresh them one by one if you notice failures, then attach the updated patches.</p> </li> <li>You can directly attach the patch that lives in <em>/your_repository_folder/.hg/patches/mypatch.diff</em> to the bug, or even better export the top applied patch in the queue with <code>hg export qtip &gt; path_to_temp_patches/exportedpatch.diff</code> and attach this file (the latter method should guarantee 8 lines of context for easier reviews).</li>
</ul>
<p>These small steps will take you just a few seconds, but will save a lot of work for people willing to help you.</p>
Revert to this revision