From cc029b674feff64a0d3a17d3d2e96e247e8bba1c Mon Sep 17 00:00:00 2001 From: kostas Date: Sat, 2 May 2015 18:22:31 +0000 Subject: [PATCH] Parse the workspace active tags and revision FossilOrigin-Name: 2bf8e2a8aba307659c07044e1e6d155d287ac6b6 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/Fossil.cpp | 25 +++++++++++++++++++++++++ src/Fossil.h | 9 +++++++++ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 76f6533..7f61a0f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Added\s"Update\sto\sRevision"\sAction\n -D 2015-05-02T16:42:06.752 +C Parse\sthe\sworkspace\sactive\stags\sand\srevision\n +D 2015-05-02T18:22:31.909 F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b @@ -196,8 +196,8 @@ F src/FileActionDialog.cpp fcaebf9986f789b3440d5390b3458ad5f86fe0c8 F src/FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2 F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df -F src/Fossil.cpp 35ee3e88a14e6673e991a3c743a4fa7ab5697a24 -F src/Fossil.h 7c91732020730f33e50663b0e5c66e6c35ad5cdc +F src/Fossil.cpp 8abdf4c95dfd2728fb11a2a07ea5c05eabba27d6 +F src/Fossil.h 7954818fa3168d56901f8549ca5ae56987f48a6a F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 F src/MainWindow.cpp 8ae32de39af8917cdb5a5c7efc221da4a61154a1 @@ -220,7 +220,7 @@ F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d F ui/MainWindow.ui 798a40a0fd715b0544f608543e09038e2b1fb69a F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b F ui/UpdateDialog.ui 129596c2deb60211f25cefd785696ca7c7c56d42 -P 330e0819bba257c674afdadb1ab097cd7f7ffe61 -R 44924937e1415e3426bc0d8efcc11b99 +P 203cae37a6553c26a3844dcfdd3386eae9be288f +R f1ac3114a2193bf3db758206b5ce489e U kostas -Z 30db0249ce1d6def72f41fe542e3c03a +Z 9e4990ffad6b2eda98502a8702251545 diff --git a/manifest.uuid b/manifest.uuid index 07b1594..fd1be95 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -203cae37a6553c26a3844dcfdd3386eae9be288f \ No newline at end of file +2bf8e2a8aba307659c07044e1e6d155d287ac6b6 \ No newline at end of file diff --git a/src/Fossil.cpp b/src/Fossil.cpp index b786e54..2d5ea6f 100644 --- a/src/Fossil.cpp +++ b/src/Fossil.cpp @@ -50,6 +50,21 @@ RepoStatus Fossil::getRepoStatus() projectName = value; else if(key=="repository") repositoryFile = value; + else if(key=="checkout") + { + // f2121dad5e4565f55ed9ef882484dd5934af565f 2015-04-26 17:27:39 UTC + QStringList tokens = value.split(' ', QString::SkipEmptyParts); + Q_ASSERT(tokens.length()>0); + currentRevision = tokens[0].trimmed(); + } + else if(key=="tags") + { + currentTags.clear(); + QStringList tokens = value.split(',', QString::SkipEmptyParts); + foreach(const QString &tag, tokens) + currentTags.append(tag); + currentTags.sort(); + } } } @@ -444,6 +459,16 @@ bool Fossil::tagList(QStringList& tags) return true; } +//------------------------------------------------------------------------------ +bool Fossil::tagNew(const QString& name, const QString& revision) +{ + QStringList res; + + if(!runFossil(QStringList() << "tag" << "add" << name << revision, &res, RUNFLAGS_SILENT_ALL)) + return false; + return true; +} + //------------------------------------------------------------------------------ bool Fossil::branchList(QStringList& branches, QStringList& activeBranches) { diff --git a/src/Fossil.h b/src/Fossil.h index 9b0da68..b34f77f 100644 --- a/src/Fossil.h +++ b/src/Fossil.h @@ -3,6 +3,7 @@ class QStringList; #include +#include #include #include #include "Utils.h" @@ -111,8 +112,14 @@ public: void abortOperation() { operationAborted = true; } bool tagList(QStringList& tags); + bool tagNew(const QString& name, const QString& revision); + bool tagDelete(const QString& name); + bool branchList(QStringList& branches, QStringList& activeBranches); + const QString &getCurrentRevision() const { return currentRevision; } + const QStringList &getCurrentTags() const { return currentTags; } + private: void log(const QString &text, bool isHTML=false) { @@ -128,6 +135,8 @@ private: QString fossilPath; // The value from the settings QString repositoryFile; QString projectName; + QString currentRevision; + QStringList currentTags; QProcess fossilUI; };