comparison hgext/lfs/__init__.py @ 43506:9f70512ae2cf

cleanup: remove pointless r-prefixes on single-quoted strings This is the promised second step on single-quoted strings. 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 -- \[\^b\]\[\^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/D7306
author Augie Fackler <augie@google.com>
date Fri, 08 Nov 2019 11:19:20 -0800
parents 26caf96a5fa9
children 34e8305f02bd
comparison
equal deleted inserted replaced
43505:47fac1692ede 43506:9f70512ae2cf
239 239
240 def checkrequireslfs(ui, repo, **kwargs): 240 def checkrequireslfs(ui, repo, **kwargs):
241 if b'lfs' in repo.requirements: 241 if b'lfs' in repo.requirements:
242 return 0 242 return 0
243 243
244 last = kwargs.get(r'node_last') 244 last = kwargs.get('node_last')
245 _bin = node.bin 245 _bin = node.bin
246 if last: 246 if last:
247 s = repo.set(b'%n:%n', _bin(kwargs[r'node']), _bin(last)) 247 s = repo.set(b'%n:%n', _bin(kwargs['node']), _bin(last))
248 else: 248 else:
249 s = repo.set(b'%n', _bin(kwargs[r'node'])) 249 s = repo.set(b'%n', _bin(kwargs['node']))
250 match = repo._storenarrowmatch 250 match = repo._storenarrowmatch
251 for ctx in s: 251 for ctx in s:
252 # TODO: is there a way to just walk the files in the commit? 252 # TODO: is there a way to just walk the files in the commit?
253 if any( 253 if any(
254 ctx[f].islfs() for f in ctx.files() if f in ctx and match(f) 254 ctx[f].islfs() for f in ctx.files() if f in ctx and match(f)
397 b'debuglfsupload', 397 b'debuglfsupload',
398 [(b'r', b'rev', [], _(b'upload large files introduced by REV'))], 398 [(b'r', b'rev', [], _(b'upload large files introduced by REV'))],
399 ) 399 )
400 def debuglfsupload(ui, repo, **opts): 400 def debuglfsupload(ui, repo, **opts):
401 """upload lfs blobs added by the working copy parent or given revisions""" 401 """upload lfs blobs added by the working copy parent or given revisions"""
402 revs = opts.get(r'rev', []) 402 revs = opts.get('rev', [])
403 pointers = wrapper.extractpointers(repo, scmutil.revrange(repo, revs)) 403 pointers = wrapper.extractpointers(repo, scmutil.revrange(repo, revs))
404 wrapper.uploadblobs(repo, pointers) 404 wrapper.uploadblobs(repo, pointers)