mercurial/commands.py
changeset 35244 98f97eb20597
parent 35225 7ce0ba3a1c32
child 35352 920cca6c8462
equal deleted inserted replaced
35243:490df753894d 35244:98f97eb20597
    47     phases,
    47     phases,
    48     pycompat,
    48     pycompat,
    49     rcutil,
    49     rcutil,
    50     registrar,
    50     registrar,
    51     revsetlang,
    51     revsetlang,
       
    52     rewriteutil,
    52     scmutil,
    53     scmutil,
    53     server,
    54     server,
    54     sshserver,
    55     sshserver,
    55     streamclone,
    56     streamclone,
    56     tags as tagsmod,
    57     tags as tagsmod,
  1539     if opts.get('amend'):
  1540     if opts.get('amend'):
  1540         if ui.configbool('ui', 'commitsubrepos'):
  1541         if ui.configbool('ui', 'commitsubrepos'):
  1541             raise error.Abort(_('cannot amend with ui.commitsubrepos enabled'))
  1542             raise error.Abort(_('cannot amend with ui.commitsubrepos enabled'))
  1542 
  1543 
  1543         old = repo['.']
  1544         old = repo['.']
  1544         if not old.mutable():
  1545         rewriteutil.precheck(repo, [old.rev()], 'amend')
  1545             raise error.Abort(_('cannot amend public changesets'))
       
  1546         if len(repo[None].parents()) > 1:
       
  1547             raise error.Abort(_('cannot amend while merging'))
       
  1548         allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
       
  1549         if not allowunstable and old.children():
       
  1550             raise error.Abort(_('cannot amend changeset with children'))
       
  1551 
  1546 
  1552         # Currently histedit gets confused if an amend happens while histedit
  1547         # Currently histedit gets confused if an amend happens while histedit
  1553         # is in progress. Since we have a checkunfinished command, we are
  1548         # is in progress. Since we have a checkunfinished command, we are
  1554         # temporarily honoring it.
  1549         # temporarily honoring it.
  1555         #
  1550         #