Sheriffing/How To/Unified Repos: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Partial cleanup/update)
No edit summary
Line 1: Line 1:
== Unified Repos ==
{{Sheriffing How To|Unified repos}}
= Unified Repos =
* http://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/unifiedrepo.html
* http://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/unifiedrepo.html
* https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/firefoxtree.html
* https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/firefoxtree.html


=== Setting up the repo ===
== Setting up the repo ==
* Set up your ssh key yourself
* Set up your ssh key yourself
* Install [https://www.mercurial-scm.org/downloads Mercurial 4.2] or higher
* Install [https://www.mercurial-scm.org/downloads Mercurial 4.2] or higher
Line 31: Line 32:
* hg pull releases # this will pull from pretty much every release branch (FYI: including old, unused branches)
* 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, autoland, and inbound.


Line 52: Line 53:
* 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 . inbound` to push it as usual.


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


===== Single repository and single set of patches =====
==== Single repository and single set of patches ====
Update fx-team and prepare for the patches:
Update fx-team and prepare for the patches:
* hg pull fx-team
* hg pull fx-team
Line 74: Line 75:
* hg bookmark -d fx-team-checkins
* hg bookmark -d fx-team-checkins


===== Multiple repositories with a single set of patches each =====
==== Multiple repositories with a single set of patches each ====
You can set up multiple sets of patches at once against multiple repositories:
You can set up multiple sets of patches at once against multiple repositories:
Update fx-team
Update fx-team
Line 99: Line 100:
* hg bookmark -d fxteam-checkins
* hg bookmark -d fxteam-checkins


===== Single repository with multiple sets of patches =====
==== Single repository with multiple sets of patches ====
Or have multiple sets of patches against a single repository:
Or have multiple sets of patches against a single repository:
Update fx-team
Update fx-team
Line 125: Line 126:
* hg bookmark -d fxteam-checkins-2
* hg bookmark -d fxteam-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 the checkin-needed instructions above, importing the patches onto the release branch.


Line 146: Line 147:
Read the documentation for [https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/unifiedrepo.html#uplifting-backporting-commits graft] for further help.
Read the documentation for [https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/unifiedrepo.html#uplifting-backporting-commits graft] for further help.


=== Backouts ===
== Backouts ==
Better tools are coming:
Better tools are coming:
* https://bugzilla.mozilla.org/show_bug.cgi?id=1117632
* https://bugzilla.mozilla.org/show_bug.cgi?id=1117632
Line 172: Line 173:
(Omit oops's -s flag to back out each individual revision in the range as a separate commit.)
(Omit oops's -s flag to back out each individual revision in the range as a separate commit.)


==== Revert a backout ====
=== Revert a backout ===
* `hg graft`, see https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/common.html#revive-a-commit-that-was-backed-out
* `hg graft`, see https://mozilla-version-control-tools.readthedocs.org/en/latest/hgmozilla/common.html#revive-a-commit-that-was-backed-out


=== 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 mozilla-inbound when you lose a push race with someone. Change `inbound` to the correct branch name as needed.


Line 182: Line 183:
* hg push -r . inbound
* hg push -r . inbound


=== Recovering from mistakes ===
== Recovering from mistakes ==
<big>WARNING:</big> 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!
<big>WARNING:</big> 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()'
* hg strip 'not public()'
Line 190: Line 191:
* 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 . inbound
** 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 inbound branch


=== View incoming changes ===
== View incoming changes ==
Since your unified repo will likely have all changesets from the various branches pulled locally, `hg in <somebranch> -r <somerev>` will likely not help you see what would be pulled into your current branch from <somebranch> up to that <somerev>.
Since your unified repo will likely have all changesets from the various branches pulled locally, `hg in <somebranch> -r <somerev>` will likely not help you see what would be pulled into your current branch from <somebranch> up to that <somerev>.
Instead, you can use the following to print out the equivalent. Say you want to see what would be merged onto mozilla-central from b2g-inbound's revision ca142ec8ba0f:
Instead, you can use the following to print out the equivalent. Say you want to see what would be merged onto mozilla-central from b2g-inbound's revision ca142ec8ba0f:
Line 208: Line 209:
This will print out everything on b2g-inbound (up to and including revision ca142ec8ba0f) that is not already on mozilla-central.
This will print out everything on b2g-inbound (up to and including revision ca142ec8ba0f) that is not already on mozilla-central.


=== See the log for a particular branch ===
== See the log for a particular branch ==
* hg log -fr [branch]
* hg log -fr [branch]


canmove, Confirmed users
2,850

edits

Navigation menu