Mercurial > public > mercurial-scm > hg-stable
diff mercurial/changegroup.py @ 27946:ca8d2b73155d stable
changegroup: fix treemanifest exchange code (issue5061)
There were two mistakes: one was accidental reuse of the fclnode
variable from the loop gathering file nodes, and the other (masked by
that bug) was not correctly handling deleted directories. Both cases
are now fixed and the test passes.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 27 Jan 2016 10:24:25 -0500 |
parents | 1289a122cf3f |
children | 88609cfa3745 |
line wrap: on
line diff
--- a/mercurial/changegroup.py Fri Jan 22 12:08:20 2016 -0600 +++ b/mercurial/changegroup.py Wed Jan 27 10:24:25 2016 -0500 @@ -778,12 +778,15 @@ if 'treemanifest' in repo.requirements: submfs = {'/': mdata} for dn, bn in _moddirs(mfchangedfiles[x]): - submf = submfs[dn] - submf = submf._dirs[bn] + try: + submf = submfs[dn] + submf = submf._dirs[bn] + except KeyError: + continue # deleted directory, so nothing to send submfs[submf.dir()] = submf tmfclnodes = tmfnodes.setdefault(submf.dir(), {}) - tmfclnodes.setdefault(submf._node, clnode) - if clrevorder[clnode] < clrevorder[fclnode]: + tmfclnode = tmfclnodes.setdefault(submf._node, clnode) + if clrevorder[clnode] < clrevorder[tmfclnode]: tmfclnodes[n] = clnode return clnode