Patchwork hgweb: rename the main attribute of instabilities

login
register
mail settings
Submitter Anton Shestakov
Date Nov. 26, 2017, 6:23 a.m.
Message ID <f38c91c7429458763f85.1511677405@neuro>
Download mbox | patch
Permalink /patch/25756/
State Accepted
Headers show

Comments

Anton Shestakov - Nov. 26, 2017, 6:23 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1511674158 -28800
#      Sun Nov 26 13:29:18 2017 +0800
# Node ID f38c91c7429458763f85c0ab6dd87727636417d9
# Parent  8287df8b7be545fdafa22b771012ac65f6264d12
hgweb: rename the main attribute of instabilities

Let's make "instabilities" list contain items with "instability" key as opposed
to "name" key. This way it's more explicit and more consistent with the log
command-line template.
Yuya Nishihara - Nov. 26, 2017, 10:41 a.m.
On Sun, 26 Nov 2017 14:23:25 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1511674158 -28800
> #      Sun Nov 26 13:29:18 2017 +0800
> # Node ID f38c91c7429458763f85c0ab6dd87727636417d9
> # Parent  8287df8b7be545fdafa22b771012ac65f6264d12
> hgweb: rename the main attribute of instabilities

Queued, thanks.

Patch

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -362,7 +362,7 @@  def commonentry(repo, ctx):
         'extra': ctx.extra(),
         'phase': ctx.phasestr(),
         'obsolete': ctx.obsolete(),
-        'instabilities': [{"name": i} for i in ctx.instabilities()],
+        'instabilities': [{"instability": i} for i in ctx.instabilities()],
         'branch': nodebranchnodefault(ctx),
         'inbranch': nodeinbranch(repo, ctx),
         'branches': nodebranchdict(repo, ctx),
diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -264,7 +264,7 @@  shortlog = shortlog.tmpl
 graph = graph.tmpl
 phasetag = '{ifeq(phase, 'public', '', '<span class="phasetag" title="{phase|escape}">{phase|escape}</span> ')}'
 obsoletetag = '{if(obsolete, '<span class="obsoletetag" title="obsolete">obsolete</span> ')}'
-instabilitytag = '<span class="instabilitytag" title="{name|escape}">{name|escape}</span> '
+instabilitytag = '<span class="instabilitytag" title="{instability|escape}">{instability|escape}</span> '
 tagtag = '<span class="tagtag" title="{name|escape}">{name|escape}</span> '
 branchtag = '<span class="branchtag" title="{name|escape}">{name|escape}</span> '
 inbranchtag = '<span class="inbranchtag" title="{name|escape}">{name|escape}</span> '
diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -223,7 +223,7 @@  filecompchild = '
 shortlog = shortlog.tmpl
 phasetag = '{ifeq(phase, 'public', '', '<span class="phasetag" title="{phase|escape}">{phase|escape}</span> ')}'
 obsoletetag = '{if(obsolete, '<span class="obsoletetag" title="obsolete">obsolete</span> ')}'
-instabilitytag = '<span class="instabilitytag" title="{name|escape}">{name|escape}</span> '
+instabilitytag = '<span class="instabilitytag" title="{instability|escape}">{instability|escape}</span> '
 tagtag = '<span class="tagtag" title="{name|escape}">{name|escape}</span> '
 branchtag = '<span class="branchtag" title="{name|escape}">{name|escape}</span> '
 inbranchtag = '<span class="inbranchtag" title="{name|escape}">{name|escape}</span> '
diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
--- a/mercurial/templates/paper/map
+++ b/mercurial/templates/paper/map
@@ -200,7 +200,7 @@  branchentry = '
   </tr>'
 phasetag = '{ifeq(phase, 'public', '', '<span class="phase">{phase|escape}</span> ')}'
 obsoletetag = '{if(obsolete, '<span class="obsolete">obsolete</span> ')}'
-instabilitytag = '<span class="instability">{name|escape}</span> '
+instabilitytag = '<span class="instability">{instability|escape}</span> '
 changelogtag = '<span class="tag">{name|escape}</span> '
 changesettag = '<span class="tag">{tag|escape}</span> '
 changesetbookmark = '<span class="tag">{bookmark|escape}</span> '
diff --git a/mercurial/templates/spartan/changelogentry.tmpl b/mercurial/templates/spartan/changelogentry.tmpl
--- a/mercurial/templates/spartan/changelogentry.tmpl
+++ b/mercurial/templates/spartan/changelogentry.tmpl
@@ -28,7 +28,7 @@ 
  </tr>')}
  {ifeq(count(instabilities), '0', '', '<tr>
   <th class="instabilities">instabilities:</th>
-  <td class="instabilities">{instabilities%"{name} "|escape}</td>
+  <td class="instabilities">{instabilities%"{instability} "|escape}</td>
  </tr>')}
  <tr>
   <th class="files"><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>:</th>
diff --git a/mercurial/templates/spartan/changeset.tmpl b/mercurial/templates/spartan/changeset.tmpl
--- a/mercurial/templates/spartan/changeset.tmpl
+++ b/mercurial/templates/spartan/changeset.tmpl
@@ -43,7 +43,7 @@ 
 </tr>')}
 {ifeq(count(instabilities), '0', '', '<tr>
  <th class="instabilities">instabilities:</th>
- <td class="instabilities">{instabilities%"{name} "|escape}</td>
+ <td class="instabilities">{instabilities%"{instability} "|escape}</td>
 </tr>')}
 <tr>
  <th class="files">files:</th>