Sheriffing/How To/Unified Repos: Difference between revisions

drop references to mozilla-inbound repository
m (add missing *)
(drop references to mozilla-inbound repository)
Line 18: Line 18:


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 autoland && hg pull beta && hg pull release && hg pull esr52
* hg pull autoland && hg pull beta && hg pull release && hg pull esr52
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].


Line 29: Line 29:
To pull in newly landed changes, you can use one of the following commands:
To pull in newly landed changes, you can use one of the following commands:
* hg pull fxtrees # this will pull from all branches listed with the fxheads command
* hg pull fxtrees # this will pull from all branches listed with the fxheads command
* hg pull integration # this will pull from the mozilla-inbound and autoland branches
* hg pull treename # this will pull only from the tree with the name "treename"
* hg pull releases # this will pull from pretty much every release branch (FYI: including old, unused branches)


== Merges ==
== Merges ==
This assumes you have your unified repo all set up so that `hg fxheads` lists each of central, autoland, and inbound.
This assumes you have your unified repo all set up so that `hg fxheads` lists each of central and autoland.


To merge a specific non-tip <revision> from mozilla-inbound to mozilla-central:
To merge a specific non-tip <revision> from autoland to mozilla-central:
# hg pull central
# hg pull central
# hg pull inbound
# hg up central
# hg up central
# hg merge -r <revision>
# hg merge -r <revision>
# hg commit -m "Merge mozilla-inbound to mozilla-central a=merge"
# hg commit -m "Merge autoland to mozilla-central a=merge"
# hg push -r . central
# hg push -r . central


To merge mozilla-central into mozilla-inbound:
To merge mozilla-central into autoland:
# hg pull central
# hg pull central
# hg pull inbound
# hg pull autoland
# hg up inbound
# hg up autoand
# hg merge central
# hg merge central
# hg commit -m "Merge mozilla-central to mozilla-inbound a=merge"
# hg commit -m "Merge mozilla-central to autoland. CLOSED TREE"
# hg push -r . inbound
# hg push -r . autoland


* 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.
* 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 . autoland` to push it as usual.
 
== Checkin-neededs ==
This assumes we're checking things in to autoland. Replace autoland with another branch name as needed.
 
==== Single repository and single set of patches ====
Update autoland and prepare for the patches:
* hg pull autoland
* hg up autoland
* hg bookmark autoland-checkins
Import the patches:
* hg import https://link.to/correct/checkin-needed.patch
* Repeat ^ as needed for all autoland checkin-needed patches
Verify your outgoing changes:
* hg out -r . autoland
If you haven't lost a push race:
* hg push -r . autoland
If you lost a push race:
* hg pull autoland
* hg rebase -d autoland
* hg push -r . autoland
Delete your no longer needed bookmark:
* hg bookmark -d autoland-checkins
 
==== Multiple repositories with a single set of patches each ====
You can set up multiple sets of patches at once against multiple repositories:
Update autoland
* hg pull autoland && hg up autoland
Create a bookmark to base your autoland checkin-needed patches
* hg bookmark autoland-checkins
Import a bunch of patches against autoland
* hg import <patch1>
* hg import <patch2>
Update inbound and make a bookmark for inbound patches
* hg pull inbound && hg up inbound && hg bookmark inbound-checkins
Import some patches against inbound
* hg import <patch3>
* hg import <patch4>
See what you'd be pushing to inbound and push it
* hg out -r . inbound # this will only show patch3 and patch4
* hg push -r . inbound # this only pushes patch3 and patch4
* hg bookmark -d inbound-checkins # delete inbound's checkin bookmark as it's not needed
Go back to your autoland checkins and add another patch to the bookmark, then push it
* hg up autoland-checkins
* hg import <patch5>
* hg out -r . autoland # this will be patch1, patch2, and patch5
* hg push -r . autoland
* hg bookmark -d autoland-checkins
 
==== Single repository with multiple sets of patches ====
Or have multiple sets of patches against a single repository:
Update autoland
* hg pull autoland && hg up autoland
Make the first bookmark/set
* hg bookmark autoland-checkins-1
* hg import <patch1>
* hg import <patch2>
Make the second set
* hg up autoland && hg bookmark autoland-checkins-2
* hg import <patch3>
* hg import <patch4>
See what's going to be pushed in each
* hg out -r . autoland # patch3 and patch4
* hg up autoland-checkins-1 && hg out -r . autoland # patch1 and patch2
Push the first set
* hg push -r . autoland # pushes patch1 and patch2
Get ready to push the second set
* hg up autoland-checkins-2
* hg rebase -d autoland # Rebase the second set onto the now-pushed first set
And push it
* hg push -r . autoland # pushes patch3 and patch4
Delete the now-unneeded bookmarks
* hg bookmark -d autoland-checkins-1
* hg bookmark -d autoland-checkins-2


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


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


Pull and update to prepare for the uplifts:
Pull and update to prepare for the uplifts:
Line 177: Line 102:


== Rebasing after losing a push race ==
== 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.
This assumes you have commits you're attempting to push to autoland when you lose a push race with someone. Change `autoland` to the correct branch name as needed.


* hg pull inbound
* hg pull autoland
* hg rebase -d inbound
* hg rebase -d autoland
* hg push -r . inbound
* hg push -r . autoland


== Recovering from mistakes ==
== Recovering from mistakes ==
Line 194: Line 119:
You may also need to use some combination of the following to get things back to a known-good state:
You may also need to use some combination of the following to get things back to a known-good state:
* hg purge # http://mercurial.selenic.com/wiki/PurgeExtension
* hg purge # http://mercurial.selenic.com/wiki/PurgeExtension
* hg up -C
* hg up -C .


== See what you're about to push ==
== See what you're about to push ==
`hg out` without any flags added will show you a LOT of unrelated commits. To see just what you'll be pushing to a given branch, use `hg out -r . <branch>`
`hg out` without any flags added will show you a LOT of unrelated commits. To see just what you'll be pushing to a given branch, use `hg out -r . <branch>`
* hg out -r . inbound
* hg out -r . autoland
** This will only display the things you're about to push to the inbound branch
** This will only display the things you're about to push to the autoland branch


== View incoming changes ==
== View incoming changes ==
Line 232: Line 157:
  hg mergetointegration autoland
  hg mergetointegration autoland
This cuts down on a lot of repetitive typing, saving a bit of time.
This cuts down on a lot of repetitive typing, saving a bit of time.
=== rbimport ===
For merging from reviewboard patches, there's this alias
  rbimport = !hg transplant -e -s https://reviewboard-hg.mozilla.org/gecko -b $1
Then, it's matter of importing the right hash like the following command:
  hg rbimport dd1462ba321db983061b94e30cee92b6bd81e908
Confirmed users
599

edits