Пример #1
0
 def discard_last_commit(self):
     if (
         QMessageBox.warning(
             self,
             "Discard last commit?",
             "this will do a hard reset to the previous commit, so the current one will be lost",
             QMessageBox.Yes,
             QMessageBox.No,
         )
         == QMessageBox.Yes
     ):
         rollback()
Пример #2
0
 def rollback(self):
     targetCommit = self.commits.currentItem().text().split(' ')[0]
     if QMessageBox.warning(None, 'Rollback to commit?', 'All commits after ' + targetCommit + ' will be lost, proceed?', QMessageBox.Yes, QMessageBox.No) == QMessageBox.Yes:
         rollback(targetCommit)