comparison 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
comparison
equal deleted inserted replaced
23125:a5d6a609752b 23126:8b4a8a9176e2
1678 self._applyrequirements(requirements) 1678 self._applyrequirements(requirements)
1679 self._writerequirements() 1679 self._writerequirements()
1680 1680
1681 if rbranchmap: 1681 if rbranchmap:
1682 rbheads = [] 1682 rbheads = []
1683 closed = []
1683 for bheads in rbranchmap.itervalues(): 1684 for bheads in rbranchmap.itervalues():
1684 rbheads.extend(bheads) 1685 rbheads.extend(bheads)
1686 for h in bheads:
1687 r = self.changelog.rev(h)
1688 b, c = self.changelog.branchinfo(r)
1689 if c:
1690 closed.append(h)
1685 1691
1686 if rbheads: 1692 if rbheads:
1687 rtiprev = max((int(self.changelog.rev(node)) 1693 rtiprev = max((int(self.changelog.rev(node))
1688 for node in rbheads)) 1694 for node in rbheads))
1689 cache = branchmap.branchcache(rbranchmap, 1695 cache = branchmap.branchcache(rbranchmap,
1690 self[rtiprev].node(), 1696 self[rtiprev].node(),
1691 rtiprev) 1697 rtiprev,
1698 closednodes=closed)
1692 # Try to stick it as low as possible 1699 # Try to stick it as low as possible
1693 # filter above served are unlikely to be fetch from a clone 1700 # filter above served are unlikely to be fetch from a clone
1694 for candidate in ('base', 'immutable', 'served'): 1701 for candidate in ('base', 'immutable', 'served'):
1695 rview = self.filtered(candidate) 1702 rview = self.filtered(candidate)
1696 if cache.validfor(rview): 1703 if cache.validfor(rview):