@@ -104,9 +104,9 @@ def get_revision_file(self, location: str) -> int:
104
104
"""Return revision for a file."""
105
105
current_rev = self .cmd .info (location )
106
106
107
- _INI_RE = re .compile (r"^([^:]+):\s+(\S.*)$" , re .MULTILINE )
107
+ INI_RE = re .compile (r"^([^:]+):\s+(\S.*)$" , re .MULTILINE )
108
108
109
- info_list = _INI_RE .findall (current_rev )
109
+ info_list = INI_RE .findall (current_rev )
110
110
return int (dict (info_list )["Revision" ])
111
111
112
112
def get_revision (self , location : Optional [str ] = None ) -> int :
@@ -165,10 +165,10 @@ def update_repo(
165
165
166
166
@classmethod
167
167
def _get_svn_url_rev (cls , location : str ) -> tuple [Optional [str ], int ]:
168
- _svn_xml_url_re = re .compile ('url="([^"]+)"' )
169
- _svn_rev_re = re .compile (r'committed-rev="(\d+)"' )
170
- _svn_info_xml_rev_re = re .compile (r'\s*revision="(\d+)"' )
171
- _svn_info_xml_url_re = re .compile (r"<url>(.*)</url>" )
168
+ svn_xml_url_re = re .compile (r 'url="([^"]+)"' )
169
+ svn_rev_re = re .compile (r'committed-rev="(\d+)"' )
170
+ svn_info_xml_rev_re = re .compile (r'\s*revision="(\d+)"' )
171
+ svn_info_xml_url_re = re .compile (r"<url>(.*)</url>" )
172
172
173
173
entries_path = pathlib .Path (location ) / ".svn" / "entries"
174
174
if entries_path .exists ():
@@ -184,11 +184,11 @@ def _get_svn_url_rev(cls, location: str) -> tuple[Optional[str], int]:
184
184
url = entries [0 ][3 ]
185
185
revs = [int (d [9 ]) for d in entries if len (d ) > 9 and d [9 ]] + [0 ]
186
186
elif data .startswith ("<?xml" ):
187
- match = _svn_xml_url_re .search (data )
187
+ match = svn_xml_url_re .search (data )
188
188
if not match :
189
189
raise SvnUrlRevFormattingError (data = data )
190
190
url = match .group (1 ) # get repository URL
191
- revs = [int (m .group (1 )) for m in _svn_rev_re .finditer (data )] + [0 ]
191
+ revs = [int (m .group (1 )) for m in svn_rev_re .finditer (data )] + [0 ]
192
192
else :
193
193
try :
194
194
# Note that using get_remote_call_options is not necessary here
@@ -200,10 +200,10 @@ def _get_svn_url_rev(cls, location: str) -> tuple[Optional[str], int]:
200
200
target = pathlib .Path (location ),
201
201
xml = True ,
202
202
)
203
- match = _svn_info_xml_url_re .search (xml )
203
+ match = svn_info_xml_url_re .search (xml )
204
204
assert match is not None
205
205
url = match .group (1 )
206
- revs = [int (m .group (1 )) for m in _svn_info_xml_rev_re .finditer (xml )]
206
+ revs = [int (m .group (1 )) for m in svn_info_xml_rev_re .finditer (xml )]
207
207
except Exception :
208
208
url , revs = None , []
209
209
0 commit comments