Wrapped "revert" "rename" "undo"
FossilOrigin-Name: 09f2c8f44189b490da880f56011b95fae223a5a9
This commit is contained in:
parent
04a5bb2488
commit
1f8a533096
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Wrapped\s"add"\sand\s"remove"
|
||||
D 2015-04-26T19:14:09.179
|
||||
C Wrapped\s"revert"\s"rename"\s"undo"
|
||||
D 2015-04-26T19:32:41.271
|
||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||
@ -184,8 +184,8 @@ F rsrc/icons/fuel.icns 81e535004b62db801a02f3e15d0a33afc9d4070b
|
||||
F rsrc/icons/fuel.ico eb529ab3332a17b9302ef3e851db5b9ebce2a038
|
||||
F rsrc/icons/fuel.png 40daf53b7f6bdcdd0d6aa5ef433d078ec5ea4342
|
||||
F rsrc/resources.qrc 4098be128fd6c045db933d041fe8844b14643a6f
|
||||
F src/Bridge.cpp 7229111e00e0f5392dc46787ccb31fa78749aba4
|
||||
F src/Bridge.h 77ab136b2c01c202e921adca6cb9b3c2a64d13ef
|
||||
F src/Bridge.cpp 943994a2cb3e181bf58f0a8b4a8ba56e44d0da8f
|
||||
F src/Bridge.h 6dc336ac0877ae51de668c42d60e0874c5820d72
|
||||
F src/BrowserWidget.cpp 8b8f545cdff4a4188edc698a1b4777f5df46f056
|
||||
F src/BrowserWidget.h 764d66aa9a93b890298bd0301097739cb4e16597
|
||||
F src/CloneDialog.cpp 812ef7d361c16da21540b7047c9d4d5e74f18539
|
||||
@ -200,7 +200,7 @@ F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
||||
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||
F src/MainWindow.cpp 58f21bcd22e693ecfc3f6e60d935f1b5ebd7b87d
|
||||
F src/MainWindow.cpp a44f5c8bee45621cce49a2b10f4393ec54d630e2
|
||||
F src/MainWindow.h a727aea9b2b453c79682f61157b38a76a873060a
|
||||
F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4
|
||||
F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43
|
||||
@ -215,7 +215,7 @@ F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f
|
||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||
F ui/MainWindow.ui 8677f5c8bca5bf7561d5f64bfdd0cef5157c6ac7
|
||||
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
|
||||
P 1207f87a560c9d077c00367a4270c693f7cceee0
|
||||
R f1168e323d10e3f76816f649be9ae8e0
|
||||
P 1284b0abf55c359e79d4953a00da1de2cebb6a31
|
||||
R ef26df4ff23cffb54b79b80643d10861
|
||||
U kostas
|
||||
Z 2bb18d4aa34df09c3543cc10ff0cbe33
|
||||
Z 0ab9d2c4bc0bb974d8abd63068614dd5
|
||||
|
@ -1 +1 @@
|
||||
1284b0abf55c359e79d4953a00da1de2cebb6a31
|
||||
09f2c8f44189b490da880f56011b95fae223a5a9
|
@ -229,6 +229,45 @@ bool Bridge::removeFiles(const QStringList& fileList, bool deleteLocal)
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Bridge::revertFiles(const QStringList& fileList)
|
||||
{
|
||||
if(fileList.empty())
|
||||
return false;
|
||||
|
||||
// Do Revert
|
||||
return runFossil(QStringList() << "revert" << QuotePaths(fileList));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Bridge::renameFile(const QString &beforePath, const QString &afterPath)
|
||||
{
|
||||
// Ensure we can rename the file
|
||||
if(!QFileInfo(beforePath).exists() || QFileInfo(afterPath).exists())
|
||||
return false;
|
||||
|
||||
// Do Rename
|
||||
if(!runFossil(QStringList() << "mv" << QuotePath(beforePath) << QuotePath(afterPath)))
|
||||
return false;
|
||||
|
||||
QString wkdir = getCurrentWorkspace() + QDir::separator();
|
||||
|
||||
// Also rename the file
|
||||
return QFile::rename(wkdir+beforePath, wkdir+afterPath);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Bridge::undo(QStringList &result, bool explainOnly)
|
||||
{
|
||||
QStringList params;
|
||||
params << "undo";
|
||||
|
||||
if(explainOnly)
|
||||
params << "--explain";
|
||||
|
||||
return runFossil(params, &result);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Bridge::stashList(stashmap_t& stashes)
|
||||
{
|
||||
|
@ -100,6 +100,9 @@ public:
|
||||
bool commitFiles(const QStringList &fileList, const QString &comment);
|
||||
bool addFiles(const QStringList& fileList);
|
||||
bool removeFiles(const QStringList& fileList, bool deleteLocal);
|
||||
bool revertFiles(const QStringList& fileList);
|
||||
bool renameFile(const QString& beforePath, const QString& afterPath);
|
||||
bool undo(QStringList& result, bool explainOnly);
|
||||
private:
|
||||
void log(const QString &text, bool isHTML=false)
|
||||
{
|
||||
|
@ -2117,7 +2117,11 @@ void MainWindow::on_actionRevert_triggered()
|
||||
return;
|
||||
|
||||
// Do Revert
|
||||
#ifndef BRIDGE_ENABLED
|
||||
runFossil(QStringList() << "revert" << QuotePaths(modified_files) );
|
||||
#else
|
||||
bridge.revertFiles(modified_files);
|
||||
#endif
|
||||
|
||||
refresh();
|
||||
}
|
||||
@ -2146,13 +2150,17 @@ void MainWindow::on_actionRename_triggered()
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef BRIDGE_ENABLED
|
||||
// Do Rename
|
||||
runFossil(QStringList() << "mv" << QuotePath(fi_before.filePath()) << QuotePath(fi_after.filePath()) );
|
||||
|
||||
QString wkdir = getCurrentWorkspace() + QDir::separator();
|
||||
|
||||
// Also rename the file
|
||||
QFile::rename( wkdir+fi_before.filePath(), wkdir+fi_after.filePath());
|
||||
QFile::rename(wkdir+fi_before.filePath(), wkdir+fi_after.filePath());
|
||||
#else
|
||||
bridge.renameFile(fi_before.filePath(), fi_after.filePath());
|
||||
#endif
|
||||
|
||||
refresh();
|
||||
}
|
||||
@ -2183,6 +2191,7 @@ void MainWindow::on_actionUndo_triggered()
|
||||
// Gather Undo actions
|
||||
QStringList res;
|
||||
|
||||
#ifndef BRIDGE_ENABLED
|
||||
if(!runFossil(QStringList() << "undo" << "--explain", &res ))
|
||||
return;
|
||||
|
||||
@ -2194,6 +2203,18 @@ void MainWindow::on_actionUndo_triggered()
|
||||
|
||||
// Do Undo
|
||||
runFossil(QStringList() << "undo" );
|
||||
#else
|
||||
bridge.undo(res, true);
|
||||
|
||||
if(res.length()>0 && res[0]=="No undo or redo is available")
|
||||
return;
|
||||
|
||||
if(!FileActionDialog::run(this, tr("Undo"), tr("The following actions will be undone.")+"\n"+tr("Are you sure?"), res))
|
||||
return;
|
||||
|
||||
// Do Undo
|
||||
bridge.undo(res, false);
|
||||
#endif
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user