comparison hgext/histedit.py @ 48946:642e31cb55f0

py3: use class X: instead of class X(object): The inheritance from object is implied in Python 3. So this should be equivalent. This change was generated via an automated search and replace. So there may have been some accidental changes. Differential Revision: https://phab.mercurial-scm.org/D12352
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 13:08:28 -0700
parents f254fc73d956
children e160f073c37b
comparison
equal deleted inserted replaced
48945:55d132525155 48946:642e31cb55f0
349 lines = (intro % (first, last)).split(b'\n') + actions + hints 349 lines = (intro % (first, last)).split(b'\n') + actions + hints
350 350
351 return b''.join([b'# %s\n' % l if l else b'#\n' for l in lines]) 351 return b''.join([b'# %s\n' % l if l else b'#\n' for l in lines])
352 352
353 353
354 class histeditstate(object): 354 class histeditstate:
355 def __init__(self, repo): 355 def __init__(self, repo):
356 self.repo = repo 356 self.repo = repo
357 self.actions = None 357 self.actions = None
358 self.keep = None 358 self.keep = None
359 self.topmost = None 359 self.topmost = None
488 488
489 def inprogress(self): 489 def inprogress(self):
490 return self.repo.vfs.exists(b'histedit-state') 490 return self.repo.vfs.exists(b'histedit-state')
491 491
492 492
493 class histeditaction(object): 493 class histeditaction:
494 def __init__(self, state, node): 494 def __init__(self, state, node):
495 self.state = state 495 self.state = state
496 self.repo = state.repo 496 self.repo = state.repo
497 self.node = node 497 self.node = node
498 498
1140 1140
1141 def screen_size(): 1141 def screen_size():
1142 return struct.unpack(b'hh', fcntl.ioctl(1, termios.TIOCGWINSZ, b' ')) 1142 return struct.unpack(b'hh', fcntl.ioctl(1, termios.TIOCGWINSZ, b' '))
1143 1143
1144 1144
1145 class histeditrule(object): 1145 class histeditrule:
1146 def __init__(self, ui, ctx, pos, action=b'pick'): 1146 def __init__(self, ui, ctx, pos, action=b'pick'):
1147 self.ui = ui 1147 self.ui = ui
1148 self.ctx = ctx 1148 self.ctx = ctx
1149 self.action = action 1149 self.action = action
1150 self.origpos = pos 1150 self.origpos = pos
1240 if len(line) <= n: 1240 if len(line) <= n:
1241 return line 1241 return line
1242 return line[: n - 2] + b' >' 1242 return line[: n - 2] + b' >'
1243 1243
1244 1244
1245 class _chistedit_state(object): 1245 class _chistedit_state:
1246 def __init__( 1246 def __init__(
1247 self, 1247 self,
1248 repo, 1248 repo,
1249 rules, 1249 rules,
1250 stdscr, 1250 stdscr,