mercurial/commands.py
changeset 42144 013de80bf90e
parent 42130 a362b0b95e42
child 42156 496ac8a02380
child 42555 50eacdeea88c
equal deleted inserted replaced
42143:29569f2db929 42144:013de80bf90e
  4653         elif not result and pushop.bkresult:
  4653         elif not result and pushop.bkresult:
  4654             result = 2
  4654             result = 2
  4655 
  4655 
  4656     return result
  4656     return result
  4657 
  4657 
  4658 @command('recover', [], helpcategory=command.CATEGORY_MAINTENANCE)
  4658 @command('recover',
  4659 def recover(ui, repo):
  4659     [('','verify', True, "run `hg verify` after succesful recover"),
       
  4660     ],
       
  4661     helpcategory=command.CATEGORY_MAINTENANCE)
       
  4662 def recover(ui, repo, **opts):
  4660     """roll back an interrupted transaction
  4663     """roll back an interrupted transaction
  4661 
  4664 
  4662     Recover from an interrupted commit or pull.
  4665     Recover from an interrupted commit or pull.
  4663 
  4666 
  4664     This command tries to fix the repository status after an
  4667     This command tries to fix the repository status after an
  4665     interrupted operation. It should only be necessary when Mercurial
  4668     interrupted operation. It should only be necessary when Mercurial
  4666     suggests it.
  4669     suggests it.
  4667 
  4670 
  4668     Returns 0 if successful, 1 if nothing to recover or verify fails.
  4671     Returns 0 if successful, 1 if nothing to recover or verify fails.
  4669     """
  4672     """
  4670     if repo.recover():
  4673     ret = repo.recover()
  4671         return hg.verify(repo)
  4674     if ret:
       
  4675         if opts['verify']:
       
  4676             return hg.verify(repo)
       
  4677         else:
       
  4678             msg = _("(verify step skipped, run  `hg verify` to check your "
       
  4679                     "repository content)\n")
       
  4680             ui.warn(msg)
       
  4681             return 0
  4672     return 1
  4682     return 1
  4673 
  4683 
  4674 @command('remove|rm',
  4684 @command('remove|rm',
  4675     [('A', 'after', None, _('record delete for missing files')),
  4685     [('A', 'after', None, _('record delete for missing files')),
  4676     ('f', 'force', None,
  4686     ('f', 'force', None,