@@ -825,6 +825,10 @@ def showContextMenu(self, pos):
825825 enabled = not not branchDir
826826
827827 self .acRevert .setEnabled (enabled )
828+
829+ # to avoid bad reset on each repo
830+ if enabled and qApp .settings ().isCompositeMode ():
831+ enabled = False
828832 self .resetMenu .setEnabled (enabled )
829833
830834 hasMark = self .marker .hasMark ()
@@ -980,16 +984,27 @@ def __onRevertCommit(self):
980984 if not commit :
981985 return
982986
983- ret , error = Git .revertCommit (self .curBranch , commit .sha1 )
984- # ret == 1 with no error can happened but still reverted
985- if ret != 0 and error :
986- QMessageBox .critical (
987- self , self .window ().windowTitle (),
988- error )
989- else :
990- # FIXME: fetch the new one only?
991- self .clear ()
992- self .showLogs (self .curBranch , self .args )
987+ def _doRevert (sha1 , repoDir ):
988+ ret , error = Git .revertCommit (self .curBranch , sha1 , repoDir )
989+ # ret == 1 with no error can happened but still reverted
990+ if ret != 0 and error :
991+ QMessageBox .critical (
992+ self , self .window ().windowTitle (),
993+ error )
994+ return False
995+ return True
996+
997+ repoDir = commitRepoDir (commit )
998+ if not _doRevert (commit .sha1 , repoDir ):
999+ return
1000+
1001+ for subCommit in commit .subCommits :
1002+ repoDir = commitRepoDir (subCommit )
1003+ _doRevert (subCommit .sha1 , repoDir )
1004+
1005+ # FIXME: fetch the new one only?
1006+ self .clear ()
1007+ self .showLogs (self .curBranch , self .args )
9931008
9941009 def __resetToCurCommit (self , method ):
9951010 if self .curIdx == - 1 :
0 commit comments