
henry pushed to branch tor-browser-140.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 02d6a786 by Henry Wilkes at 2025-07-17T14:20:24+01:00 fixup! TB 41803: Add some developer tools for working on tor-browser. TB 43954: Handle lightweight tags for FIREFOX_. - - - - - 8b9cbdf4 by Henry Wilkes at 2025-07-17T14:23:17+01:00 fixup! TB 41803: Add some developer tools for working on tor-browser. TB 43962: Update git rebase preprocessor for git 2.50. - - - - - 2 changed files: - tools/base-browser/git-rebase-fixup-preprocessor - tools/base-browser/tb-dev Changes: ===================================== tools/base-browser/git-rebase-fixup-preprocessor ===================================== @@ -28,7 +28,9 @@ class TodoLine: Represents a line in the git todo file. """ - _PICK_REGEX = re.compile(r"^pick [a-f0-9]+ (?P<fixups>(fixup! )*)(?P<title>.*)") + # git 2.50 adds a '#' between the commit hash and the commit subject. + # Keep this '#' optional for previous git versions. + _PICK_REGEX = re.compile(r"^pick [a-f0-9]+ +(?:# +)?(?P<fixups>(fixup! )*)(?P<title>.*)") def __init__(self, line): """ ===================================== tools/base-browser/tb-dev ===================================== @@ -152,24 +152,26 @@ def get_refs(ref_type, name_start): or "head") that starts with the given 'name_start'. """ if ref_type == "tag": - # Instead of returning tag hash, return the commit hash it points to. - fstring = "%(*objectname)" ref_start = "refs/tags/" elif ref_type == "remote": - fstring = "%(objectname)" ref_start = "refs/remotes/" elif ref_type == "head": - fstring = "%(objectname)" ref_start = "refs/heads/" else: raise TypeError(f"Unknown type {ref_type}") - fstring = f"{fstring},%(refname)" + fstring = "%(*objectname),%(objectname),%(refname)" pattern = f"{ref_start}{name_start}**" def line_to_ref(line): - [commit, ref_name] = line.split(",", 1) - return Reference(ref_name.replace(ref_start, "", 1), commit) + [objectname_reference, objectname, ref_name] = line.split(",", 2) + # For annotated tags, the objectname_reference is non-empty and points + # to an actual commit. + # For remotes, heads and lightweight tags, the objectname_reference will + # be empty and objectname will point directly to the commit. + return Reference( + ref_name.replace(ref_start, "", 1), objectname_reference or objectname + ) return [ line_to_ref(line) @@ -245,7 +247,7 @@ def file_contains(filename, regex): Return whether the file is a utf-8 text file containing the regular expression given by 'regex'. """ - with open(filename, "r", encoding="utf-8") as file: + with open(filename, encoding="utf-8") as file: try: for line in file: if regex.search(line): View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/b6c948e... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/b6c948e... You're receiving this email because of your account on gitlab.torproject.org.
participants (1)
-
henry (@henry)