tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 0e1ce855ea779565bb6471186c9ce4b3074dbc99
parent b490ed5cdf73ff778dd201636dfb3793fff8b351
Author: Michael Froman <mfroman@mozilla.com>
Date:   Fri, 19 Dec 2025 18:35:39 +0000

Bug 2006946 - standardize usage of detect_repo_type across libwebrtc update python scripts. r=dbaker DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D277033

Diffstat:
Mdom/media/webrtc/third_party_build/restore_patch_stack.py | 14++++++++------
Mdom/media/webrtc/third_party_build/save_patch_stack.py | 5++---
Mdom/media/webrtc/third_party_build/vendor_and_commit.py | 5++---
Mdom/media/webrtc/third_party_build/write_default_config.py | 4++--
4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/dom/media/webrtc/third_party_build/restore_patch_stack.py b/dom/media/webrtc/third_party_build/restore_patch_stack.py @@ -10,6 +10,7 @@ from pathlib import Path from fetch_github_repo import fetch_repo from run_operations import ( + RepoType, check_repo_status, detect_repo_type, get_last_line, @@ -17,6 +18,8 @@ from run_operations import ( run_shell, ) +repo_type = detect_repo_type() + # This script restores the mozilla patch stack and no-op commit tracking # files. In the case of repo corruption or a mistake made during # various rebase conflict resolution operations, the patch-stack can be @@ -31,12 +34,6 @@ def restore_patch_stack( state_directory, tar_name, ): - # first, check which repo we're in, git or hg - repo_type = detect_repo_type() - if repo_type is None: - print("Unable to detect repo (git or hg)") - sys.exit(1) - # make sure the repo is clean before beginning stdout_lines = check_repo_status(repo_type) if len(stdout_lines) != 0: @@ -100,6 +97,11 @@ def restore_patch_stack( if __name__ == "__main__": + # first, check which repo we're in, git or hg + if repo_type is None or not isinstance(repo_type, RepoType): + print("Unable to detect repo (git or hg)") + sys.exit(1) + default_patch_dir = "third_party/libwebrtc/moz-patch-stack" default_state_dir = ".moz-fast-forward" default_tar_name = "moz-libwebrtc.tar.gz" diff --git a/dom/media/webrtc/third_party_build/save_patch_stack.py b/dom/media/webrtc/third_party_build/save_patch_stack.py @@ -29,7 +29,7 @@ script_name = os.path.basename(__file__) error_help = ErrorHelp() error_help.set_prefix(f"*** ERROR *** {script_name} did not complete successfully") -repo_type = None +repo_type = detect_repo_type() @atexit.register @@ -290,8 +290,7 @@ def verify_git_repo_configuration(): if __name__ == "__main__": # first, check which repo we're in, git or hg - repo_type = detect_repo_type() - if repo_type is None: + if repo_type is None or not isinstance(repo_type, RepoType): error_help.set_help("Unable to detect repo (git or hg)") sys.exit(1) diff --git a/dom/media/webrtc/third_party_build/vendor_and_commit.py b/dom/media/webrtc/third_party_build/vendor_and_commit.py @@ -28,7 +28,7 @@ error_help.set_prefix(f"*** ERROR *** {script_name} did not complete successfull error_help.set_postfix( f"Please resolve the error and then continue running {script_name}" ) -repo_type = None +repo_type = detect_repo_type() def early_exit_handler(): @@ -284,8 +284,7 @@ def vendor_and_commit( if __name__ == "__main__": # first, check which repo we're in, git or hg - repo_type = detect_repo_type() - if repo_type is None: + if repo_type is None or not isinstance(repo_type, RepoType): error_help.set_help("Unable to detect repo (git or hg)") sys.exit(1) diff --git a/dom/media/webrtc/third_party_build/write_default_config.py b/dom/media/webrtc/third_party_build/write_default_config.py @@ -13,6 +13,7 @@ sys.path.insert(0, "./dom/media/webrtc/third_party_build") import lookup_branch_head script_name = os.path.basename(__file__) +repo_type = detect_repo_type() text = """#!/bin/bash @@ -148,8 +149,7 @@ def build_default_config_env( if __name__ == "__main__": # first, check which repo we're in, git or hg - repo_type = detect_repo_type() - if repo_type is None: + if repo_type is None or not isinstance(repo_type, RepoType): print("Unable to detect repo (git or hg)") sys.exit(1)