# HG changeset patch # User Ludovic Chabant # Date 1362034511 28800 # Node ID 05d0a7cd85e827b2eba21ecf885bfa4bd8ff9a64 # Parent 91c5ea6e90275efdc9cbc7f03a1ec624369aa5ce Fixed site-wide history page. TODO: Add ability to show diffs. diff -r 91c5ea6e9027 -r 05d0a7cd85e8 static/tpl/special-changes.html --- a/static/tpl/special-changes.html Wed Feb 27 22:13:42 2013 -0800 +++ b/static/tpl/special-changes.html Wed Feb 27 22:55:11 2013 -0800 @@ -6,31 +6,37 @@ - - - - - - + + {{#eachr history}} - - - + - - {{/eachr}} diff -r 91c5ea6e9027 -r 05d0a7cd85e8 wikked/scm.py --- a/wikked/scm.py Wed Feb 27 22:13:42 2013 -0800 +++ b/wikked/scm.py Wed Feb 27 22:55:11 2013 -0800 @@ -71,6 +71,11 @@ def __init__(self, root, logger=None): SourceControl.__init__(self, logger) self.root = root + self.actions = { + 'A': ACTION_ADD, + 'R': ACTION_DELETE, + 'M': ACTION_EDIT + } def initRepo(self): # Make a Mercurial repo if there's none. @@ -107,11 +112,6 @@ self.hg = 'hg' self.log_style = os.path.join(os.path.dirname(__file__), 'resources', 'hg_log.style') - self.actions = { - 'A': ACTION_ADD, - 'R': ACTION_DELETE, - 'M': ACTION_EDIT - } def getHistory(self, path=None): if path is not None: @@ -211,7 +211,10 @@ for j in range(i + 1, len(lines)): if lines[j] == '': continue - rev.files.append({'path': lines[j][2:], 'action': self.actions[lines[j][0]]}) + rev.files.append({ + 'path': lines[j][2:], + 'action': self.actions[lines[j][0]] + }) return rev @@ -230,10 +233,12 @@ if len(status) > 0 and status[0] == '?': return [] + needs_files = False if path is not None: - repo_revs = self.client.log(files=[path]) + repo_revs = self.client.log(files=[path], follow=True) else: - repo_revs = self.client.log() + needs_files = True + repo_revs = self.client.log(follow=True) revisions = [] for rev in repo_revs: r = Revision(rev.node) @@ -241,6 +246,13 @@ r.author = rev.author r.timestamp = time.mktime(rev.date.timetuple()) r.description = rev.desc + if needs_files: + rev_statuses = self.client.status(change=rev.node) + for rev_status in rev_statuses: + r.files.append({ + 'path': rev_status[1], + 'action': self.actions[rev_status[0]] + }) revisions.append(r) return revisions
Rev.DateAuthorChangesCommentRevisionInformation
{{rev_id}}{{date timestamp}}{{author}}{{rev_name}} - {{#each changes}} - {{url}} - {{#if is_edit}}(edit) {{/if}} - {{#if is_add}}(added) {{/if}} - {{#if is_delete}}(deleted) {{/if}} -
- {{/each}} +
+
Date
+
{{date_from_now timestamp}}
+
Author
+
{{author}}
+
Pages
+
+
    + {{#each changes}} +
  • + {{url}} + {{#if is_edit}}(edit) {{/if}} + {{#if is_add}}(added) {{/if}} + {{#if is_delete}}(deleted) {{/if}} +
  • + {{/each}} +
+
+
Comment
+
{{description}}
+
{{description}}