comparison hgext/lfs/wireprotolfsserver.py @ 43503:313e3a279828

cleanup: remove pointless r-prefixes on double-quoted strings This is only double-quoted strings. I'll do single-quoted strings as a second step. These had existed because our source transformer didn't turn r"" into b"", so we had tagged some strings as r-strings to get "native" strings on both Pythons. Now that the transformer is gone, we can dispense with this nonsense. Methodology: I ran hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$' | xargs egrep --color=never -n -- \[\^a-z\]r\"\[\^\"\\\\\]\*\"\[\^\"\] in an emacs grep-mode buffer, and then used a keyboard macro to iterate over the results and remove the r prefix as needed. # skip-blame removing unneeded r prefixes left over from Python 3 migration. Differential Revision: https://phab.mercurial-scm.org/D7305
author Augie Fackler <augie@google.com>
date Thu, 07 Nov 2019 13:18:19 -0500
parents 579672b347d2
children 9f70512ae2cf
comparison
equal deleted inserted replaced
43502:c093cc6e6c99 43503:313e3a279828
247 # IFF they already exist locally. 247 # IFF they already exist locally.
248 if action == b'download': 248 if action == b'download':
249 if not exists: 249 if not exists:
250 rsp[r'error'] = { 250 rsp[r'error'] = {
251 r'code': 404, 251 r'code': 404,
252 r'message': r"The object does not exist", 252 r'message': "The object does not exist",
253 } 253 }
254 yield rsp 254 yield rsp
255 continue 255 continue
256 256
257 elif not verifies: 257 elif not verifies:
258 rsp[r'error'] = { 258 rsp[r'error'] = {
259 r'code': 422, # XXX: is this the right code? 259 r'code': 422, # XXX: is this the right code?
260 r'message': r"The object is corrupt", 260 r'message': "The object is corrupt",
261 } 261 }
262 yield rsp 262 yield rsp
263 continue 263 continue
264 264
265 elif verifies: 265 elif verifies:
285 % pycompat.strurl(action): { 285 % pycompat.strurl(action): {
286 r'href': pycompat.strurl( 286 r'href': pycompat.strurl(
287 b'%s%s/.hg/lfs/objects/%s' % (req.baseurl, req.apppath, oid) 287 b'%s%s/.hg/lfs/objects/%s' % (req.baseurl, req.apppath, oid)
288 ), 288 ),
289 # datetime.isoformat() doesn't include the 'Z' suffix 289 # datetime.isoformat() doesn't include the 'Z' suffix
290 r"expires_at": expiresat.strftime(r'%Y-%m-%dT%H:%M:%SZ'), 290 "expires_at": expiresat.strftime(r'%Y-%m-%dT%H:%M:%SZ'),
291 r'header': _buildheader(), 291 r'header': _buildheader(),
292 } 292 }
293 } 293 }
294 294
295 yield rsp 295 yield rsp