Source

mercurial-patches / manifest-style.diff

Full commit
# HG changeset patch
# Parent 75c1fd1d5c33f86425597601dbf599ce7ab3c91f
diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py
--- a/mercurial/templatefilters.py
+++ b/mercurial/templatefilters.py
@@ -285,6 +285,11 @@
     """:shortdate: Date. Returns a date like "2006-09-18"."""
     return util.shortdate(text)
 
+def size(text):
+    """:size: Any tet. Treats `texts` as an integer, and returns
+    a size with delimiters like "100,000,000"."""
+    return re.sub(r'(\d)(?=(\d{3})+(?!\d))', '\\1,', str(text))
+
 def stringescape(text):
     return text.encode('string_escape')
 
@@ -363,6 +368,7 @@
     "short": short,
     "shortbisect": shortbisect,
     "shortdate": shortdate,
+    "size": size,
     "stringescape": stringescape,
     "stringify": stringify,
     "strip": strip,
diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -54,19 +54,19 @@
 manifest = manifest.tmpl
 direntry = '
   <tr class="parity{parity}">
-    <td>drwxr-xr-x</td>
-    <td></td>
-    <td></td>
-    <td><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}</a></td>
-    <td></td>
+    <td class="dir-permissions">drwxr-xr-x</td>
+    <td class="dir-date"></td>
+    <td class="dir-size"></td>
+    <td class="dir-name"><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}/</a></td>
+    <td class="dir-menu"></td>
   </tr>'
 fileentry = '
   <tr class="parity{parity}">
-    <td>{permissions|permissions}</td>
-    <td>{date|isodate}</td>
-    <td>{size}</td>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a></td>
-    <td>
+    <td class="file-permissions">{permissions|permissions}</td>
+    <td class="file-date">{date|isodate}</td>
+    <td class="file-size">{size|size}</td>
+    <td class="file-name"><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a></td>
+    <td class="file-menu">
       <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
       <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
     </td>
diff --git a/mercurial/templates/static/style-monoblue.css b/mercurial/templates/static/style-monoblue.css
--- a/mercurial/templates/static/style-monoblue.css
+++ b/mercurial/templates/static/style-monoblue.css
@@ -459,6 +459,11 @@
 p.files .logtags {
   float: right;
 }
+
+td.file-size {
+  text-align: right;
+}
+
 /** end of file **/
 
 /** changeset **/