mercurial: show phases status in changelog.

- ref #5265
This commit is contained in:
Marcin Kuzminski 2017-04-20 20:56:16 +02:00
parent 7515b25253
commit 15fc2d8a48
3 changed files with 25 additions and 1 deletions

View file

@ -159,6 +159,17 @@ class MercurialCommit(base.BaseCommit):
parents = self._remote.ctx_parents(self.idx)
return self._make_commits(parents)
@LazyProperty
def phase(self):
phase_id = self._remote.ctx_phase(self.idx)
phase_text = {
0: 'public',
1: 'draft',
2: 'secret',
}.get(phase_id) or ''
return safe_unicode(phase_text)
@LazyProperty
def children(self):
"""

View file

@ -98,4 +98,12 @@
&.admin {
&:extend(.tag5);
}
}
}
.phase-draft {
color: @color3
}
.phase-secret {
color:@grey3
}

View file

@ -48,6 +48,11 @@
<a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">
<span class="commit_hash">${h.show_id(commit)}</span>
</a>
% if hasattr(commit, 'phase'):
% if commit.phase != 'public':
<span class="tag phase-${commit.phase} tooltip" title="${_('commit phase')}">${commit.phase}</span>
% endif
% endif
</code>
</td>
<td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this); return false">