# HG changeset patch # User Marcin Kuzminski # Date 2017-04-20 18:56:16 # Node ID 74692701b4c16bc092412a58b4e0a0b052a3bca8 # Parent e352663337af37909c616ee2ed544d331ea0dec7 mercurial: show phases status in changelog. - ref #5265 diff --git a/rhodecode/lib/vcs/backends/hg/commit.py b/rhodecode/lib/vcs/backends/hg/commit.py --- a/rhodecode/lib/vcs/backends/hg/commit.py +++ b/rhodecode/lib/vcs/backends/hg/commit.py @@ -160,6 +160,17 @@ class MercurialCommit(base.BaseCommit): 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): """ Returns list of child commits. diff --git a/rhodecode/public/css/tags.less b/rhodecode/public/css/tags.less --- a/rhodecode/public/css/tags.less +++ b/rhodecode/public/css/tags.less @@ -98,4 +98,12 @@ &.admin { &:extend(.tag5); } -} \ No newline at end of file +} + +.phase-draft { + color: @color3 +} + +.phase-secret { + color:@grey3 +} diff --git a/rhodecode/templates/changelog/changelog_elements.mako b/rhodecode/templates/changelog/changelog_elements.mako --- a/rhodecode/templates/changelog/changelog_elements.mako +++ b/rhodecode/templates/changelog/changelog_elements.mako @@ -48,6 +48,11 @@ ${h.show_id(commit)} + % if hasattr(commit, 'phase'): + % if commit.phase != 'public': + ${commit.phase} + % endif + % endif