Rebase Tor Browser and Base Browser stable to 102.12esr
NOTE: All examples reference the rebase from 102.7.0esr to 102.8.0esr
Explanation of variables
- `$(ESR_VERSION)` : the Mozilla defined ESR version, used in various places for building tor-browser tags, labels, etc - example : `102.8.0` - `(ESR_TAG)` : the Mozilla defined hg (Mercurial) tag associated with `(ESR_VERSION)`
  - example : `FIREFOX_102_8_0esr_RELEASE`
- `$(ESR_TAG_PREV)` : the Mozilla defined hg (Mercurial) tag associated with the previous ESR version when rebasing (ie, the ESR version we are rebasing from)
- `$(BROWSER_MAJOR)` : the browser major version
  - example : `12`
- `$(BROWSER_MINOR)` : the browser minor version
  - example : either `0` or `5`; Alpha's is always `(Stable + 5) % 10`
- `$(BASE_BROWSER_BRANCH)` : the full name of the current `base-browser` branch
  - example: `base-browser-102.8.0esr-12.0-1`
- `$(BASE_BROWSER_BRANCH_PREV)` : the full name of the previous `base-browser` branch
  - example: `base-browser-102.7.0esr-12.0-1`
- `$(TOR_BROWSER_BRANCH)` : the full name of the current `tor-browser` branch
  - example: `tor-browser-102.8.0esr-12.0-1`
- `$(TOR_BROWSER_BRANCH_PREV)` : the full name of the previous `tor-browser` branch
  - example: `tor-browser-102.7.0esr-12.0-1`
Bookkeeping
- 
Link this issue to the appropriate Release Prep issue. 
Update Branch Protection Rules
- 
In Repository Settings: - 
Remove previous stable base-browserandtor-browserbranch protection rules (this will prevent pushing new changes to the branches being rebased)
- 
Create new base-browserandtor-browserbranch protection rule:- 
Branch: *-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1*- example: *-102.8.0esr-12.0-1*
 
- example: 
- 
Allowed to merge: Maintainers
- 
Allowed to push and merge: Maintainers
- 
Allowed to force push: false
 
- 
Branch: 
 
- 
Identify the Firefox Tagged Commit and Create New Branches
- 
Find the Firefox mercurial tag here : https://hg.mozilla.org/releases/mozilla-esr102/tags - example: FIREFOX_102_8_0esr_BUILD1
 
- example: 
- 
Find the analogous gecko-devcommit : https://github.com/mozilla/gecko-dev- Search for unique string found in the mercurial commit in the gecko-dev/esr102branch
- example: 3a3a96c9
 
- Search for unique string found in the mercurial commit in the 
- 
Sign and Tag gecko-devcommit- Sign/Tag gecko-devcommit :- Tag : $(ESR_TAG)
- Message : Hg tag $(ESR_TAG)
 
- Tag : 
 
- Sign/Tag 
- 
Create new stable base-browserbranch from tag- branch name in the form: base-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1
- example: base-browser-102.8.0esr-12.0-1
 
- branch name in the form: 
- 
Create new stable tor-browserbranch from- branch name in the form: tor-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1
- example: tor-browser-102.8.0esr-12.0-1
 
- branch name in the form: 
- 
Push new base-browserbranch toorigin
- 
Push new tor-browserbranch toorigin
- 
Push new $(ESR_TAG)toorigin
Rebase base-browser
- 
Checkout a new local branch for the base-browserrebase- example: git branch base-browser-rebase FIREFOX_102_8_0esr_BUILD1
 
- example: 
- 
Cherry-pick the previous base-browsercommits up tobase-browser'sbuild1tag onto newbase-browserrebase branch- example: git cherry-pick FIREFOX_102_7_0esr_BUILD1..base-browser-102.7.0esr-12.0-1-build1
 
- example: 
- 
Rebase and autosquash these cherry-picked commits - example: git rebase --autosquash --interactive FIREFOX_102_8_0esr_BUILD1 HEAD
 
- example: 
- 
Cherry-pick remainder of patches after the build1tag- example: git cherry-pick base-browser-102.7.0esr-12.0-1-build1 origin/base-browser-102.7.0esr-12.0-1
 
- example: 
- 
Compare patch sets to ensure nothing weird happened during conflict resolution: - 
diff of diffs: - Do the diff between current_patchset.diffandrebased_patchset.diffwith your preferred difftool and look at differences on lines that starts with + or -
- git diff $(ESR_TAG_PREV)..$(BASE_BROWSER_BRANCH_PREV) > current_patchset.diff
- git diff $(ESR_TAG)..$(BASE_BROWSER_BRANCH) > rebased_patchset.diff
- diff current_patchset.diffandrebased_patchset.diff- If everything went correctly, the only lines which should differ should be the lines starting with index abc123...def456
 
- If everything went correctly, the only lines which should differ should be the lines starting with 
 
- Do the diff between 
- 
rangediff: git range-diff $(ESR_TAG_PREV)..$(BASE_BROWSER_BRANCH_PREV) $(ESR_TAG)..HEAD- example: git range-dif FIREFOX_102_7_0esr_BUILD1..origin/base-browser-102.7.0esr-12.0-1 FIREFOX_102_8_0esr_BUILD1..HEAD
 
- example: 
 
- 
- 
Open MR for the base-browserrebase
- 
Merge 
- 
Sign/Tag HEAD of the merged new base-browserbranch:- Tag : base-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1-build1
- Message : Tagging build1 for $(ESR_VERSION)esr-based stable
 
- Tag : 
- 
Push tag to origin
Rebase tor-browser
- 
Checkout a new branch for the tor-browserrebase starting from thebase-browserbuild1tag- example: git branch tor-browser-rebase base-browser-102.8.0esr-12.0-1-build1
 
- example: 
- 
Cherry-pick the previous tor-browsercommits frombase-browser's previousbuild1tag up totor-browser's newestbuildNtag (not necessarilybuild1if we have multiple build tags)- example: git cherry-pick base-browser-102.7.0esr-12.0-1-build1..tor-browser-102.7.0esr-12.0-1-build1
 
- example: 
- 
Rebase and autosquash these cherry-picked commits (from the last new base-browsercommit toHEAD)- example: git rebase --autosquash --interactive base-browser-102.8.0esr-12.0-1-build1 HEAD
 
- example: 
- 
Cherry-pick remainder of patches after the last buildNtag- example: git cherry-pick base-browser-102.7.0esr-12.0-1-build1..origin/tor-browser-102.7.0esr-12.0-1
 
- example: 
- 
Compare patch sets to ensure nothing weird happened during conflict resolution: - 
diff of diffs: - Do the diff between current_patchset.diffandrebased_patchset.diffwith your preferred difftool and look at differences on lines that starts with + or -
- git diff $(ESR_TAG_PREV)..$(BROWSER_BRANCH_PREV) > current_patchset.diff
- git diff $(ESR_TAG)..$(BROWSER_BRANCH) > rebased_patchset.diff
- diff current_patchset.diffandrebased_patchset.diff- If everything went correctly, the only lines which should differ should be the lines starting with index abc123...def456(unless the previousbase-browserbranch includes changes not included in the previoustor-browserbranch)
 
- If everything went correctly, the only lines which should differ should be the lines starting with 
 
- Do the diff between 
- 
rangediff: git range-diff $(ESR_TAG_PREV)..$(TOR_BROWSER_BRANCH_PREV) $(ESR_TAG)..HEAD- example: git range-dif FIREFOX_102_7_0esr_BUILD1..origin/tor-browser-102.7.0esr-12.0-1 FIREFOX_102_8_0esr_BUILD1..HEAD
 
- example: 
 
- 
- 
Open MR for the tor-browserrebase
- 
Merge 
- 
Sign/Tag HEAD of the merged new tor-browserbranch:- Tag : tor-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1-build1
- Message : Tagging build1 for $(ESR_VERSION)esr-based stable
 
- Tag : 
- 
Push tag to origin
Edited  by morgan