Running a backout branch with Mercurial

21 November, 2013 § 3 Comments

As mentioned in an earlier post, we are running a special branch of Firefox that is made of the Nightly (mozilla-central) trunk minus the Australis changes. This branch will be the source of our Aurora (mozilla-aurora) builds in a few weeks.

As we were planning this work, we found that there weren’t many resources on the internet that described how to do what we wanted.

Basically, we have our trunk that will have a large and invasive feature being built on it. However, we also want to have a branch that doesn’t include this work.

To get started, we created a separate repository (holly) that was cloned from mozilla-central prior to the feature branch being merged in to mozilla-central. When the feature branch was merged in to mozilla-central, we merged over mozilla-central to holly again. At this point we ran a reverse diff of this merge (which only consisted of the feature branch changes). This reverse diff was then applied and committed to essentially back out all of the feature branch on this new holly repository.

Getting started was the easy part. Of course, software is never finished and we needed to figure out how to handle future changes to the feature.

We kicked around many ideas as we were trying to figure out how we wanted to run the backout branch, and I feel that we have settled on a pretty simple route that so far has worked smoothly.

Each time that we want to merge from mozilla-central to holly we do the following:

  1. cd /mozilla-central
  2. hg pull -u
  3. cd /holly
  4. hg pull -u
  5. hg pull /mozilla-central -r mozillaCentralChangeset
  6. if the set of changes between holly tip and mozillaCentralChangeset include changes that need to be backed out:
    1. hg up -r mozillaCentralChangeset
      • to switch heads to the mozilla-central-based head
    2. hg qbackout -r rev1+rev2+rev3
      • from oldest to newest, where rev* are the revisions that need to be backed out)
    3. hg qfin -a
    4. hg up -r hollyTipChangeset
      • to switch heads back to the holly-based head
  7. hg merge
  8. hg commit -m "merge mozilla-central to holly"
  9. hg push

qbackout is a Mercurial extension written by some Mozillians to make backing changesets out much easier. It uses Mercurial Queues and generates reverse diffs instead of creating a full backout branch like hg backout does. I highly recommend it.

I hope this post will help others who want to do something similar.

Tagged: , , , ,

§ 3 Responses to Running a backout branch with Mercurial

  • blackwhitestripes says:

    sounds like you’ve found a solution that could allow for an ongoing non Australis version of Firefox. on behalf of all those who are very angry about Australis, please make such a version official and ongoing.

    • msujaws says:

      Not really. In order to do this correctly each patch that is specific to Australis needs to be marked as such so that we can make sure to find it and back it out. This will get increasingly hard 6 months from now for example.

      Of course anything is possible, and if someone had enough time and energy to run something like this themselves then more power to them 🙂

  • Steve Fink says:

    re: step 6c. qbackout is *supposed* to reorder things for you automatically, so you shouldn’t need to worry about what order you specify them. In my light testing, it worked.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

What’s this?

You are currently reading Running a backout branch with Mercurial at JAWS.

meta

%d bloggers like this: