20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include "FileActionDialog.h"
#include "CloneDialog.h"
#include "RevisionDialog.h"
#include "RemoteDialog.h"
#include "AboutDialog.h"
#include "Utils.h"
#define REVISION_LATEST "Latest revision"
//-----------------------------------------------------------------------------
enum
{
COLUMN_STATUS,
COLUMN_FILENAME,
COLUMN_EXTENSION,
COLUMN_MODIFIED,
|
<
<
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "FileActionDialog.h"
#include "CloneDialog.h"
#include "RevisionDialog.h"
#include "RemoteDialog.h"
#include "AboutDialog.h"
#include "Utils.h"
//-----------------------------------------------------------------------------
enum
{
COLUMN_STATUS,
COLUMN_FILENAME,
COLUMN_EXTENSION,
COLUMN_MODIFIED,
|
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
|
{
return DialogQuery(mainWindow, title, query, buttons);
}
//------------------------------------------------------------------------------
void MainWindow::updateRevision(const QString &revision)
{
const QString latest = tr(REVISION_LATEST);
QString defaultval = latest;
if(!revision.isEmpty())
defaultval = revision;
QString selected_revision = RevisionDialog::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(!getWorkspace().fossil().updateWorkspace(res, selected_revision, true))
{
QMessageBox::critical(this, tr("Error"), tr("Could not update the repository."), QMessageBox::Ok);
return;
}
if(res.length()==0)
return;
QStringMap kv;
ParseProperties(kv, res, ':');
// If no changes exit
if(kv.contains("changes") && kv["changes"].indexOf("None.")!=-1)
return;
if(!FileActionDialog::run(this, tr("Update"), tr("The following files will be updated.")+"\n"+tr("Are you sure?"), res))
return;
|
|
>
>
>
>
|
>
>
|
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
|
{
return DialogQuery(mainWindow, title, query, buttons);
}
//------------------------------------------------------------------------------
void MainWindow::updateRevision(const QString &revision)
{
const QString latest = tr("<Latest Revision>");
QString defaultval = latest;
if(!revision.isEmpty())
defaultval = revision;
// Also include our "Latest Revision" to the version list
QStringList versions = versionList;
versions.push_front(latest);
QString selected_revision = RevisionDialog::runUpdate(this, tr("Update workspace"), versions, defaultval).trimmed();
// Nothing selected ?
if(selected_revision.isEmpty())
return;
else if(selected_revision == latest)
selected_revision = ""; // Empty revision is "latest"
QStringList res;
// Do test update
if(!getWorkspace().fossil().updateWorkspace(res, selected_revision, true))
{
QMessageBox::critical(this, tr("Error"), tr("Could not update the repository."), QMessageBox::Ok);
return;
}
if(res.length()==0)
return;
QStringMap kv;
ParseProperties(kv, res, ':');
// If no changes exit
if(kv.contains("changes") && kv["changes"].indexOf("None.")!=-1)
return;
if(!FileActionDialog::run(this, tr("Update"), tr("The following files will be updated.")+"\n"+tr("Are you sure?"), res))
return;
|