Added support for tagging revisions
FossilOrigin-Name: 579a9a1fb06478cd37359eb106dcabc9c9c5fa5c
This commit is contained in:
parent
3c1ca98ca6
commit
3987a35083
22
manifest
22
manifest
@ -1,5 +1,5 @@
|
||||
C Minor\sfixes
|
||||
D 2015-05-02T18:22:55.606
|
||||
C Added\ssupport\sfor\stagging\srevisions
|
||||
D 2015-05-02T18:23:46.760
|
||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||
@ -200,12 +200,12 @@ F src/Fossil.cpp 8abdf4c95dfd2728fb11a2a07ea5c05eabba27d6
|
||||
F src/Fossil.h 7954818fa3168d56901f8549ca5ae56987f48a6a
|
||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||
F src/MainWindow.cpp 8ae32de39af8917cdb5a5c7efc221da4a61154a1
|
||||
F src/MainWindow.h 8377cf134d64d74855b1795463356a7a817b149f
|
||||
F src/MainWindow.cpp 03761f68b681f469b3c01cff7ff6a084c90c1fb4
|
||||
F src/MainWindow.h e8b8be6b33e68a894d6ed84597f4767c83daf750
|
||||
F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4
|
||||
F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43
|
||||
F src/UpdateDialog.cpp 54df56055ee5efe1170efbed495363fb14abc8e5
|
||||
F src/UpdateDialog.h e2252c7d555e161f946e99014a6e6c6b52b4b53c
|
||||
F src/UpdateDialog.cpp 5f9ff02aeed08ab3a69d0a9a3b3efeefbc38f3d4
|
||||
F src/UpdateDialog.h 93c6ad9bd814f23e431c67bcd01928f33e10a80b
|
||||
F src/Utils.cpp f78728e0817b1db23007ba0d2c5c26980ee7ebca
|
||||
F src/Utils.h 8ad68bd227bd999eb6ea92a70bb4be2d6788d912
|
||||
F src/Workspace.cpp fca14549ff85125a9fb7fd8a2722198055ea9f9a
|
||||
@ -217,10 +217,10 @@ F ui/BrowserWidget.ui 5ad98b13773afadb20a1a2c22148aaebe5dbd95d
|
||||
F ui/CloneDialog.ui 4886e7d4f258ea8b852b5eefc860396e35145712
|
||||
F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f
|
||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||
F ui/MainWindow.ui 798a40a0fd715b0544f608543e09038e2b1fb69a
|
||||
F ui/MainWindow.ui 90bbd2df0afd46e82d4a850882a22f30d3bffe38
|
||||
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
|
||||
F ui/UpdateDialog.ui 129596c2deb60211f25cefd785696ca7c7c56d42
|
||||
P 2bf8e2a8aba307659c07044e1e6d155d287ac6b6
|
||||
R 9ec2464989774dd3cf301c6239b3e097
|
||||
F ui/UpdateDialog.ui 636fd495d481ade1f20a65f79b538b9a49bbf1fa
|
||||
P 48ae56dfa79bc35a51145dd9549e4f3760e76b7f
|
||||
R 6c39d1dbde8de7bab3b96245abf117bf
|
||||
U kostas
|
||||
Z 6bbfd3e22c509dd5f01fbba39ce51089
|
||||
Z 1552aaa7605ace7a9b84f678a9f0da07
|
||||
|
@ -1 +1 @@
|
||||
48ae56dfa79bc35a51145dd9549e4f3760e76b7f
|
||||
579a9a1fb06478cd37359eb106dcabc9c9c5fa5c
|
@ -18,6 +18,8 @@
|
||||
#include "UpdateDialog.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#define LATEST_VERSION "Latest"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
enum
|
||||
{
|
||||
@ -176,6 +178,13 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
menuStashes->addAction(ui->actionDiffStash);
|
||||
menuStashes->addAction(ui->actionDeleteStash);
|
||||
|
||||
// TagsMenu
|
||||
menuTags = new QMenu(this);
|
||||
menuTags->addAction(ui->actionNewTag);
|
||||
menuTags->addAction(ui->actionDeleteTag);
|
||||
menuTags->addAction(ui->actionUpdateRevision);
|
||||
|
||||
|
||||
// Recent Workspaces
|
||||
// Locate a sequence of two separator actions in file menu
|
||||
QList<QAction*> file_actions = ui->menuFile->actions();
|
||||
@ -603,6 +612,14 @@ void MainWindow::scanWorkspace()
|
||||
updateWorkspaceView();
|
||||
updateFileView();
|
||||
|
||||
// Build default versions list
|
||||
const QString latest = tr(LATEST_VERSION);
|
||||
|
||||
versionList.clear();
|
||||
versionList.append(latest);
|
||||
versionList += getWorkspace().getBranches();
|
||||
versionList += getWorkspace().getTags();
|
||||
|
||||
setBusy(false);
|
||||
setStatus("");
|
||||
}
|
||||
@ -1479,44 +1496,6 @@ void MainWindow::on_actionUpdateRevision_triggered()
|
||||
updateRevision("");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::updateRevision(const QString &revision)
|
||||
{
|
||||
QStringList versions;
|
||||
versions.append(tr("Latest version"));
|
||||
versions += getWorkspace().getBranches();
|
||||
versions += getWorkspace().getTags();
|
||||
const QString latest = tr("Latest version");
|
||||
QString defaultval = latest;
|
||||
|
||||
if(!revision.isEmpty())
|
||||
defaultval = revision;
|
||||
|
||||
QString selected_revision = UpdateDialog::run(this, versions, defaultval);
|
||||
|
||||
if(selected_revision.isEmpty())
|
||||
return;
|
||||
else if(selected_revision == latest)
|
||||
selected_revision = ""; // Empty revision is "latest"
|
||||
|
||||
QStringList res;
|
||||
|
||||
// Do test update
|
||||
if(!fossil().updateRepository(res, selected_revision, true))
|
||||
return;
|
||||
|
||||
// FIXME: parse "changes: None. Already up-to-date" and avoid dialog
|
||||
if(res.length()==0)
|
||||
return;
|
||||
|
||||
if(!FileActionDialog::run(this, tr("Update"), tr("The following files will be updated.")+"\n"+tr("Are you sure?"), res))
|
||||
return;
|
||||
|
||||
// Do update
|
||||
fossil().updateRepository(res, selected_revision, false);
|
||||
refresh();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::loadFossilSettings()
|
||||
{
|
||||
@ -2071,6 +2050,8 @@ void MainWindow::on_workspaceTreeView_customContextMenuRequested(const QPoint &)
|
||||
menu = menuWorkspace;
|
||||
else if (tv.Type == TreeViewItem::TYPE_STASH || tv.Type == TreeViewItem::TYPE_STASHES)
|
||||
menu = menuStashes;
|
||||
else if (tv.Type == TreeViewItem::TYPE_TAG || tv.Type == TreeViewItem::TYPE_TAGS)
|
||||
menu = menuTags;
|
||||
|
||||
if(menu)
|
||||
{
|
||||
@ -2206,3 +2187,71 @@ QMessageBox::StandardButton MainWindow::MainWinUICallback::Query(const QString &
|
||||
return DialogQuery(mainWindow, title, query, buttons);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::updateRevision(const QString &revision)
|
||||
{
|
||||
const QString latest = tr(LATEST_VERSION);
|
||||
QString defaultval = latest;
|
||||
|
||||
if(!revision.isEmpty())
|
||||
defaultval = revision;
|
||||
|
||||
QString selected_revision = UpdateDialog::runUpdate(this, tr("Update workspace"), versionList, defaultval).trimmed();
|
||||
|
||||
if(selected_revision.isEmpty())
|
||||
return;
|
||||
else if(selected_revision == latest)
|
||||
selected_revision = ""; // Empty revision is "latest"
|
||||
|
||||
QStringList res;
|
||||
|
||||
// Do test update
|
||||
if(!fossil().updateRepository(res, selected_revision, true))
|
||||
return;
|
||||
|
||||
// FIXME: parse "changes: None. Already up-to-date" and avoid dialog
|
||||
if(res.length()==0)
|
||||
return;
|
||||
|
||||
if(!FileActionDialog::run(this, tr("Update"), tr("The following files will be updated.")+"\n"+tr("Are you sure?"), res))
|
||||
return;
|
||||
|
||||
// Do update
|
||||
fossil().updateRepository(res, selected_revision, false);
|
||||
refresh();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionNewTag_triggered()
|
||||
{
|
||||
// Default to current revision
|
||||
QString revision = fossil().getCurrentRevision();
|
||||
|
||||
QString name;
|
||||
if(!UpdateDialog::runNewTag(this, tr("New tag"), versionList, revision, revision, name))
|
||||
return;
|
||||
|
||||
if(name.isEmpty() || getWorkspace().getTags().contains(name) || getWorkspace().getBranches().contains(name))
|
||||
return;
|
||||
|
||||
fossil().tagNew(name, revision);
|
||||
refresh();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionDeleteTag_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionNewBranch_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionMergeBranch_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -115,6 +115,14 @@ private slots:
|
||||
|
||||
void on_actionUpdateRevision_triggered();
|
||||
|
||||
void on_actionNewTag_triggered();
|
||||
|
||||
void on_actionDeleteTag_triggered();
|
||||
|
||||
void on_actionNewBranch_triggered();
|
||||
|
||||
void on_actionMergeBranch_triggered();
|
||||
|
||||
private:
|
||||
class MainWinUICallback : public UICallback
|
||||
{
|
||||
@ -151,9 +159,12 @@ private:
|
||||
class QShortcut *abortShortcut;
|
||||
QMenu *menuWorkspace;
|
||||
QMenu *menuStashes;
|
||||
QMenu *menuTags;
|
||||
//QMenu *menuBranches;
|
||||
|
||||
bool operationAborted;
|
||||
stringset_t selectedDirs; // The directory selected in the tree
|
||||
QStringList versionList;
|
||||
|
||||
Workspace workspace;
|
||||
Workspace & getWorkspace() { return workspace; }
|
||||
|
@ -24,11 +24,28 @@ UpdateDialog::~UpdateDialog()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QString UpdateDialog::run(QWidget *parent, const QStringList &completions, const QString &defaultValue)
|
||||
QString UpdateDialog::runUpdate(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue)
|
||||
{
|
||||
UpdateDialog dlg(parent, completions, defaultValue);
|
||||
dlg.setWindowTitle(title);
|
||||
dlg.ui->label_3->setVisible(false);
|
||||
dlg.ui->lineName->setVisible(false);
|
||||
|
||||
if(dlg.exec() != QDialog::Accepted)
|
||||
return QString("");
|
||||
return dlg.ui->cmbRevision->currentText();
|
||||
return dlg.ui->cmbRevision->currentText().trimmed();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool UpdateDialog::runNewTag(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, QString &revision, QString &name)
|
||||
{
|
||||
UpdateDialog dlg(parent, completions, defaultValue);
|
||||
dlg.setWindowTitle(title);
|
||||
|
||||
if(dlg.exec() != QDialog::Accepted)
|
||||
return false;
|
||||
|
||||
revision = dlg.ui->cmbRevision->currentText().trimmed();
|
||||
name = dlg.ui->lineName->text().trimmed();
|
||||
return true;
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ public:
|
||||
explicit UpdateDialog(QWidget *parent, const QStringList &completions, const QString &defaultValue);
|
||||
~UpdateDialog();
|
||||
|
||||
static QString run(QWidget *parent, const QStringList &completions, const QString &defaultValue);
|
||||
|
||||
static QString runUpdate(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue);
|
||||
static bool runNewTag(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, QString &revision, QString &name);
|
||||
|
||||
private:
|
||||
Ui::UpdateDialog *ui;
|
||||
|
@ -896,7 +896,7 @@
|
||||
<normaloff>:/icons/icons/Button Forward-01.png</normaloff>:/icons/icons/Button Forward-01.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>UpdateRevision</string>
|
||||
<string>Update to Revision</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Update the workspace to a specific revision</string>
|
||||
@ -905,6 +905,43 @@
|
||||
<string>Ctrl+Shift+U</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNewTag">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icons/Highlighter Yellow-01.png</normaloff>:/icons/icons/Highlighter Yellow-01.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New Tag</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Tag current revision</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDeleteTag">
|
||||
<property name="text">
|
||||
<string>Delete Tag</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Delete tag</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNewBranch">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icons/Document Organization Chart-01.png</normaloff>:/icons/icons/Document Organization Chart-01.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New Branch</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create a branch from the current revision</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMergeBranch">
|
||||
<property name="text">
|
||||
<string>Merge Branch</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
@ -10,21 +10,15 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>478</width>
|
||||
<height>81</height>
|
||||
<height>113</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Update Workspace</string>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
@ -39,6 +33,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user