##// END OF EJS Templates
histedit: change state.rules uses to state.actions...
Mateusz Kwapich -
r27207:2d8dbeb2 default
parent child Browse files
Show More
@@ -1057,17 +1057,19 b' def _histedit(ui, repo, state, *freeargs'
1057
1057
1058 # preprocess rules so that we can hide inner folds from the user
1058 # preprocess rules so that we can hide inner folds from the user
1059 # and only show one editor
1059 # and only show one editor
1060 rules = state.rules[:]
1060 actions = state.actions[:]
1061 for idx, ((action, ha), (nextact, unused)) in enumerate(
1061 for idx, (action, nextact) in enumerate(
1062 zip(rules, rules[1:] + [(None, None)])):
1062 zip(actions, actions[1:] + [None])):
1063 if action == 'fold' and nextact == 'fold':
1063 if action.verb == 'fold' and nextact and nextact.verb == 'fold':
1064 state.rules[idx] = '_multifold', ha
1064 state.actions[idx].__class__ = _multifold
1065 state.rules[idx] = '_multifold', action.nodetoverify() # TODO remove this
1065
1066
1066 while state.rules:
1067 while state.actions:
1067 state.write()
1068 state.write()
1068 action, ha = state.rules.pop(0)
1069 actobj = state.actions.pop(0)
1069 ui.debug('histedit: processing %s %s\n' % (action, ha[:12]))
1070 state.rules.pop(0) # TODO remove this
1070 actobj = actiontable[action].fromrule(state, ha)
1071 ui.debug('histedit: processing %s %s\n' % (actobj.verb,\
1072 actobj.torule()))
1071 parentctx, replacement_ = actobj.run()
1073 parentctx, replacement_ = actobj.run()
1072 state.parentctxnode = parentctx.node()
1074 state.parentctxnode = parentctx.node()
1073 state.replacements.extend(replacement_)
1075 state.replacements.extend(replacement_)
@@ -1117,10 +1119,9 b' def _histedit(ui, repo, state, *freeargs'
1117
1119
1118 def bootstrapcontinue(ui, state, opts):
1120 def bootstrapcontinue(ui, state, opts):
1119 repo = state.repo
1121 repo = state.repo
1120 if state.rules:
1122 if state.actions:
1121 action, currentnode = state.rules.pop(0)
1123 actobj = state.actions.pop(0)
1122
1124 state.rules.pop(0) # TODO remove this
1123 actobj = actiontable[action].fromrule(state, currentnode)
1124
1125
1125 if _isdirtywc(repo):
1126 if _isdirtywc(repo):
1126 actobj.continuedirty()
1127 actobj.continuedirty()
@@ -1370,8 +1371,8 b' def stripwrapper(orig, ui, repo, nodelis'
1370 if os.path.exists(os.path.join(repo.path, 'histedit-state')):
1371 if os.path.exists(os.path.join(repo.path, 'histedit-state')):
1371 state = histeditstate(repo)
1372 state = histeditstate(repo)
1372 state.read()
1373 state.read()
1373 histedit_nodes = set([repo[rulehash].node() for (action, rulehash)
1374 histedit_nodes = set([action.nodetoverify() for action
1374 in state.rules if rulehash in repo])
1375 in state.actions if action.nodetoverify()])
1375 strip_nodes = set([repo[n].node() for n in nodelist])
1376 strip_nodes = set([repo[n].node() for n in nodelist])
1376 common_nodes = histedit_nodes & strip_nodes
1377 common_nodes = histedit_nodes & strip_nodes
1377 if common_nodes:
1378 if common_nodes:
@@ -1386,11 +1387,11 b' def summaryhook(ui, repo):'
1386 return
1387 return
1387 state = histeditstate(repo)
1388 state = histeditstate(repo)
1388 state.read()
1389 state.read()
1389 if state.rules:
1390 if state.actions:
1390 # i18n: column positioning for "hg summary"
1391 # i18n: column positioning for "hg summary"
1391 ui.write(_('hist: %s (histedit --continue)\n') %
1392 ui.write(_('hist: %s (histedit --continue)\n') %
1392 (ui.label(_('%d remaining'), 'histedit.remaining') %
1393 (ui.label(_('%d remaining'), 'histedit.remaining') %
1393 len(state.rules)))
1394 len(state.actions)))
1394
1395
1395 def extsetup(ui):
1396 def extsetup(ui):
1396 cmdutil.summaryhooks.add('histedit', summaryhook)
1397 cmdutil.summaryhooks.add('histedit', summaryhook)
General Comments 0
You need to be logged in to leave comments. Login now