Sheriffing/How To/Unified Repos
Unified Repos
I(KWierso)'ll clean this up as I go. Rough IRC logs for now.
Setting up the repo
- http://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/unifiedrepo.html
- https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/firefoxtree.html
Here's how I set it up:
- Install Mercurial 3.2 or higher
- 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/hgcustom/version-control-tools
- cd mozilla-central
- ./mach mercurial-setup
- 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:
- hg pull central
- hg pull inbound
- hg up central
- hg merge -r <revision>
- hg commit -m "Merge mozilla-inbound to mozilla-central a=merge"
- hg push -r . central
To merge mozilla-central into mozilla-inbound:
- hg pull central
- hg pull inbound
- hg up inbound
- hg merge central
- hg commit -m "Merge mozilla-central to mozilla-inbound a=merge"
- 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
Uplifts
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()'