Git: Archive support

This allows users to create archive files from local repository.

Tools > Git > Local Repository > Archive will create <reponame>-
HEAD.tar.gz

Tools > Git > Actions on Commits... you can choose a commit to archive

Change-Id: I09bbbdefe532237e9065d1ca3c21910a036ea149
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
This commit is contained in:
Tasuku Suzuki
2019-05-28 15:06:35 +09:00
committed by Orgad Shaneh
parent c5d63c8f14
commit 578cdf7c5a
6 changed files with 68 additions and 0 deletions

View File

@@ -83,6 +83,8 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
this, &ChangeSelectionDialog::acceptRevert);
connect(m_ui->checkoutButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::acceptCheckout);
connect(m_ui->archiveButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::acceptArchive);
if (id == "Git.Revert")
m_ui->revertButton->setDefault(true);
@@ -90,6 +92,8 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
m_ui->cherryPickButton->setDefault(true);
else if (id == "Git.Checkout")
m_ui->checkoutButton->setDefault(true);
else if (id == "Git.Archive")
m_ui->archiveButton->setDefault(true);
else
m_ui->showButton->setDefault(true);
m_changeModel = new QStringListModel(this);
@@ -147,6 +151,12 @@ ChangeCommand ChangeSelectionDialog::command() const
return m_command;
}
void ChangeSelectionDialog::acceptArchive()
{
m_command = Archive;
accept();
}
void ChangeSelectionDialog::acceptCheckout()
{
m_command = Checkout;