1384 if constraint not in _constraints.known(): |
1384 if constraint not in _constraints.known(): |
1385 raise error.ParseError(_('unknown constraint "%s"') % |
1385 raise error.ParseError(_('unknown constraint "%s"') % |
1386 constraint) |
1386 constraint) |
1387 |
1387 |
1388 if action.node is not None: |
1388 if action.node is not None: |
1389 ha = node.hex(action.node) |
1389 if _constraints.noother in constrs and action.node not in expected: |
1390 if _constraints.noother in constrs and ha not in expected: |
|
1391 raise error.ParseError( |
1390 raise error.ParseError( |
1392 _('%s "%s" changeset was not a candidate') |
1391 _('%s "%s" changeset was not a candidate') |
1393 % (action.verb, ha[:12]), |
1392 % (action.verb, node.short(action.node)), |
1394 hint=_('only use listed changesets')) |
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 raise error.ParseError( |
1395 raise error.ParseError( |
1397 _('%s "%s" changeset was not an edited list candidate') |
1396 _('%s "%s" changeset was not an edited list candidate') |
1398 % (action.verb, ha[:12]), |
1397 % (action.verb, node.short(action.node)), |
1399 hint=_('only use listed changesets')) |
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 raise error.ParseError(_( |
1400 raise error.ParseError(_( |
1402 'duplicated command for changeset %s') % |
1401 'duplicated command for changeset %s') % |
1403 ha[:12]) |
1402 node.short(action.node)) |
1404 seen.add(ha) |
1403 seen.add(action.node) |
1405 missing = sorted(expected - seen) # sort to stabilize output |
1404 missing = sorted(expected - seen) # sort to stabilize output |
1406 |
1405 |
1407 if state.repo.ui.configbool('histedit', 'dropmissing'): |
1406 if state.repo.ui.configbool('histedit', 'dropmissing'): |
1408 if len(actions) == 0: |
1407 if len(actions) == 0: |
1409 raise error.ParseError(_('no rules provided'), |
1408 raise error.ParseError(_('no rules provided'), |
1410 hint=_('use strip extension to remove commits')) |
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 # put the in the beginning so they execute immediately and |
1412 # put the in the beginning so they execute immediately and |
1414 # don't show in the edit-plan in the future |
1413 # don't show in the edit-plan in the future |
1415 actions[:0] = drops |
1414 actions[:0] = drops |
1416 elif missing: |
1415 elif missing: |
1417 raise error.ParseError(_('missing rules for changeset %s') % |
1416 raise error.ParseError(_('missing rules for changeset %s') % |
1418 missing[0][:12], |
1417 node.short(missing[0]), |
1419 hint=_('use "drop %s" to discard, see also: ' |
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 def adjustreplacementsfrommarkers(repo, oldreplacements): |
1422 def adjustreplacementsfrommarkers(repo, oldreplacements): |
1423 """Adjust replacements from obsolescense markers |
1423 """Adjust replacements from obsolescense markers |
1424 |
1424 |
1425 Replacements structure is originally generated based on |
1425 Replacements structure is originally generated based on |