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