comparison mercurial/commandserver.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 c59eb1560c44
children 6392bd7c26a8 98c14f0108b8
comparison
equal deleted inserted replaced
43505:47fac1692ede 43506:9f70512ae2cf
62 # single write() to guarantee the same atomicity as the underlying file 62 # single write() to guarantee the same atomicity as the underlying file
63 self.out.write(struct.pack(b'>cI', self.channel, len(data)) + data) 63 self.out.write(struct.pack(b'>cI', self.channel, len(data)) + data)
64 self.out.flush() 64 self.out.flush()
65 65
66 def __getattr__(self, attr): 66 def __getattr__(self, attr):
67 if attr in (r'isatty', r'fileno', r'tell', r'seek'): 67 if attr in ('isatty', 'fileno', 'tell', 'seek'):
68 raise AttributeError(attr) 68 raise AttributeError(attr)
69 return getattr(self.out, attr) 69 return getattr(self.out, attr)
70 70
71 71
72 class channeledmessage(object): 72 class channeledmessage(object):
178 return l 178 return l
179 179
180 __next__ = next 180 __next__ = next
181 181
182 def __getattr__(self, attr): 182 def __getattr__(self, attr):
183 if attr in (r'isatty', r'fileno', r'tell', r'seek'): 183 if attr in ('isatty', 'fileno', 'tell', 'seek'):
184 raise AttributeError(attr) 184 raise AttributeError(attr)
185 return getattr(self.in_, attr) 185 return getattr(self.in_, attr)
186 186
187 187
188 _messageencoders = { 188 _messageencoders = {
448 # same state inherited from parent. 448 # same state inherited from parent.
449 random.seed() 449 random.seed()
450 450
451 451
452 def _serverequest(ui, repo, conn, createcmdserver, prereposetups): 452 def _serverequest(ui, repo, conn, createcmdserver, prereposetups):
453 fin = conn.makefile(r'rb') 453 fin = conn.makefile('rb')
454 fout = conn.makefile(r'wb') 454 fout = conn.makefile('wb')
455 sv = None 455 sv = None
456 try: 456 try:
457 sv = createcmdserver(repo, conn, fin, fout, prereposetups) 457 sv = createcmdserver(repo, conn, fin, fout, prereposetups)
458 try: 458 try:
459 sv.serve() 459 sv.serve()