changeset 598:f8d44a2e6928

[PATCH 4/5]: cleaning the template parent management in hgweb -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH 4/5]: cleaning the template parent management in hgweb From: Goffredo Baroncelli <kreijack@libero.it> Now the patch remove every use of the tag p1/p2/p1rev/p2rev from the code ( even+the ones not used ), replacing everywhere with the tag parent ( even where the previous +tag are not use ), so the information to the templates is still given. manifest hash: ede1f299e9201fdad2ecf48e63314350acbb047e -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCyEqxywK+sNU5EO8RAjc5AJ9o8AU6/YRuERblO/0kgWwDN4rqQQCgkVj/ UBtzW5x0yD65mK6rb4f+bQk= =07yG -----END PGP SIGNATURE-----
author mpm@selenic.com
date Sun, 03 Jul 2005 12:29:37 -0800
parents e530637ea060
children 765182a4c843
files mercurial/hgweb.py templates/map templates/template-vars.txt
diffstat 3 files changed, 9 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Sun Jul 03 12:26:45 2005 -0800
+++ b/mercurial/hgweb.py	Sun Jul 03 12:29:37 2005 -0800
@@ -254,7 +254,6 @@
                 n = cl.node(i)
                 changes = cl.read(n)
                 hn = hex(n)
-                p1, p2 = cl.parents(n)
                 t = float(changes[2].split(' ')[0])
 
                 l.insert(0, self.t(
@@ -264,8 +263,6 @@
                     parent = self.parents("changelogparent",
                                           cl.parents(n), cl.rev),
                     changelogtag = self.showtag("changelogtag",n),
-                    p1 = hex(p1), p2 = hex(p2),
-                    p1rev = cl.rev(p1), p2rev = cl.rev(p2),
                     manifest = hex(changes[0]),
                     desc = changes[4],
                     date = t,
@@ -320,7 +317,6 @@
 
                 count += 1
                 hn = hex(n)
-                p1, p2 = cl.parents(n)
                 t = float(changes[2].split(' ')[0])
 
                 yield self.t(
@@ -330,8 +326,6 @@
                     parent = self.parents("changelogparent",
                                           cl.parents(n), cl.rev),
                     changelogtag = self.showtag("changelogtag",n),
-                    p1 = hex(p1), p2 = hex(p2),
-                    p1rev = cl.rev(p1), p2rev = cl.rev(p2),
                     manifest = hex(changes[0]),
                     desc = changes[4],
                     date = t,
@@ -356,8 +350,7 @@
         n = bin(nodeid)
         cl = self.repo.changelog
         changes = cl.read(n)
-        p1, p2 = cl.parents(n)
-        p1rev, p2rev = cl.rev(p1), cl.rev(p2)
+        p1 = cl.parents(n)[0]
         t = float(changes[2].split(' ')[0])
 
         files = []
@@ -379,8 +372,6 @@
                      parent = self.parents("changesetparent",
                                            cl.parents(n), cl.rev),
                      changesettag = self.showtag("changesettag",n),
-                     p1 = hex(p1), p2 = hex(p2),
-                     p1rev = cl.rev(p1), p2rev = cl.rev(p2),
                      manifest = hex(changes[0]),
                      author = changes[1],
                      desc = changes[4],
@@ -402,7 +393,6 @@
                 lr = fl.linkrev(n)
                 cn = cl.node(lr)
                 cs = cl.read(cl.node(lr))
-                p1, p2 = fl.parents(n)
                 t = float(cs[2].split(' ')[0])
 
                 l.insert(0, self.t("filelogentry",
@@ -413,9 +403,9 @@
                                    node = hex(cn),
                                    author = cs[1],
                                    date = t,
-                                   desc = cs[4],
-                                   p1 = hex(p1), p2 = hex(p2),
-                                   p1rev = fl.rev(p1), p2rev = fl.rev(p2)))
+                                   parent = self.parents("filelogparent",
+                                       fl.parents(n), fl.rev, file=f),
+                                   desc = cs[4]))
                 parity = 1 - parity
 
             yield l
@@ -436,7 +426,6 @@
         cl = self.repo.changelog
         cn = cl.node(changerev)
         cs = cl.read(cn)
-        p1, p2 = fl.parents(n)
         t = float(cs[2].split(' ')[0])
         mfn = cs[0]
 
@@ -460,9 +449,7 @@
                      date = t,
                      parent = self.parents("filerevparent",
                                            fl.parents(n), fl.rev, file=f),
-                     p1 = hex(p1), p2 = hex(p2),
-                     permissions = self.repo.manifest.readflags(mfn)[f],
-                     p1rev = fl.rev(p1), p2rev = fl.rev(p2))
+                     permissions = self.repo.manifest.readflags(mfn)[f])
 
     def fileannotate(self, f, node):
         bcache = {}
@@ -474,7 +461,6 @@
         cl = self.repo.changelog
         cn = cl.node(changerev)
         cs = cl.read(cn)
-        p1, p2 = fl.parents(n)
         t = float(cs[2].split(' ')[0])
         mfn = cs[0]
 
@@ -527,9 +513,7 @@
                      date = t,
                      parent = self.parents("fileannotateparent",
                                            fl.parents(n), fl.rev, file=f),
-                     p1 = hex(p1), p2 = hex(p2),
-                     permissions = self.repo.manifest.readflags(mfn)[f],
-                     p1rev = fl.rev(p1), p2rev = fl.rev(p2))
+                     permissions = self.repo.manifest.readflags(mfn)[f])
 
     def manifest(self, mnode, path):
         mf = self.repo.manifest.read(bin(mnode))
@@ -628,7 +612,6 @@
                      rev = self.repo.changelog.rev(n),
                      parent = self.parents("filediffparent",
                               cl.parents(n), cl.rev),
-                     p1rev = self.repo.changelog.rev(p1),
                      diff = diff)
 
     # add tags to things
--- a/templates/map	Sun Jul 03 12:26:45 2005 -0800
+++ b/templates/map	Sun Jul 03 12:29:37 2005 -0800
@@ -33,3 +33,4 @@
 changelogtag = "<tr><td align="right">tag:&nbsp;</td><td>#tag#</td></tr>"
 changesettag = "<tr><td class="metatag">tag:&nbsp;</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>"
+filelogparent = "<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="?cmd=file;file=#file#;filenode=#node#">#node|short#</a></td></tr>"
--- a/templates/template-vars.txt	Sun Jul 03 12:26:45 2005 -0800
+++ b/templates/template-vars.txt	Sun Jul 03 12:29:37 2005 -0800
@@ -17,8 +17,8 @@
 desc          a description (escaped, with breaks)
 shortdesc         a short description (escaped)
 author        a name or email addressv(obfuscated)
-p1, p2        parent nodes
-p1rev, p2rev  parent revs
+parent        a list of the parent
+tags          a list of tag
 
 header        the global page header
 footer        the global page footer