hgext/histedit.py
changeset 49037 642e31cb55f0
parent 49004 f254fc73d956
child 49087 e160f073c37b
equal deleted inserted replaced
49036:55d132525155 49037: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,