Wrapped "add" and "remove"
FossilOrigin-Name: 1284b0abf55c359e79d4953a00da1de2cebb6a31
This commit is contained in:
parent
a7e759e6a6
commit
04a5bb2488
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Wrapped\s"clone"\s"diff"\s"commit"
|
||||
D 2015-04-26T18:55:05.691
|
||||
C Wrapped\s"add"\sand\s"remove"
|
||||
D 2015-04-26T19:14:09.179
|
||||
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 08019d2826accd56f370981aba8ede3f04c82ccf
|
||||
F src/Bridge.h 329b3e81008d779f4d100f370b41601d49ca025a
|
||||
F src/Bridge.cpp 7229111e00e0f5392dc46787ccb31fa78749aba4
|
||||
F src/Bridge.h 77ab136b2c01c202e921adca6cb9b3c2a64d13ef
|
||||
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 9016287b46f4d057ea84f438b043723ae611367a
|
||||
F src/MainWindow.cpp 58f21bcd22e693ecfc3f6e60d935f1b5ebd7b87d
|
||||
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 ab5fd401a09cc503168a86761b95c28e52d2875a
|
||||
R 7a32a7081f2b847eaec01d12ff3d24ec
|
||||
P 1207f87a560c9d077c00367a4270c693f7cceee0
|
||||
R f1168e323d10e3f76816f649be9ae8e0
|
||||
U kostas
|
||||
Z e11abbb88941df5fe0d707b72a7e29b8
|
||||
Z 2bb18d4aa34df09c3543cc10ff0cbe33
|
||||
|
@ -1 +1 @@
|
||||
1207f87a560c9d077c00367a4270c693f7cceee0
|
||||
1284b0abf55c359e79d4953a00da1de2cebb6a31
|
@ -196,6 +196,39 @@ bool Bridge::commitFiles(const QStringList& fileList, const QString& comment)
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Bridge::addFiles(const QStringList& fileList)
|
||||
{
|
||||
if(fileList.empty())
|
||||
return false;
|
||||
|
||||
// Do Add
|
||||
return runFossil(QStringList() << "add" << QuotePaths(fileList));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Bridge::removeFiles(const QStringList& fileList, bool deleteLocal)
|
||||
{
|
||||
if(fileList.empty())
|
||||
return false;
|
||||
|
||||
// Do Delete
|
||||
if(!runFossil(QStringList() << "delete" << QuotePaths(fileList)))
|
||||
return false;
|
||||
|
||||
if(deleteLocal)
|
||||
{
|
||||
for(int i=0; i<fileList.size(); ++i)
|
||||
{
|
||||
QFileInfo fi(getCurrentWorkspace() + QDir::separator() + fileList[i]);
|
||||
if(fi.exists())
|
||||
QFile::remove(fi.filePath());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Bridge::stashList(stashmap_t& stashes)
|
||||
{
|
||||
|
@ -98,9 +98,8 @@ public:
|
||||
bool stashList(stashmap_t &stashes);
|
||||
bool diffFile(const QString &repoFile);
|
||||
bool commitFiles(const QStringList &fileList, const QString &comment);
|
||||
|
||||
|
||||
|
||||
bool addFiles(const QStringList& fileList);
|
||||
bool removeFiles(const QStringList& fileList, bool deleteLocal);
|
||||
private:
|
||||
void log(const QString &text, bool isHTML=false)
|
||||
{
|
||||
|
@ -2039,7 +2039,11 @@ void MainWindow::on_actionAdd_triggered()
|
||||
return;
|
||||
|
||||
// Do Add
|
||||
#ifndef BRIDGE_ENABLED
|
||||
runFossil(QStringList() << "add" << QuotePaths(selection) );
|
||||
#else
|
||||
bridge.addFiles(selection);
|
||||
#endif
|
||||
|
||||
refresh();
|
||||
}
|
||||
@ -2063,6 +2067,7 @@ void MainWindow::on_actionDelete_triggered()
|
||||
if(!FileActionDialog::run(this, tr("Remove files"), tr("The following files will be removed from the repository.")+"\n"+tr("Are you sure?"), all_files, tr("Also delete the local files"), &remove_local ))
|
||||
return;
|
||||
|
||||
#ifndef BRIDGE_ENABLED
|
||||
if(!repo_files.empty())
|
||||
{
|
||||
// Do Delete
|
||||
@ -2079,6 +2084,22 @@ void MainWindow::on_actionDelete_triggered()
|
||||
QFile::remove(fi.filePath());
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Remove repository files
|
||||
if(!repo_files.empty())
|
||||
bridge.removeFiles(repo_files, remove_local);
|
||||
|
||||
// Remove unknown local files if selected
|
||||
if(remove_local)
|
||||
{
|
||||
for(int i=0; i<unknown_files.size(); ++i)
|
||||
{
|
||||
QFileInfo fi(getCurrentWorkspace() + QDir::separator() + unknown_files[i]);
|
||||
if(fi.exists())
|
||||
QFile::remove(fi.filePath());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user