Commits are now allowed when a merge integration has occured even when no files are modified
Support for forced merges Context menus are offset by a pixel to prevent unintended clicks FossilOrigin-Name: b0f81bc9c4d226d8406f65d9ad02099205d7e067
This commit is contained in:
parent
cdba8c05f6
commit
894f980a7c
26
manifest
26
manifest
@ -1,5 +1,5 @@
|
||||
C Added\smerge\ssupport
|
||||
D 2015-05-03T11:44:04.852
|
||||
C Commits\sare\snow\sallowed\swhen\sa\smerge\sintegration\shas\soccured\seven\swhen\sno\sfiles\sare\smodified\nSupport\sfor\sforced\smerges\nContext\smenus\sare\soffset\sby\sa\spixel\sto\sprevent\sunintended\sclicks\n
|
||||
D 2015-05-03T12:27:11.377
|
||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||
@ -196,20 +196,20 @@ F src/FileActionDialog.cpp fcaebf9986f789b3440d5390b3458ad5f86fe0c8
|
||||
F src/FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce
|
||||
F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
||||
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
||||
F src/Fossil.cpp 57363e0f487f325ba2eae6fdcf29756c9b1ae4a9
|
||||
F src/Fossil.h fb34964797dc10cea02bdf2e3f2c97a74fddafc5
|
||||
F src/Fossil.cpp 01b620c7ca283be385211e8276aad98dc642b0ef
|
||||
F src/Fossil.h f9b49ed930af2159f97a86ce0f6da821a0b0819e
|
||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||
F src/MainWindow.cpp 7ae75136eb3a2f867de4281cbe428a176c3d11c8
|
||||
F src/MainWindow.cpp 1ea5808d0ad4cff7adaa7c910a4438bef3245cbc
|
||||
F src/MainWindow.h a4f3c753debe65d6231721c9948c4e8dee699021
|
||||
F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4
|
||||
F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43
|
||||
F src/UpdateDialog.cpp 08b0261de45babd947a0fbbd5af6bf8b58b74735
|
||||
F src/UpdateDialog.h bf04816f3cc5425beaaca72ca05bcc793d4ca204
|
||||
F src/UpdateDialog.cpp 4dd021bc57dde4f6e3f444f5f8a02f5a4a736478
|
||||
F src/UpdateDialog.h b3ecf0401659a9e48a4f832bd996fe27c6d15f40
|
||||
F src/Utils.cpp 748a58f19187aff7f3b867894129291cbe091678
|
||||
F src/Utils.h 9cc125f59b8d46ff47bbde4c2cf9bc77f8e2553b
|
||||
F src/Workspace.cpp 12edd94656a0aaef20798f883b59af3074466cec
|
||||
F src/Workspace.h 890fdb5f6b768809bc962374d22422dbfb6e89a1
|
||||
F src/Workspace.cpp f68a4ca05d1b7c5c345fbd89527691813593c663
|
||||
F src/Workspace.h e13d21c15f27c2b36368a06f4316f261ff782814
|
||||
F src/main.cpp 2ac8badc2a63fa123ceae53382ce24cfe1b5a54b
|
||||
F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x
|
||||
F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x
|
||||
@ -219,8 +219,8 @@ F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f
|
||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||
F ui/MainWindow.ui d4fc7971a0717677adb1be0bb88502dfcb92f5c4
|
||||
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
|
||||
F ui/UpdateDialog.ui cd909f40c16e439181664e53bc3e86c2df647e3f
|
||||
P 87468705beaaef842877ab8459e287a61edf4bc3
|
||||
R 5791f89a3c32b1103d6b1aa0c81d25f4
|
||||
F ui/UpdateDialog.ui 392cdba296dd4b79145992a85e79748e7c34580d
|
||||
P ac65fbf8d33a9e64fb97bd8652a43b4d11c8e538
|
||||
R 999f69cdb7954fc29187e1f6edb999d1
|
||||
U kostas
|
||||
Z 6e82b9757fd44eb9f7e8cfc7e84094f4
|
||||
Z 5cfca8d448bbfd5145ee8de41f944a10
|
||||
|
@ -1 +1 @@
|
||||
ac65fbf8d33a9e64fb97bd8652a43b4d11c8e538
|
||||
b0f81bc9c4d226d8406f65d9ad02099205d7e067
|
@ -119,6 +119,12 @@ bool Fossil::listFiles(QStringList &files)
|
||||
return runFossil(QStringList() << "ls" << "-l", &files, RUNFLAGS_SILENT_ALL);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::status(QStringList &result)
|
||||
{
|
||||
return runFossil(QStringList() << "status", &result, RUNFLAGS_SILENT_ALL);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::pushRepository()
|
||||
{
|
||||
@ -549,7 +555,7 @@ bool Fossil::branchNew(const QString& name, const QString& revisionBasis, bool i
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::branchMerge(QStringList &res, const QString& revision, bool integrate, bool testOnly)
|
||||
bool Fossil::branchMerge(QStringList &res, const QString& revision, bool integrate, bool force, bool testOnly)
|
||||
{
|
||||
QStringList params;
|
||||
|
||||
@ -558,6 +564,9 @@ bool Fossil::branchMerge(QStringList &res, const QString& revision, bool integra
|
||||
if(integrate)
|
||||
params << "--integrate";
|
||||
|
||||
if(force)
|
||||
params << "--force";
|
||||
|
||||
if(testOnly)
|
||||
params << "--dry-run";
|
||||
|
||||
|
@ -92,6 +92,8 @@ public:
|
||||
void stopUI();
|
||||
|
||||
bool listFiles(QStringList &files);
|
||||
bool status(QStringList& result);
|
||||
|
||||
bool diffFile(const QString &repoFile);
|
||||
bool commitFiles(const QStringList &fileList, const QString &comment);
|
||||
bool addFiles(const QStringList& fileList);
|
||||
@ -117,7 +119,7 @@ public:
|
||||
|
||||
bool branchList(QStringList& branches, QStringList& activeBranches);
|
||||
bool branchNew(const QString& name, const QString& revisionBasis, bool isPrivate=false);
|
||||
bool branchMerge(QStringList& res, const QString& revision, bool integrate, bool testOnly);
|
||||
bool branchMerge(QStringList& res, const QString& revision, bool integrate, bool force, bool testOnly);
|
||||
|
||||
const QString &getCurrentRevision() const { return currentRevision; }
|
||||
const QStringList &getCurrentTags() const { return currentTags; }
|
||||
|
@ -1240,7 +1240,7 @@ void MainWindow::on_actionCommit_triggered()
|
||||
QStringList commit_files;
|
||||
getSelectionFilenames(commit_files, WorkspaceFile::TYPE_MODIFIED, true);
|
||||
|
||||
if(commit_files.empty())
|
||||
if(commit_files.empty() && !getWorkspace().otherChanges())
|
||||
return;
|
||||
|
||||
QStringList commit_msgs = settings.GetValue(FUEL_SETTING_COMMIT_MSG).toStringList();
|
||||
@ -1260,7 +1260,7 @@ void MainWindow::on_actionCommit_triggered()
|
||||
return;
|
||||
|
||||
// Since via the commit dialog the user can deselect all files
|
||||
if(commit_files.empty())
|
||||
if(commit_files.empty() && !getWorkspace().otherChanges())
|
||||
return;
|
||||
|
||||
// Do commit
|
||||
@ -2004,7 +2004,7 @@ void MainWindow::on_textBrowser_customContextMenuRequested(const QPoint &pos)
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_fileTableView_customContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
QPoint gpos = QCursor::pos();
|
||||
QPoint gpos = QCursor::pos() + QPoint(1, 1);
|
||||
#ifdef Q_OS_WIN
|
||||
if(qApp->keyboardModifiers() & Qt::SHIFT)
|
||||
{
|
||||
@ -2059,7 +2059,7 @@ void MainWindow::on_workspaceTreeView_customContextMenuRequested(const QPoint &)
|
||||
|
||||
if(menu)
|
||||
{
|
||||
QPoint pos = QCursor::pos();
|
||||
QPoint pos = QCursor::pos() + QPoint(1, 1);
|
||||
menu->popup(pos);
|
||||
}
|
||||
}
|
||||
@ -2301,20 +2301,23 @@ void MainWindow::MergeRevision(const QString &defaultRevision)
|
||||
QString revision = defaultRevision;
|
||||
|
||||
bool integrate = false;
|
||||
revision = UpdateDialog::runMerge(this, tr("Merge"), versionList, revision, integrate);
|
||||
bool force = false;
|
||||
revision = UpdateDialog::runMerge(this, tr("Merge"), versionList, revision, integrate, force);
|
||||
|
||||
if(revision.isEmpty())
|
||||
return;
|
||||
|
||||
// Do test merge
|
||||
if(!fossil().branchMerge(res, revision, integrate, true))
|
||||
if(!fossil().branchMerge(res, revision, integrate, force, true))
|
||||
return;
|
||||
|
||||
if(!FileActionDialog::run(this, tr("Merge"), tr("The following changesd will be made.")+"\n"+tr("Are you sure?"), res))
|
||||
return;
|
||||
|
||||
// Do update
|
||||
fossil().branchMerge(res, revision, integrate, false);
|
||||
fossil().branchMerge(res, revision, integrate, force, false);
|
||||
|
||||
log(tr("Merge completed. Don't forget to commit!")+"\n");
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ QString UpdateDialog::runUpdate(QWidget *parent, const QString &title, const QSt
|
||||
dlg.ui->lineName->setVisible(false);
|
||||
dlg.ui->lblIntegrate->setVisible(false);
|
||||
dlg.ui->chkIntegrate->setVisible(false);
|
||||
dlg.ui->lblForce->setVisible(false);
|
||||
dlg.ui->chkForce->setVisible(false);
|
||||
|
||||
dlg.adjustSize();
|
||||
|
||||
@ -41,7 +43,7 @@ QString UpdateDialog::runUpdate(QWidget *parent, const QString &title, const QSt
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QString UpdateDialog::runMerge(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, bool &integrate)
|
||||
QString UpdateDialog::runMerge(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, bool &integrate, bool &force)
|
||||
{
|
||||
UpdateDialog dlg(parent, completions, defaultValue);
|
||||
dlg.setWindowTitle(title);
|
||||
@ -50,12 +52,17 @@ QString UpdateDialog::runMerge(QWidget *parent, const QString &title, const QStr
|
||||
dlg.ui->lblIntegrate->setVisible(true);
|
||||
dlg.ui->chkIntegrate->setVisible(true);
|
||||
dlg.ui->chkIntegrate->setChecked(integrate);
|
||||
dlg.ui->lblForce->setVisible(true);
|
||||
dlg.ui->chkForce->setVisible(true);
|
||||
dlg.ui->chkForce->setChecked(force);
|
||||
|
||||
dlg.adjustSize();
|
||||
|
||||
if(dlg.exec() != QDialog::Accepted)
|
||||
return QString("");
|
||||
|
||||
integrate = dlg.ui->chkIntegrate->checkState() == Qt::Checked;
|
||||
force = dlg.ui->chkForce->checkState() == Qt::Checked;
|
||||
|
||||
return dlg.ui->cmbRevision->currentText().trimmed();
|
||||
}
|
||||
@ -71,6 +78,9 @@ bool UpdateDialog::runNewTag(QWidget *parent, const QString &title, const QStrin
|
||||
dlg.ui->lineName->setVisible(true);
|
||||
dlg.ui->lblIntegrate->setVisible(false);
|
||||
dlg.ui->chkIntegrate->setVisible(false);
|
||||
dlg.ui->lblForce->setVisible(false);
|
||||
dlg.ui->chkForce->setVisible(false);
|
||||
|
||||
dlg.adjustSize();
|
||||
|
||||
if(dlg.exec() != QDialog::Accepted)
|
||||
|
@ -17,7 +17,7 @@ public:
|
||||
~UpdateDialog();
|
||||
|
||||
static QString runUpdate(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue);
|
||||
static QString runMerge(QWidget* parent, const QString& title, const QStringList& completions, const QString& defaultValue, bool& integrate);
|
||||
static QString runMerge(QWidget* parent, const QString& title, const QStringList& completions, const QString& defaultValue, bool& integrate, bool& force);
|
||||
static bool runNewTag(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, QString &revision, QString &name);
|
||||
|
||||
private:
|
||||
|
@ -17,6 +17,10 @@ void Workspace::clearState()
|
||||
|
||||
getFiles().clear();
|
||||
getPaths().clear();
|
||||
stashMap.clear();
|
||||
branchList.clear();
|
||||
tags.clear();
|
||||
isIntegrated = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -184,7 +188,20 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie
|
||||
getPaths().insert(path);
|
||||
}
|
||||
|
||||
// Load the stash
|
||||
// Check if the repository needs integration
|
||||
res.clear();
|
||||
fossil().status(res);
|
||||
isIntegrated = false;
|
||||
foreach(const QString &l, res)
|
||||
{
|
||||
if(l.trimmed().indexOf("INTEGRATE")==0)
|
||||
{
|
||||
isIntegrated = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Load the stashes, branches and tags
|
||||
fossil().stashList(getStashes());
|
||||
|
||||
fossil().branchList(branchList, branchList);
|
||||
|
@ -123,6 +123,7 @@ public:
|
||||
stashmap_t &getStashes() { return stashMap; }
|
||||
QStringMap &getTags() { return tags; }
|
||||
QStringList &getBranches() { return branchList; }
|
||||
bool otherChanges() const { return isIntegrated; }
|
||||
|
||||
private:
|
||||
Fossil bridge;
|
||||
@ -131,6 +132,7 @@ private:
|
||||
stashmap_t stashMap;
|
||||
QStringList branchList;
|
||||
QStringMap tags;
|
||||
bool isIntegrated;
|
||||
|
||||
QStandardItemModel repoFileModel;
|
||||
QStandardItemModel repoDirModel;
|
||||
|
@ -10,7 +10,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>478</width>
|
||||
<height>146</height>
|
||||
<height>177</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
@ -56,6 +56,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblForce">
|
||||
<property name="text">
|
||||
<string>Force</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="chkIntegrate">
|
||||
<property name="text">
|
||||
@ -63,6 +70,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="chkForce">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user