diff mercurial/hgweb/webcommands.py @ 8796:2bcef677a6c3

localrepo: remove 'closed' argument to heads(...) function - repository heads are not associated with the closed attribute, so remove it making the code in line with the concept. - Fix functions that were calling heads with the parameter. - Adjust webcommands.branches to include the concept of inactive as well as open and closed branches - Fix code and docstrings in commands to make the correct use of closed branches & branch heads clearer - Improve grammar of 'hg heads' help text (2nd submission) this does not alter the cli for hg branches, that work is still to be done
author John Mulligan <phlogistonjohn@asynchrono.us>
date Wed, 10 Jun 2009 19:11:49 -0400
parents de6bb29e208a
children acd03a6e2426
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Mon Jun 08 20:02:44 2009 +0200
+++ b/mercurial/hgweb/webcommands.py	Wed Jun 10 19:11:49 2009 -0400
@@ -361,7 +361,7 @@
 def branches(web, req, tmpl):
     b = web.repo.branchtags()
     tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems())
-    open = set(web.repo[n].branch() for n in web.repo.heads(closed=False))
+    heads = web.repo.heads()
     parity = paritygen(web.stripecount)
     sortkey = lambda ctx: ('close' not in ctx.extra(), ctx.rev())
 
@@ -371,7 +371,12 @@
             if limit > 0 and count >= limit:
                 return
             count += 1
-            status = ctx.branch() in open and 'open' or 'closed'
+            if ctx.node() not in heads:
+                status = 'inactive'
+            elif not web.repo.branchheads(ctx.branch()):
+                status = 'closed'
+            else:
+                status = 'open'
             yield {'parity': parity.next(),
                    'branch': ctx.branch(),
                    'status': status,