comparison mercurial/bundlerepo.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 8ff1ecfadcd1
children 642433629e20
comparison
equal deleted inserted replaced
43505:47fac1692ede 43506:9f70512ae2cf
329 """Write a temporary file to disk 329 """Write a temporary file to disk
330 """ 330 """
331 fdtemp, temp = self.vfs.mkstemp(prefix=b"hg-bundle-", suffix=suffix) 331 fdtemp, temp = self.vfs.mkstemp(prefix=b"hg-bundle-", suffix=suffix)
332 self.tempfile = temp 332 self.tempfile = temp
333 333
334 with os.fdopen(fdtemp, r'wb') as fptemp: 334 with os.fdopen(fdtemp, 'wb') as fptemp:
335 fptemp.write(header) 335 fptemp.write(header)
336 while True: 336 while True:
337 chunk = readfn(2 ** 18) 337 chunk = readfn(2 ** 18)
338 if not chunk: 338 if not chunk:
339 break 339 break
391 391
392 # If filestart was not set by self.manifestlog, that means the 392 # If filestart was not set by self.manifestlog, that means the
393 # manifestlog implementation did not consume the manifests from the 393 # manifestlog implementation did not consume the manifests from the
394 # changegroup (ex: it might be consuming trees from a separate bundle2 394 # changegroup (ex: it might be consuming trees from a separate bundle2
395 # part instead). So we need to manually consume it. 395 # part instead). So we need to manually consume it.
396 if r'filestart' not in self.__dict__: 396 if 'filestart' not in self.__dict__:
397 self._consumemanifest() 397 self._consumemanifest()
398 398
399 return self.filestart 399 return self.filestart
400 400
401 def url(self): 401 def url(self):