henry pushed to branch tor-browser-140.0esr-15.0-1 at The Tor Project / Applications / Tor Browser

Commits:

2 changed files:

Changes:

  • tools/base-browser/git-rebase-fixup-preprocessor
    ... ... @@ -28,7 +28,9 @@ class TodoLine:
    28 28
         Represents a line in the git todo file.
    
    29 29
         """
    
    30 30
     
    
    31
    -    _PICK_REGEX = re.compile(r"^pick [a-f0-9]+ (?P<fixups>(fixup! )*)(?P<title>.*)")
    
    31
    +    # git 2.50 adds a '#' between the commit hash and the commit subject.
    
    32
    +    # Keep this '#' optional for previous git versions.
    
    33
    +    _PICK_REGEX = re.compile(r"^pick [a-f0-9]+ +(?:# +)?(?P<fixups>(fixup! )*)(?P<title>.*)")
    
    32 34
     
    
    33 35
         def __init__(self, line):
    
    34 36
             """
    

  • tools/base-browser/tb-dev
    ... ... @@ -152,24 +152,26 @@ def get_refs(ref_type, name_start):
    152 152
         or "head") that starts with the given 'name_start'.
    
    153 153
         """
    
    154 154
         if ref_type == "tag":
    
    155
    -        # Instead of returning tag hash, return the commit hash it points to.
    
    156
    -        fstring = "%(*objectname)"
    
    157 155
             ref_start = "refs/tags/"
    
    158 156
         elif ref_type == "remote":
    
    159
    -        fstring = "%(objectname)"
    
    160 157
             ref_start = "refs/remotes/"
    
    161 158
         elif ref_type == "head":
    
    162
    -        fstring = "%(objectname)"
    
    163 159
             ref_start = "refs/heads/"
    
    164 160
         else:
    
    165 161
             raise TypeError(f"Unknown type {ref_type}")
    
    166 162
     
    
    167
    -    fstring = f"{fstring},%(refname)"
    
    163
    +    fstring = "%(*objectname),%(objectname),%(refname)"
    
    168 164
         pattern = f"{ref_start}{name_start}**"
    
    169 165
     
    
    170 166
         def line_to_ref(line):
    
    171
    -        [commit, ref_name] = line.split(",", 1)
    
    172
    -        return Reference(ref_name.replace(ref_start, "", 1), commit)
    
    167
    +        [objectname_reference, objectname, ref_name] = line.split(",", 2)
    
    168
    +        # For annotated tags, the objectname_reference is non-empty and points
    
    169
    +        # to an actual commit.
    
    170
    +        # For remotes, heads and lightweight tags, the objectname_reference will
    
    171
    +        # be empty and objectname will point directly to the commit.
    
    172
    +        return Reference(
    
    173
    +            ref_name.replace(ref_start, "", 1), objectname_reference or objectname
    
    174
    +        )
    
    173 175
     
    
    174 176
         return [
    
    175 177
             line_to_ref(line)
    
    ... ... @@ -245,7 +247,7 @@ def file_contains(filename, regex):
    245 247
         Return whether the file is a utf-8 text file containing the regular
    
    246 248
         expression given by 'regex'.
    
    247 249
         """
    
    248
    -    with open(filename, "r", encoding="utf-8") as file:
    
    250
    +    with open(filename, encoding="utf-8") as file:
    
    249 251
             try:
    
    250 252
                 for line in file:
    
    251 253
                     if regex.search(line):