##// END OF EJS Templates
histedit: directly use node in 'verifyactions'...
Pierre-Yves David -
r29878:d7de02ef default
parent child Browse files
Show More
@@ -1373,7 +1373,7 b' def verifyactions(actions, state, ctxs):'
1373 1373 Will abort if there are to many or too few rules, a malformed rule,
1374 1374 or a rule on a changeset outside of the user-given range.
1375 1375 """
1376 expected = set(c.hex() for c in ctxs)
1376 expected = set(c.node() for c in ctxs)
1377 1377 seen = set()
1378 1378 prev = None
1379 1379 for action in actions:
@@ -1386,22 +1386,21 b' def verifyactions(actions, state, ctxs):'
1386 1386 constraint)
1387 1387
1388 1388 if action.node is not None:
1389 ha = node.hex(action.node)
1390 if _constraints.noother in constrs and ha not in expected:
1389 if _constraints.noother in constrs and action.node not in expected:
1391 1390 raise error.ParseError(
1392 1391 _('%s "%s" changeset was not a candidate')
1393 % (action.verb, ha[:12]),
1392 % (action.verb, node.short(action.node)),
1394 1393 hint=_('only use listed changesets'))
1395 if _constraints.forceother in constrs and ha in expected:
1394 if _constraints.forceother in constrs and action.node in expected:
1396 1395 raise error.ParseError(
1397 1396 _('%s "%s" changeset was not an edited list candidate')
1398 % (action.verb, ha[:12]),
1397 % (action.verb, node.short(action.node)),
1399 1398 hint=_('only use listed changesets'))
1400 if _constraints.noduplicates in constrs and ha in seen:
1399 if _constraints.noduplicates in constrs and action.node in seen:
1401 1400 raise error.ParseError(_(
1402 1401 'duplicated command for changeset %s') %
1403 ha[:12])
1404 seen.add(ha)
1402 node.short(action.node))
1403 seen.add(action.node)
1405 1404 missing = sorted(expected - seen) # sort to stabilize output
1406 1405
1407 1406 if state.repo.ui.configbool('histedit', 'dropmissing'):
@@ -1409,15 +1408,16 b' def verifyactions(actions, state, ctxs):'
1409 1408 raise error.ParseError(_('no rules provided'),
1410 1409 hint=_('use strip extension to remove commits'))
1411 1410
1412 drops = [drop(state, node.bin(n)) for n in missing]
1411 drops = [drop(state, n) for n in missing]
1413 1412 # put the in the beginning so they execute immediately and
1414 1413 # don't show in the edit-plan in the future
1415 1414 actions[:0] = drops
1416 1415 elif missing:
1417 1416 raise error.ParseError(_('missing rules for changeset %s') %
1418 missing[0][:12],
1417 node.short(missing[0]),
1419 1418 hint=_('use "drop %s" to discard, see also: '
1420 '"hg help -e histedit.config"') % missing[0][:12])
1419 '"hg help -e histedit.config"')
1420 % node.short(missing[0]))
1421 1421
1422 1422 def adjustreplacementsfrommarkers(repo, oldreplacements):
1423 1423 """Adjust replacements from obsolescense markers
General Comments 0
You need to be logged in to leave comments. Login now