A man with a mission...

Double Landings? No Problem!

I just found a really useful way to do the double landings that we have to do if we want to land anything on the 1.9.1 branch right now. hg has this handy feature that will let you import from a url, which means it’s incredibly simple to take a changeset from mozilla-central, and then push it to mozilla-1.9.1:

  1. Figure out your changeset url for mozilla-central. For this example, we’ll use http://hg.mozilla.org/mozilla-central/rev/242894260a86.
  2. In your mozilla-1.9.1 tree, run hg import and pass in the previously obtained mozilla-central revision url, with a minor modification: change rev to raw-rev (so you’ll end up with http://hg.mozilla.org/mozilla-central/raw-rev/242894260a86

Assuming it applied cleanly, you now have that changeset as a local commit in your repo. You can now push like you always do. Happy landings!

comments

9 Responses to “Double Landings? No Problem!”

  1. Dirkjan Ochtman on December 11th, 2008

    I think this feature is hg 1.1 only, so it will only work for those who’ve upgraded…

  2. Shawn Wilsher on December 11th, 2008

    @Dirkjan
    I thought so to (maybe it was because you said as much on irc – can’t recall), but It’s working for me with Mercurial 1.0 on my mac.

  3. David Baron on December 11th, 2008

    You can also use the transplant extension for this. Just stick “hgext.transplant = ” in the [extensions] section of your .hgrc, and then run hg help transplant.

  4. Dao on December 11th, 2008

    Yeah, this works with hg 1.0.1 on Ubuntu as well. I also started doing “hg import -m … -u … https://bugzilla.mozilla.org/attachment.cgi?…“.

  5. Mossop on December 12th, 2008

    Only problem is you also need to import to mq to edit the commit message to include the approval.

  6. Shawn Wilsher on December 12th, 2008

    @Mossop
    I tend to not bother. It’s clear if you open the bug that something has approval or not. I also bet this works for hg qimport

  7. Mossop on December 12th, 2008

    Isn’t it part of the checkin rules to mark approvals for landings? I’m gonna get your privs revoked!

  8. Shawn Wilsher on December 12th, 2008

    @Mossop
    From tinderbox:

    Your checkin comment should include the bug#, a clear explanation of the fix, and reviewers.

    We also aren’t supposed to checkin on orange, and people land all the time with orange (even bad orange).

  9. Neil Rashbrook on December 15th, 2008

    Looks like this doesn’t produce git-style diffs, which doesn’t help with adds/removes/renames etc.