diff mercurial/localrepo.py @ 23126:8b4a8a9176e2 stable

clone: properly mark branches closed with --uncompressed (issue4428) On streaming clone, we were priming the local branch cache with the remote branchmap, without checking which heads were closed. This fixes an issue introduced in: changeset: 17740:e6067bec18da user: Tomasz Kleczek <tomasz.kleczek@fb.com> date: Wed Oct 03 13:19:53 2012 -0700 summary: branchcache: fetch source branchcache during clone (issue3378) that was exposed in 2.9 by: changeset: 20192:38fad5e76ee8 user: Brodie Rao <brodie@sf.io> date: Mon Sep 16 01:08:29 2013 -0700 summary: branches: simplify with repo.branchmap().iterbranches()
author Matt Mackall <mpm@selenic.com>
date Sat, 01 Nov 2014 17:30:57 -0500
parents 2dc6b7917cdf
children eb315418224c
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Nov 01 20:00:31 2014 +0100
+++ b/mercurial/localrepo.py	Sat Nov 01 17:30:57 2014 -0500
@@ -1680,15 +1680,22 @@
 
             if rbranchmap:
                 rbheads = []
+                closed = []
                 for bheads in rbranchmap.itervalues():
                     rbheads.extend(bheads)
+                    for h in bheads:
+                        r = self.changelog.rev(h)
+                        b, c = self.changelog.branchinfo(r)
+                        if c:
+                            closed.append(h)
 
                 if rbheads:
                     rtiprev = max((int(self.changelog.rev(node))
                             for node in rbheads))
                     cache = branchmap.branchcache(rbranchmap,
                                                   self[rtiprev].node(),
-                                                  rtiprev)
+                                                  rtiprev,
+                                                  closednodes=closed)
                     # Try to stick it as low as possible
                     # filter above served are unlikely to be fetch from a clone
                     for candidate in ('base', 'immutable', 'served'):