Sheriffing/How To/Unified Repos: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Uplift instructions)
m (Clean up setup instructions)
Line 7: Line 7:


Here's how I set it up:
Here's how I set it up:
* Set up your ssh key yourself
Set up your ssh key yourself
* Install Mercurial 3.2 or higher
Install Mercurial 3.2 or higher
* Make a copy of your .hgrc file for safekeeping and delete the original
Make a copy of your .hgrc file for safekeeping and delete the original
* hg clone https://hg.mozilla.org/mozilla-central
* hg clone https://hg.mozilla.org/mozilla-central
* hg clone https://hg.mozilla.org/hgcustom/version-control-tools
* hg clone https://hg.mozilla.org/hgcustom/version-control-tools
* cd mozilla-central
* cd mozilla-central
* ./mach mercurial-setup
* ./mach mercurial-setup
** Configure mercurial as desired (do not enable the mq extension)
Configure mercurial as desired (do not enable the mq extension)<br />
* Edit your global .hgrc file to add the following to the [extensions] section:
Edit your global .hgrc file to add the following to the [extensions] section:
** firefoxtree = /path/to/version-control-tools/hgext/firefoxtree
*firefoxtree = /path/to/version-control-tools/hgext/firefoxtree
* The following will pull all (or at least most) of the branches sheriffs need to have on hand:
The following will pull all (or at least most) of the branches sheriffs need to have on hand:
** hg pull inbound && hg pull b2ginbound && hg pull fx-team && hg pull aurora && hg pull beta && hg pull esr31 && hg pull b2g34 && hg pull b2g32 && hg pull b2g30  
* hg pull inbound && hg pull b2ginbound && hg pull fx-team && hg pull aurora && hg pull beta && hg pull esr31 && hg pull b2g34 && hg pull b2g32 && hg pull b2g30  
** If you need other branches, you can find their names in the [https://hg.mozilla.org/hgcustom/version-control-tools/file/default/pylib/mozautomation/mozautomation/repository.py firefoxtree extension source].
If you need other branches, you can find their names in the [https://hg.mozilla.org/hgcustom/version-control-tools/file/default/pylib/mozautomation/mozautomation/repository.py firefoxtree extension source].


You should now have everything set up for proper use!  
You should now have everything set up for proper use! <br />
The `hg fxheads` command should list references to each of the relevant branch names, and the current revision and commit message for each.
The `hg fxheads` command should list references to each of the relevant branch names, and the current revision and commit message for each.



Revision as of 21:46, 1 January 2015

Unified Repos

I(KWierso)'ll clean this up as I go. Rough IRC logs for now.

Setting up the repo

Here's how I set it up: Set up your ssh key yourself Install Mercurial 3.2 or higher Make a copy of your .hgrc file for safekeeping and delete the original

Configure mercurial as desired (do not enable the mq extension)
Edit your global .hgrc file to add the following to the [extensions] section:

  • firefoxtree = /path/to/version-control-tools/hgext/firefoxtree

The following will pull all (or at least most) of the branches sheriffs need to have on hand:

  • hg pull inbound && hg pull b2ginbound && hg pull fx-team && hg pull aurora && hg pull beta && hg pull esr31 && hg pull b2g34 && hg pull b2g32 && hg pull b2g30

If you need other branches, you can find their names in the firefoxtree extension source.

You should now have everything set up for proper use!
The `hg fxheads` command should list references to each of the relevant branch names, and the current revision and commit message for each.

Merges

This assumes you have your unified repo all set up so that `hg fxheads` lists each of central, b2ginbound, fx-team, and inbound.

To merge a specific non-tip <revision> from mozilla-inbound to mozilla-central:

  1. hg pull central
  2. hg pull inbound
  3. hg up central
  4. hg merge -r <revision>
  5. hg commit -m "Merge mozilla-inbound to mozilla-central a=merge"
  6. hg push -r . central

To merge mozilla-central into mozilla-inbound:

  1. hg pull central
  2. hg pull inbound
  3. hg up inbound
  4. hg merge central
  5. hg commit -m "Merge mozilla-central to mozilla-inbound a=merge"
  6. hg push -r . inbound
  • If the `hg merge central` command results in "abort: nothing to merge", you should instead use `hg update -r <mozilla-central's tip revision>` to do a non-merging update, then you can do `hg push -r . inbound` to push it as usual.

Checkin-neededs

This assumes we're checking things in to fx-team. Replace fx-team with another branch name as needed.

Update fx-team and prepare for the patches:

  • hg pull fx-team
  • hg up fx-team
  • hg bookmark fx-team-checkins

Import the patches:

Verify your outgoing changes:

  • hg out -r . fx-team

If you haven't lost a push race:

  • hg push -r . fx-team

If you lost a push race:

  • hg pull fx-team
  • hg rebase -d fx-team
  • hg push -r . fx-team

Delete your no longer needed bookmark:

  • hg bookmark -d fx-team-checkins

Uplifts

If branch-specific patches are posted, follow the checkin-needed instructions above, importing the patches onto the release branch.

If you're uplifting directly from an m-c checkin to aurora:

Pull and update to prepare for the uplifts:

  • hg pull central
  • hg pull aurora
  • hg up aurora

Graft the mc commit and bring up the editor to edit the commit message, adding "a=foo" as needed:

  • hg graft --edit -r <revision>

Repeat the previous step as needed for all uplifts as needed. Verify the outgoing changes and push:

  • hg out -r . aurora
  • hg push -r . aurora

You can graft a range of commits at once if that's easier:

  • hg graft -r <toprevision><bottomrevision>

Read the documentation for graft for further help.

Rebasing after losing a push race

This assumes you have commits you're attempting to push to mozilla-inbound when you lose a push race with someone. Change `inbound` to the correct branch name as needed.

  • hg pull inbound
  • hg rebase -d inbound
  • hg push -r . inbound

Recovering from mistakes

WARNING: This will strip out any commits that haven't been pushed to the remote repositories, regardless of what branch/label/tag those commits are on. (So if you have local changes on inbound and run this command to strip something bad on fx-team, both inbound and fx-team will be stripped.) Only do this if you don't care about any of those commits!

  • hg strip 'not public()'