Skip to content

Commit

Permalink
Merge pull request #46 from lbolla/issue45
Browse files Browse the repository at this point in the history
Fix #45 Add date to log
  • Loading branch information
lbolla committed Feb 23, 2017
2 parents 9885717 + 8fd24e3 commit 22efc4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 13 additions & 3 deletions monky.el
Expand Up @@ -231,6 +231,11 @@ Many Monky faces inherit from this one by default."
"Face for phase label shown in log buffer."
:group 'monky-faces)

(defface monky-log-date
'((t :weight bold :inherit monky-header))
"Face for date in log."
:group 'monky-faces)

(defface monky-queue-active
'((((class color) (background light))
:box t
Expand Down Expand Up @@ -2037,11 +2042,13 @@ PROPERTIES is the arguments for the function `propertize'."
(list (apply #'propertize l properties) " ")))
label-list))))

(defun monky-present-log-line (graph id branches tags bookmarks phase message)
(defun monky-present-log-line (graph id branches tags bookmarks phase date message)
(concat
(propertize (substring id 0 8) 'face 'monky-log-sha1)
" "
graph
(propertize date 'face 'monky-log-date)
" "
(monky-propertize-labels branches 'face 'monky-log-head-label-local)
(monky-propertize-labels tags 'face 'monky-log-head-label-tags)
(monky-propertize-labels bookmarks 'face 'monky-log-head-label-bookmarks)
Expand All @@ -2067,7 +2074,8 @@ PROPERTIES is the arguments for the function `propertize'."
"<tags>\\(.?*\\)</tags>" ; 4. tags
"<bookmarks>\\(.?*\\)</bookmarks>" ; 5. bookmarks
"<phase>\\(.?*\\)</phase>" ; 6. phase
"\\(.*\\)$" ; 7. msg
"<date>\\([0-9\-]\\{10\\}\\)</date>" ; 7. date
"\\(.*\\)$" ; 8. msg
))

(defun monky-decode-xml-entities (str)
Expand Down Expand Up @@ -2096,7 +2104,8 @@ Example:
(tags (match-string 4))
(bookmarks (match-string 5))
(phase (match-string 6))
(msg (match-string 7)))
(date (match-string 7))
(msg (match-string 8)))
(monky-delete-line)
(monky-with-section id 'commit
(insert (monky-present-log-line
Expand All @@ -2105,6 +2114,7 @@ Example:
(monky-xml-items-to-list tags "tag")
(monky-xml-items-to-list bookmarks "bookmark")
(monky-decode-xml-entities phase)
(monky-decode-xml-entities date)
(monky-decode-xml-entities msg)))
(monky-set-section-info id)
(when monky-log-count (incf monky-log-count))
Expand Down
3 changes: 2 additions & 1 deletion style/log-graph
@@ -1,5 +1,6 @@
changeset = "{node} <branches>{branches}</branches><tags>{tags}</tags><bookmarks>{bookmarks}</bookmarks><phase>{phase|escape}</phase>{desc|firstline}\n"
changeset = "{node} <branches>{branches}</branches><tags>{tags}</tags><bookmarks>{bookmarks}</bookmarks><phase>{phase|escape}</phase><date>{date|shortdate}</date>{desc|firstline}\n"

branch = '<branch>{branch|escape}</branch>'
tag = '<tag>{tag|escape}</tag>'
bookmark = '<bookmark>{bookmark|escape}</bookmark>'
date = '<date>{date|shortdate}</date>'

0 comments on commit 22efc4d

Please sign in to comment.