diff -r 06423d65a2b8 -r 3a2f9bee8974 Plugins/VcsPlugins/vcsMercurial/hg.py --- a/Plugins/VcsPlugins/vcsMercurial/hg.py Sat Oct 29 19:28:04 2016 +0200 +++ b/Plugins/VcsPlugins/vcsMercurial/hg.py Sun Oct 30 15:06:45 2016 +0100 @@ -3139,6 +3139,27 @@ if res: dia.exec_() + def hgDeleteBackups(self): + """ + Public method to delete all backup bundles in the backup area. + """ + # find the root of the repo + repodir = self.__projectHelper.getProject().getProjectPath() + while not os.path.isdir(os.path.join(repodir, self.adminDir)): + repodir = os.path.dirname(repodir) + if os.path.splitdrive(repodir)[1] == os.sep: + return + + backupdir = os.path.join(repodir, self.adminDir, "strip-backup") + yes = E5MessageBox.yesNo( + self.__ui, + self.tr("Delete All Backups"), + self.tr("""<p>Do you really want to delete all backup bundles""" + """ stored the backup area <b>{0}</b>?</p>""").format( + backupdir)) + if yes: + shutil.rmtree(backupdir, True) + ########################################################################### ## Methods to deal with subrepositories are below. ###########################################################################