Rebase Tor Browser legacy onto 115.20.0esr
NOTE: All examples in this template reference the rebase from 115.17.0esr to 115.18.0esr
Explanation of Variables
- 
$(ESR_VERSION): the Mozilla defined ESR version, used in various places for building tor-browser tags, labels, etc- 
Example: 
115.18.0 
 - 
Example: 
 - 
$(ESR_TAG): the Mozilla defined hg (Mercurial) tag associated with$(ESR_VERSION)- 
Example: 
FIREFOX_115_18_0esr_BUILD1 
 - 
Example: 
 - 
$(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)- 
Example: 
FIREFOX_115_17_0esr_BUILD1 
 - 
Example: 
 - 
$(BASE_BROWSER_BRANCH): the full name of the currentbase-browserbranch- 
Example: 
base-browser-115.18.0esr-13.5-1 
 - 
Example: 
 - 
$(BASE_BROWSER_BRANCH_PREV): the full name of the previousbase-browserbranch- 
Example: 
base-browser-115.17.0esr-13.5-1 
 - 
Example: 
 - 
$(TOR_BROWSER_BRANCH): the full name of the currenttor-browserbranch- 
Example: 
tor-browser-115.18.0esr-13.5-1 
 - 
Example: 
 - 
$(TOR_BROWSER_BRANCH_PREV): the full name of the previoustor-browserbranch- 
Example: 
tor-browser-115.17.0esr-13.5-1 
 - 
Example: 
 
Bookkeeping
- 
Link this issue to the appropriate Release Prep issue.  
Update Branch Protection Rules
- 
In Repository Settings: - 
Remove previous legacy 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-13.5-1*- 
Example: 
*-115.18.0esr-13.5-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_115_18_0esr_BUILD1 
 - 
Example: 
 - 
Find the analogous gecko-devcommit: https://github.com/mozilla/gecko-dev- 
Tip: Search for unique string (like the Differential Revision ID) found in the mercurial commit in the 
gecko-dev/esr115branch to find the equivalent commit - 
Example: 
293d490d2e8d9fbb91c76336288f1287cbe285fb 
 - 
Tip: Search for unique string (like the Differential Revision ID) 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 legacy base-browserbranch from tag- Branch name in the form: 
base-browser-$(ESR_VERSION)esr-13.5-1 - 
Example: 
base-browser-115.18.0esr-13.5-1 
 - Branch name in the form: 
 - 
Create new legacy tor-browserbranch from- Branch name in the form: 
tor-browser-$(ESR_VERSION)esr-13.5-1 - 
Example: 
tor-browser-115.18.0esr-13.5-1 
 - Branch name in the form: 
 - 
Push new base-browserbranch toupstream - 
Push new tor-browserbranch toupstream - 
Push new $(ESR_TAG)toupstream 
Rebase tor-browser
- 
Checkout a new local branch for the tor-browserrebase- 
Example: 
git branch tor-browser-rebase FIREFOX_115_18_0esr_BUILD1 
 - 
Example: 
 - 
(Optional) base-browserrebase- 
NOTE This step may be skipped if the 
HEADof the previousbase-browserbranch is a-buildNtag - 
Cherry-pick the previous base-browsercommits up tobase-browser'sbuildNtag onto newbase-browserrebase branch- 
Example: 
git cherry-pick FIREFOX_115_17_0esr_BUILD1..base-browser-115.17.0esr-13.5-1-build2 
 - 
Example: 
 - 
Rebase and autosquash these cherry-picked commits - 
Example: 
git rebase --autosquash --interactive FIREFOX_115_18_0esr_BUILD1 HEAD 
 - 
Example: 
 - 
Cherry-pick remainder of patches after the buildNtag- 
Example: 
git cherry-pick base-browser-115.17.0esr-13.5-1-build21..upstream/base-browser-115.17.0esr-13.5-1 
 - 
Example: 
 
 - 
NOTE This step may be skipped if the 
 - 
tor-browserrebase- 
Note the current git hash of HEADfortor-browserrebase+autosquash step:git rev-parse HEAD - 
Cherry-pick the appropriate previous tor-browserbranch's commit range up to the lasttor-browserbuildNtag- Example: `git cherry-pick base-browser-115.17.0esr-13.5-1-build1..tor-browser-115.17.0esr-13.5-1-build2
 - 
Example (if separate base-browser rebase was skipped): 
git cherry-pick FIREFOX_115_17_0esr_BUILD1..tor-browser-115.17.0esr-13.5-1-build2 
 - 
Rebase and autosquash these newly cherry-picked commits: git rebase --autosquash --interactive $(PREV_HEAD)- 
Example: 
git rebase --autosquash --interactive FIREFOX_115_18_0esr_BUILD1 
 - 
Example: 
 - 
Cherry-pick remainder of patches after the last tor-browserbuildNtag- 
Example: 
git cherry-pick tor-browser-115.17.0esr-13.5-1-build1..upstream/tor-browser-115.17.0esr-13.5-1 
 - 
Example: 
 - 
Rebase and autosquash again, this time replacing all fixupandsquashcommands withpick. The goal here is to have all of thefixupandsquashcommits beside the commit which they modify, but kept un-squashed for easy debugging/bisecting.- 
Example: 
git rebase --autosquash --interactive FIREFOX_115_18_0esr_BUILD1 
 - 
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.diffgit 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_115_17_0esr_BUILD1..upstream/tor-browser-115.17.0esr-13.5-1 FIREFOX_115_18_0esr_BUILD1..HEAD 
 - 
Example: 
 
 - 
 - 
Open MR for the tor-browserrebase - 
Merge  - Update and push 
base-browserbranch- 
Reset the new base-browserbranch to the appropriate commit in this newtor-browserbranch - 
Push these commits to upstream 
 - 
 
Sign and Tag
- 
Sign/Tag HEADof the mergedtor-browserbranch:- In tor-browser.git, checkout the new legacy 
tor-browserbranch - In tor-browser-build.git, run signing script:
./tools/browser/sign-tag.torbrowser legacy build1 - 
Push tag to upstream 
 - In tor-browser.git, checkout the new legacy 
 - 
Sign/Tag HEAD of the merged base-browserbranch:- In tor-browser.git, checkout the new legacy 
base-browserbranch - In tor-browser-build.git, run signing script:
./tools/browser/sign-tag.basebrowser legacy build1 - 
Push tag to upstream 
 - In tor-browser.git, checkout the new legacy