Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 4 files changed
  • 0 comments
  • 2 contributors
Apr 14, 2012
Pavan Chander navap MBS-4551: Display active git branch a99ed7c
Apr 16, 2012
Pavan Chander navap MBS-4551: Remove unnecessary IF aa780d9
Oliver Charles Merge remote branch 'navap/mbs-4551-display-active-branch'
* navap/mbs-4551-display-active-branch:
  MBS-4551: Remove unnecessary IF
  MBS-4551: Display active git branch
e773336
15 lib/DBDefs.pm.default
@@ -256,11 +256,16 @@ This server is temporarily in read-only mode
256 256 for database maintainance.
257 257 EOF
258 258
259   -# This defines the version of the server. Only used by things which display
260   -# the server version, e.g. at the foot of each web page. Basically it can be
261   -# whatever you want. If you leave it blank, the current subversion revision
262   -# will be shown (if subversion is in use).
263   -sub VERSION { "master" }
  259 +# Development server feature.
  260 +# Used to display which git branch is currently active.
  261 +sub GIT_BRANCH
  262 +{
  263 + if (DB_STAGING_SERVER) {
  264 + my $git_branch = `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d'`;
  265 + $git_branch =~ s/\* (.+)/$1/;
  266 + return $git_branch;
  267 + }
  268 +}
264 269
265 270 # How long (in seconds) a web/rdf session can go "idle" before being timed out
266 271 sub WEB_SESSION_SECONDS_TO_LIVE { 3600 * 3 }
8 lib/MusicBrainz/Server/Controller/Root.pm
@@ -269,12 +269,8 @@ sub end : ActionClass('RenderView')
269 269 developement_server => &DBDefs::DEVELOPMENT_SERVER
270 270 };
271 271
272   - # Determine which server version to display. If the DBDefs string is empty
273   - # attempt to display the current subversion revision
274   - if (&DBDefs::VERSION)
275   - {
276   - $c->stash->{server_details}->{version} = &DBDefs::VERSION;
277   - }
  272 + # Display which git branch is active (only on dev servers)
  273 + $c->stash->{server_details}->{git_branch} = &DBDefs::GIT_BRANCH;
278 274
279 275 # For displaying release attributes
280 276 $c->stash->{release_attribute} = \&MusicBrainz::Server::Release::attribute_name;
5 root/layout.tt
@@ -62,6 +62,11 @@
62 62 [% form_submit(l('Search'), "header-search") %]
63 63 </form>
64 64 </div>
  65 + [%- IF server_details.git_branch -%]
  66 + <div class="git-branch">
  67 + [%- l('Development branch: {branch}', { branch => server_details.git_branch }) -%]
  68 + </div>
  69 + [%- END -%]
65 70 </div>
66 71 <div id="header-menu">
67 72 <div>
6 root/static/styles/layout.css
@@ -116,6 +116,12 @@ pre code {
116 116 padding-right: 1em;
117 117 }
118 118
  119 +#header-logo div.git-branch {
  120 + position: absolute;
  121 + top: 2px;
  122 + right: 18px;
  123 +}
  124 +
119 125 #header-logo #id-type {
120 126 margin-right: 4px;
121 127 margin-left: 10px;

No commit comments for this range

Something went wrong with that request. Please try again.