Mercurial > hg > easyhg
comparison 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 |
comparison
equal
deleted
inserted
replaced
107:fdca34c989c0 | 108:8ae3b44c0073 |
---|---|
23 #include <QStringList> | 23 #include <QStringList> |
24 #include <QList> | 24 #include <QList> |
25 #include <QSharedPointer> | 25 #include <QSharedPointer> |
26 | 26 |
27 #include "logparser.h" | 27 #include "logparser.h" |
28 | |
29 class Changeset; | |
30 | |
31 typedef QList<Changeset *> Changesets; //!!! should be QList<QSharedPointer<Changeset> > | |
28 | 32 |
29 class Changeset : public QObject | 33 class Changeset : public QObject |
30 { | 34 { |
31 Q_OBJECT | 35 Q_OBJECT |
32 | 36 |
67 | 71 |
68 QString date() const { | 72 QString date() const { |
69 return datetime().split(' ')[0]; | 73 return datetime().split(' ')[0]; |
70 } | 74 } |
71 | 75 |
76 bool isOnBranch(QString branch) { | |
77 QString b = m_branch; | |
78 if (branch == "") branch = "default"; | |
79 if (b == "") b = "default"; | |
80 if (branch == b) return true; | |
81 return false; | |
82 } | |
83 | |
84 static Changesets parseChangesets(QString logText) { | |
85 Changesets csets; | |
86 LogList log = LogParser(logText).parse(); | |
87 foreach (LogEntry e, log) { | |
88 csets.push_back(new Changeset(e)); | |
89 } | |
90 return csets; | |
91 } | |
92 | |
72 signals: | 93 signals: |
73 void idChanged(QString id); | 94 void idChanged(QString id); |
74 void authorChanged(QString author); | 95 void authorChanged(QString author); |
75 void branchChanged(QString branch); | 96 void branchChanged(QString branch); |
76 void tagChanged(QString tag); | 97 void tagChanged(QString tag); |
105 QStringList m_parents; | 126 QStringList m_parents; |
106 QStringList m_children; | 127 QStringList m_children; |
107 QString m_comment; | 128 QString m_comment; |
108 }; | 129 }; |
109 | 130 |
110 typedef QList<Changeset *> Changesets; | |
111 | 131 |
112 #endif // CHANGESET_H | 132 #endif // CHANGESET_H |