mercurial/hgweb/webcommands.py
changeset 31939 604d31507f86
parent 31727 6be6e4becaaf
child 32070 a298f5c61b34
--- a/mercurial/hgweb/webcommands.py	Mon Jan 16 09:24:47 2017 +0100
+++ b/mercurial/hgweb/webcommands.py	Mon Apr 10 16:23:41 2017 +0200
@@ -979,6 +979,9 @@
     patch = 'patch' in req.form
     if patch:
         lessvars['patch'] = morevars['patch'] = req.form['patch'][0]
+    descend = 'descend' in req.form
+    if descend:
+        lessvars['descend'] = morevars['descend'] = req.form['descend'][0]
 
     count = fctx.filerev() + 1
     start = max(0, count - revcount) # first rev on this page
@@ -1007,8 +1010,11 @@
         # deactivate numeric nav links when linerange is specified as this
         # would required a dedicated "revnav" class
         nav = None
-        ancestors = context.blockancestors(fctx, *lrange)
-        for i, (c, lr) in enumerate(ancestors, 1):
+        if descend:
+            it = context.blockdescendants(fctx, *lrange)
+        else:
+            it = context.blockancestors(fctx, *lrange)
+        for i, (c, lr) in enumerate(it, 1):
             diffs = None
             if patch:
                 diffs = diff(c, linerange=lr)
@@ -1049,6 +1055,7 @@
                 nav=nav,
                 symrev=webutil.symrevorshortnode(req, fctx),
                 entries=entries,
+                descend=descend,
                 patch=patch,
                 latestentry=latestentry,
                 linerange=linerange,