Mercurial > hg > easyhg
comparison src/changeset.cpp @ 520:a17c06f773cd
idiot -- we don't need to query bookmarks separately, we can just add them to the log template
author | Chris Cannam |
---|---|
date | Wed, 09 Nov 2011 13:04:00 +0000 |
parents | c623ce6b3104 |
children | b5a342a71218 |
comparison
equal
deleted
inserted
replaced
519:000f13faa089 | 520:a17c06f773cd |
---|---|
31 setParents(parents); | 31 setParents(parents); |
32 } else if (key == "tag") { | 32 } else if (key == "tag") { |
33 QStringList tags = e.value(key).split | 33 QStringList tags = e.value(key).split |
34 (" ", QString::SkipEmptyParts); | 34 (" ", QString::SkipEmptyParts); |
35 setTags(tags); | 35 setTags(tags); |
36 } else if (key == "bookmarks") { | |
37 QStringList bmarks = e.value(key).split | |
38 (" ", QString::SkipEmptyParts); | |
39 setBookmarks(bmarks); | |
36 } else if (key == "timestamp") { | 40 } else if (key == "timestamp") { |
37 setTimestamp(e.value(key).split(" ")[0].toULongLong()); | 41 setTimestamp(e.value(key).split(" ")[0].toULongLong()); |
38 } else if (key == "changeset") { | 42 } else if (key == "changeset") { |
39 setId(e.value(key)); | 43 setId(e.value(key)); |
40 } else { | 44 } else { |
43 } | 47 } |
44 } | 48 } |
45 | 49 |
46 QString Changeset::getLogTemplate() | 50 QString Changeset::getLogTemplate() |
47 { | 51 { |
48 return "id: {rev}:{node|short}\\nauthor: {author}\\nbranch: {branches}\\ntag: {tags}\\ndatetime: {date|isodate}\\ntimestamp: {date|hgdate}\\nage: {date|age}\\nparents: {parents}\\ncomment: {desc|json}\\n\\n"; | 52 return "id: {rev}:{node|short}\\nauthor: {author}\\nbranch: {branches}\\ntag: {tags}\\nbookmarks: {bookmarks}\\ndatetime: {date|isodate}\\ntimestamp: {date|hgdate}\\nage: {date|age}\\nparents: {parents}\\ncomment: {desc|json}\\n\\n"; |
49 } | 53 } |
50 | 54 |
51 QString Changeset::formatHtml() | 55 QString Changeset::formatHtml() |
52 { | 56 { |
53 QString description; | 57 QString description; |
69 propNames << "id" | 73 propNames << "id" |
70 << "author" | 74 << "author" |
71 << "datetime" | 75 << "datetime" |
72 << "branch" | 76 << "branch" |
73 << "tags" | 77 << "tags" |
78 << "bookmarks" | |
74 << "comment"; | 79 << "comment"; |
75 | 80 |
76 propTexts << QObject::tr("Identifier:") | 81 propTexts << QObject::tr("Identifier:") |
77 << QObject::tr("Author:") | 82 << QObject::tr("Author:") |
78 << QObject::tr("Date:") | 83 << QObject::tr("Date:") |
87 value = hashOf(id()); | 92 value = hashOf(id()); |
88 } else if (prop == "comment") { | 93 } else if (prop == "comment") { |
89 value = c; | 94 value = c; |
90 } else if (prop == "tags") { | 95 } else if (prop == "tags") { |
91 value = tags().join(" "); | 96 value = tags().join(" "); |
97 } else if (prop == "bookmarks") { | |
98 value = bookmarks().join(" "); | |
92 } else { | 99 } else { |
93 value = xmlEncode(property(prop.toLocal8Bit().data()).toString()); | 100 value = xmlEncode(property(prop.toLocal8Bit().data()).toString()); |
94 } | 101 } |
95 if (value != "") { | 102 if (value != "") { |
96 description += rowTemplate | 103 description += rowTemplate |