mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
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.
This commit is contained in:
parent
e2cfbb7c54
commit
db82034373
@ -778,12 +778,15 @@ class cg1packer(object):
|
||||
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
|
||||
|
||||
|
@ -332,6 +332,21 @@ Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
|
||||
$ grep treemanifest empty-repo/.hg/requires
|
||||
treemanifest
|
||||
|
||||
Pushing to an empty repo works
|
||||
|
||||
$ hg --config experimental.treemanifest=1 init clone
|
||||
$ grep treemanifest clone/.hg/requires
|
||||
treemanifest
|
||||
$ hg push -R repo clone
|
||||
pushing to clone
|
||||
searching for changes
|
||||
adding changesets
|
||||
adding manifests
|
||||
adding file changes
|
||||
added 11 changesets with 15 changes to 10 files (+3 heads)
|
||||
$ grep treemanifest clone/.hg/requires
|
||||
treemanifest
|
||||
|
||||
Create deeper repo with tree manifests.
|
||||
|
||||
$ hg --config experimental.treemanifest=True init deeprepo
|
||||
|
Loading…
Reference in New Issue
Block a user