comparison mercurial/changelog.py @ 45942:89a2afe31e82

formating: upgrade to black 20.8b1 This required a couple of small tweaks to un-confuse black, but now it works. Big formatting changes come from: * Dramatically improved collection-splitting logic upstream * Black having a strong (correct IMO) opinion that """ is better than ''' Differential Revision: https://phab.mercurial-scm.org/D9430
author Augie Fackler <raf@durin42.com>
date Fri, 27 Nov 2020 17:03:29 -0500
parents 232c88dd89e3
children 2607a9346398
comparison
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
89 """strip trailing whitespace and leading and trailing empty lines""" 89 """strip trailing whitespace and leading and trailing empty lines"""
90 return b'\n'.join([l.rstrip() for l in desc.splitlines()]).strip(b'\n') 90 return b'\n'.join([l.rstrip() for l in desc.splitlines()]).strip(b'\n')
91 91
92 92
93 class appender(object): 93 class appender(object):
94 '''the changelog index must be updated last on disk, so we use this class 94 """the changelog index must be updated last on disk, so we use this class
95 to delay writes to it''' 95 to delay writes to it"""
96 96
97 def __init__(self, vfs, name, mode, buf): 97 def __init__(self, vfs, name, mode, buf):
98 self.data = buf 98 self.data = buf
99 fp = vfs(name, mode) 99 fp = vfs(name, mode)
100 self.fp = fp 100 self.fp = fp