1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
|
//------------------------------------------------------------------------------
void MainWindow::on_actionCommit_triggered()
{
QStringList commit_files;
getSelectionFilenames(commit_files, WorkspaceFile::TYPE_MODIFIED, true);
if(commit_files.empty())
return;
QStringList commit_msgs = settings.GetValue(FUEL_SETTING_COMMIT_MSG).toStringList();
QString msg;
bool aborted = !CommitDialog::run(this, tr("Commit Changes"), commit_files, msg, &commit_msgs);
// Aborted or not we always keep the commit messages.
// (This has saved me way too many times on TortoiseSVN)
if(commit_msgs.indexOf(msg)==-1)
{
commit_msgs.push_front(msg);
settings.SetValue(FUEL_SETTING_COMMIT_MSG, commit_msgs);
}
if(aborted)
return;
// Since via the commit dialog the user can deselect all files
if(commit_files.empty())
return;
// Do commit
QStringList files;
// When a subset of files has been selected, explicitely specify each file.
// Otherwise all files will be implicitly committed by fossil. This is necessary
|
|
|
|
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
|
//------------------------------------------------------------------------------
void MainWindow::on_actionCommit_triggered()
{
QStringList commit_files;
getSelectionFilenames(commit_files, WorkspaceFile::TYPE_MODIFIED, true);
if(commit_files.empty() && !getWorkspace().otherChanges())
return;
QStringList commit_msgs = settings.GetValue(FUEL_SETTING_COMMIT_MSG).toStringList();
QString msg;
bool aborted = !CommitDialog::run(this, tr("Commit Changes"), commit_files, msg, &commit_msgs);
// Aborted or not we always keep the commit messages.
// (This has saved me way too many times on TortoiseSVN)
if(commit_msgs.indexOf(msg)==-1)
{
commit_msgs.push_front(msg);
settings.SetValue(FUEL_SETTING_COMMIT_MSG, commit_msgs);
}
if(aborted)
return;
// Since via the commit dialog the user can deselect all files
if(commit_files.empty() && !getWorkspace().otherChanges())
return;
// Do commit
QStringList files;
// When a subset of files has been selected, explicitely specify each file.
// Otherwise all files will be implicitly committed by fossil. This is necessary
|
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
|
menu->addAction(ui->actionClearLog);
menu->popup(ui->textBrowser->mapToGlobal(pos));
}
//------------------------------------------------------------------------------
void MainWindow::on_fileTableView_customContextMenuRequested(const QPoint &pos)
{
QPoint gpos = QCursor::pos();
#ifdef Q_OS_WIN
if(qApp->keyboardModifiers() & Qt::SHIFT)
{
ui->fileTableView->selectionModel()->select(ui->fileTableView->indexAt(pos), QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows);
QStringList fnames;
getSelectionFilenames(fnames);
|
|
|
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
|
menu->addAction(ui->actionClearLog);
menu->popup(ui->textBrowser->mapToGlobal(pos));
}
//------------------------------------------------------------------------------
void MainWindow::on_fileTableView_customContextMenuRequested(const QPoint &pos)
{
QPoint gpos = QCursor::pos() + QPoint(1, 1);
#ifdef Q_OS_WIN
if(qApp->keyboardModifiers() & Qt::SHIFT)
{
ui->fileTableView->selectionModel()->select(ui->fileTableView->indexAt(pos), QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows);
QStringList fnames;
getSelectionFilenames(fnames);
|
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
|
else if (tv.Type == TreeViewItem::TYPE_TAG || tv.Type == TreeViewItem::TYPE_TAGS)
menu = menuTags;
else if (tv.Type == TreeViewItem::TYPE_BRANCH || tv.Type == TreeViewItem::TYPE_BRANCHES)
menu = menuBranches;
if(menu)
{
QPoint pos = QCursor::pos();
menu->popup(pos);
}
}
//------------------------------------------------------------------------------
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
{
|
|
|
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
|
else if (tv.Type == TreeViewItem::TYPE_TAG || tv.Type == TreeViewItem::TYPE_TAGS)
menu = menuTags;
else if (tv.Type == TreeViewItem::TYPE_BRANCH || tv.Type == TreeViewItem::TYPE_BRANCHES)
menu = menuBranches;
if(menu)
{
QPoint pos = QCursor::pos() + QPoint(1, 1);
menu->popup(pos);
}
}
//------------------------------------------------------------------------------
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
{
|
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
|
//------------------------------------------------------------------------------
void MainWindow::MergeRevision(const QString &defaultRevision)
{
QStringList res;
QString revision = defaultRevision;
bool integrate = false;
revision = UpdateDialog::runMerge(this, tr("Merge"), versionList, revision, integrate);
if(revision.isEmpty())
return;
// Do test merge
if(!fossil().branchMerge(res, revision, integrate, 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);
refresh();
}
//------------------------------------------------------------------------------
void MainWindow::on_actionMergeBranch_triggered()
{
QString revision;
if(!selectedBranches.isEmpty())
revision = selectedBranches.first();
MergeRevision(revision);
}
|
>
|
|
|
>
>
|
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
|
//------------------------------------------------------------------------------
void MainWindow::MergeRevision(const QString &defaultRevision)
{
QStringList res;
QString revision = defaultRevision;
bool integrate = false;
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, 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, force, false);
log(tr("Merge completed. Don't forget to commit!")+"\n");
refresh();
}
//------------------------------------------------------------------------------
void MainWindow::on_actionMergeBranch_triggered()
{
QString revision;
if(!selectedBranches.isEmpty())
revision = selectedBranches.first();
MergeRevision(revision);
}
|