Mercurial > hg > easyhg
diff changeset.h @ 108:8ae3b44c0073
* Enable/disable update and merge actions depending on whether default update and merge will actually do anything
author | Chris Cannam |
---|---|
date | Thu, 25 Nov 2010 21:08:17 +0000 |
parents | 729438d70af8 |
children | 3afa1ce339ec |
line wrap: on
line diff
--- a/changeset.h Thu Nov 25 20:18:10 2010 +0000 +++ b/changeset.h Thu Nov 25 21:08:17 2010 +0000 @@ -26,6 +26,10 @@ #include "logparser.h" +class Changeset; + +typedef QList<Changeset *> Changesets; //!!! should be QList<QSharedPointer<Changeset> > + class Changeset : public QObject { Q_OBJECT @@ -69,6 +73,23 @@ return datetime().split(' ')[0]; } + bool isOnBranch(QString branch) { + QString b = m_branch; + if (branch == "") branch = "default"; + if (b == "") b = "default"; + if (branch == b) return true; + return false; + } + + static Changesets parseChangesets(QString logText) { + Changesets csets; + LogList log = LogParser(logText).parse(); + foreach (LogEntry e, log) { + csets.push_back(new Changeset(e)); + } + return csets; + } + signals: void idChanged(QString id); void authorChanged(QString author); @@ -107,6 +128,5 @@ QString m_comment; }; -typedef QList<Changeset *> Changesets; #endif // CHANGESET_H