mercurial/crecord.py
changeset 28926 0411b7998d9b
parent 28925 ee56a86e2782
child 29076 36d3535c6a47
equal deleted inserted replaced
28925:ee56a86e2782 28926:0411b7998d9b
  1415         except ValueError:
  1415         except ValueError:
  1416             response = None
  1416             response = None
  1417 
  1417 
  1418         return response
  1418         return response
  1419 
  1419 
  1420     def confirmcommit(self, review=False):
  1420     def reviewcommit(self):
  1421         """ask for 'y' to be pressed to confirm selected. return True if
  1421         """ask for 'y' to be pressed to confirm selected. return True if
  1422         confirmed."""
  1422         confirmed."""
  1423         if review:
  1423         confirmtext = (
  1424             confirmtext = (
       
  1425 """if you answer yes to the following, the your currently chosen patch chunks
  1424 """if you answer yes to the following, the your currently chosen patch chunks
  1426 will be loaded into an editor.  you may modify the patch from the editor, and
  1425 will be loaded into an editor.  you may modify the patch from the editor, and
  1427 save the changes if you wish to change the patch.  otherwise, you can just
  1426 save the changes if you wish to change the patch.  otherwise, you can just
  1428 close the editor without saving to accept the current patch as-is.
  1427 close the editor without saving to accept the current patch as-is.
  1429 
  1428 
  1430 note: don't add/remove lines unless you also modify the range information.
  1429 note: don't add/remove lines unless you also modify the range information.
  1431       failing to follow this rule will result in the commit aborting.
  1430       failing to follow this rule will result in the commit aborting.
  1432 
  1431 
  1433 are you sure you want to review/edit and confirm the selected changes [yn]?
  1432 are you sure you want to review/edit and confirm the selected changes [yn]?
  1434 """)
  1433 """)
  1435         else:
       
  1436             confirmtext = (
       
  1437                 "are you sure you want to confirm the selected changes [yn]? ")
       
  1438 
       
  1439         response = self.confirmationwindow(confirmtext)
  1434         response = self.confirmationwindow(confirmtext)
  1440         if response is None:
  1435         if response is None:
  1441             response = "n"
  1436             response = "n"
  1442         if response.lower().startswith("y"):
  1437         if response.lower().startswith("y"):
  1443             return True
  1438             return True
  1602         elif keypressed in ["c"]:
  1597         elif keypressed in ["c"]:
  1603             return True
  1598             return True
  1604         elif test and keypressed in ['X']:
  1599         elif test and keypressed in ['X']:
  1605             return True
  1600             return True
  1606         elif keypressed in ["r"]:
  1601         elif keypressed in ["r"]:
  1607             if self.confirmcommit(review=True):
  1602             if self.reviewcommit():
  1608                 self.opts['review'] = True
  1603                 self.opts['review'] = True
  1609                 return True
  1604                 return True
  1610         elif test and keypressed in ['R']:
  1605         elif test and keypressed in ['R']:
  1611             self.opts['review'] = True
  1606             self.opts['review'] = True
  1612             return True
  1607             return True