[PATCH 3/5]: cleaning the template parent management in hgweb

Goffredo Baroncelli kreijack at libero.it
Sat Jul 2 15:09:57 UTC 2005


Hi,

the template pages contain two entry named #parent1# and #parent2#; this is no good
because with the template system implemented in hgweb both the functions 
can be replaced with only one entry named "#parent#".
The code in hgweb will replace this tag with the appropriate number of parents ( one, two...
or more if and when will be used ).

The first two patch perform this change in two step: 
1) change the code to manage only one entry ( #parent1# )
2) remove any reference to #parent2#, and change both the code and the templates to
   rename #parent1# in #parent2#

the last three patchs are clean-up.

The patch are five



- patch #3
the filediff template use the old style p1/p2 and p1rev/p2rev inteface; the patch
removes this old stuff, and update the code to the new style



# HG changeset patch
# User ghigo at therra.bhome
# Node ID ddaa0ea5dfb5453623045eb90dba7e6a0374cc0a
# Parent  be3ca8530ece7174bd1dfa8d4c63b5dee36b15e3

hgweb: remove the p1,p2/p1rev,p2rev managment in filediff

diff -r be3ca8530ece -r ddaa0ea5dfb5 mercurial/hgweb.py
--- a/mercurial/hgweb.py        Sat Jul  2 09:45:11 2005
+++ b/mercurial/hgweb.py        Sat Jul  2 09:59:49 2005
@@ -630,7 +630,8 @@
                      filenode = hex(mf.get(file, nullid)),
                      node = changeset,
                      rev = self.repo.changelog.rev(n),
-                     p1 = hex(p1),
+                     parent = self.parents("filediffparent",
+                              cl.parents(n), cl.rev),
                      p1rev = self.repo.changelog.rev(p1),
                      diff = diff)

diff -r be3ca8530ece -r ddaa0ea5dfb5 templates/filediff.tmpl
--- a/templates/filediff.tmpl   Sat Jul  2 09:45:11 2005
+++ b/templates/filediff.tmpl   Sat Jul  2 09:59:49 2005
@@ -19,9 +19,7 @@
 <tr>
  <td class="metatag">revision #rev#:</td>
  <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
-<tr>
- <td class="metatag">parent #p1rev#:</td>
- <td><a href="?cmd=changeset;node=#p1#">#p1|short#</a></td></tr>
+#parent#
 </table>

 <pre>
diff -r be3ca8530ece -r ddaa0ea5dfb5 templates/map
--- a/templates/map     Sat Jul  2 09:45:11 2005
+++ b/templates/map     Sat Jul  2 09:59:49 2005
@@ -32,3 +32,4 @@
 diffblock = "<div class="parity#parity#">#lines#</div>"
 changelogtag = "<tr><td align="right">tag: </td><td>#tag#</td></tr>"
 changesettag = "<tr><td class="metatag">tag: </td><td>#tag#</td></tr>"
+filediffparent = "<tr><td class="metatag">parent #rev#:</td><td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>"




More information about the Mercurial mailing list