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.

This Friday: Computer Science as a Profession

13 November, 2013 § 1 Comment

This Friday I’ll be giving a talk to 250 primarily first-year students majoring in Computer Science at Michigan State University. This presentation is part of their CSE 100: Computer Science as a Profession course that students are required to take.

I’m planning on starting with an overview of Mozilla and some of the unique technical challenges that I’ve had to solve. One of the really cool things about working at Mozilla is getting to see and experience up front the wide spectrum of computing problems that are being tackled.

Within the Mozilla community, there are people working on the forefront of research by implementing a new memory-safe and concurrent programming language (Rust) and parallel browser engine (Servo) to finding innovative ways to get people more involved with producing web content (Webmaker).

I will try to record the presentation, but I can’t make any guarantees.

I feel very honored to receive an invitation to give this talk, and I’m greatly looking forward to it. If you have some helpful tips for college freshman, please do share in the comments below.

Australis landing plans

8 November, 2013 § 38 Comments

Australis

The team working on the new Australis version of Firefox (myself included) is starting to get close to merging to mozilla-central. We’re too far from being able to say exactly when this code will merge, but I want to go over our backout plan for Australis.

As you may or may not know, Australis is a project to provide an updated visual design, streamlined tab strip, new Firefox menu and improved customization capabilities.

Australis

Due to its large scope, Australis couldn’t be implemented with the ability to toggle its presence via an about:config preference. This unfortunately carries with it a more burdensome plan to undo the changes should there be issues that lead us to delay the release of Australis.

When Australis (currently located on the UX branch) merges to mozilla-central, the Australis team will manage a special project branch that mirrors mozilla-central but excludes the Australis changes. This branch is located in the temporary Holly project.

In the likely chance that we choose to hold Australis on the Nightly train for an extra release cycle, we will use Holly to merge to mozilla-aurora. This will allow the mozilla-central changes not related to Australis to continue moving along with the release trains.

This also presents an issue in that the code that reaches Aurora will have a tiny fraction of the testing hours on it compared to the Nightly builds. To work around this, I’m asking that users who aren’t interested in Australis use the Holly branch for their Nightly builds. This will help spread out some of the testing hours and make sure to catch any potential merge bustage faster. I’ll be posting a link to download Holly nightlies once we merge from UX to mozilla-central.

In the meantime, if you are looking to help test Australis you can download a build from the UX branch.

My contribution to today’s Firefox release

29 October, 2013 § 6 Comments

I haven’t written up one of these blog posts in a while. The previous one was in August 2012 for Firefox 15. Coincidentally, that post mentioned a subtle change to the site identity area of the web browser.

In today’s release of Firefox, there is another subtle change to the site identity area of the browser. Pages that are a part of Firefox itself, whether it be the built-in home page (about:home), our troubleshooting page (about:support), or others now sport a special Firefox branding within the location bar. The goal of this branding is to increase awareness and trust with these pages.

2013-10-29_1229

Clicking on the Firefox name or the two-tone Firefox logo next to the name will show a popup notification that explains that this is a secure Firefox page.

2013-10-29_1229_002

These changes were previously announced when I introduced them to the Nightly channel of Firefox this past July.

Determining when an element is scrollable in Gecko

16 October, 2013 § 1 Comment

As a web developer, there are often times where it’s necessary to know if an element on a page is scrollable. One way of checking this would be to find the difference of element.scrollWidth and element.clientWidth. If the difference between these two properties is non-zero, then the element is scrollable. However, this doesn’t work for all cases.

In particular, element.scrollWidth and element.clientWidth clamp their values to integers. If the difference between the scrollWidth and clientWidth is less than zero, then the computed difference between the two will result in zero. This is less than good.

Starting in Firefox 16 [1], there is a new property element.scrollLeftMax which returns the difference of scrollWidth and clientWidth, including the fractional component. Also introduced is the companion element.scrollTopMax for use in determining vertical scrolling availability.

Hopefully these properties will find their way in to the other layout engines.

[1] These properties were implemented in bug 766937.

Student project: Australis-styled widgets

11 September, 2013 § 2 Comments

A couple weeks back, Gijs Kruitbosch and I began mentoring a group of students on a new student project focused on building some new Australis-styled widgets.

Team MSUThe team is comprised of students from Michigan State University’s Computer Science program. Pictured from left to right are Dan Poggi, Eric Proper, Eric Slenk, and Dave Thorpe.

The goal of the project will be to create four independent widgets using the Add-on SDK and new Australis widget API:

  1. A weather widget that can show the weather for a selected location as well as up to 5-7 additional locations. This will need to use a public and free weather API.
  2. A music playing widget that will play music located on the user’s local machine. The user can select a folder on their machine and the widget will play any media files that it can find within that folder or in that folder’s children. We may need to limit the recursive depth to 2 folders.
  3. A Bugzilla widget that will show the assigned bugs, review requests, etc. This will be based on Heather Arthur‘s excellent Bugzilla Todos dashboard.
  4. A Spartan Scoreboard widget that will show the date, opponent, and location of the next MSU sporting event, as well as the score of the previous game. It should also include a link to get more information.

Eric Proper, Eric Slenk, and David Thorpe have begun blogging about their progress. You can follow along and get more details on their respective blogs. Eric Proper has an amazing amount of detail already on his blog. I’m looking forward to seeing the blogs from Dan Poggi and Dave Thorpe.

We will be meeting weekly at 9:00am Eastern time on Thursdays throughout the Fall semester.

Backing up your contacts on FirefoxOS

25 July, 2013 § 21 Comments

I’ve been helping beta test B2G and subsequently FirefoxOS since October 2012.  Once in a while I’ve come across a bug that requires me to reset the phone back to its factory state. Unfortunately at this early stage there isn’t a built-in way to back up your data from a FirefoxOS phone. I’m sure it’s on a roadmap, but as with all v1 products you have to make some tough calls when it comes to feature prioritization.

This tutorial provides a step-by-step walk through of how to backup and restore your contacts on a B2G or FirefoxOS phone. It’s not supported so it may stop working in the future, but for now it works :)

To complete this tutorial you’ll need a B2G/FirefoxOS phone, a USB cable to connect your phone to your computer, and the Android Debug Bridge installed (referred to as `adb` later in the tutorial).

1. Start up your FirefoxOS phone and go to Settings.

step1

2. Go to Device Information

step2

3. Go to More Information

step3

4. Go to Developer

step4

5. Enable “Remote Debugging”. This will allow you to use ADB to pull data off of the phone.

step5

6. Connect your phone to the computer using the USB cable.

7. In your console, type `adb devices` to check that the phone has connected properly. You should see your phone listed as an attached device. At this point you can now use `adb shell` to browse through the system files on the phone.

8. Type `adb pull /data/local/indexedDB/chrome/3406066227csotncta.sqlite .` This will pull the contacts IndexedDB database off of your phone and in to your local working directory. If you are curious about the contents of the database, you can install the IndexedDB Browser add-on for Firefox which will let you open up the database.

2013-07-23_2109

And you are now done with backing up your contacts. If you need to reset your phone in the future, you can just follow these steps again but replace step 8 with the following: `adb push 3406066227csotncta.sqlite /data/local/indexedDB/chrome/3406066227csotncta.sqlite`. This will push your backed-up contacts database back on to the device.

Where Am I?

You are currently browsing entries tagged with mozilla at JAWS.

Follow

Get every new post delivered to your Inbox.

Join 1,004 other followers