##// END OF EJS Templates
bundle2: fix bundle2 pulling all revs on empty pulls...
Durham Goode -
r21259:ab5040cd default
parent child Browse files
Show More
@@ -573,12 +573,13 b' def _pullbundle2(pullop):'
573 kwargs['bundlecaps'].add('bundle2=' + urllib.quote(capsblob))
573 kwargs['bundlecaps'].add('bundle2=' + urllib.quote(capsblob))
574 # pulling changegroup
574 # pulling changegroup
575 pullop.todosteps.remove('changegroup')
575 pullop.todosteps.remove('changegroup')
576
577 kwargs['common'] = pullop.common
578 kwargs['heads'] = pullop.heads or pullop.rheads
576 if not pullop.fetch:
579 if not pullop.fetch:
577 pullop.repo.ui.status(_("no changes found\n"))
580 pullop.repo.ui.status(_("no changes found\n"))
578 pullop.cgresult = 0
581 pullop.cgresult = 0
579 else:
582 else:
580 kwargs['common'] = pullop.common
581 kwargs['heads'] = pullop.heads or pullop.rheads
582 if pullop.heads is None and list(pullop.common) == [nullid]:
583 if pullop.heads is None and list(pullop.common) == [nullid]:
583 pullop.repo.ui.status(_("requesting all changes\n"))
584 pullop.repo.ui.status(_("requesting all changes\n"))
584 _pullbundle2extraprepare(pullop, kwargs)
585 _pullbundle2extraprepare(pullop, kwargs)
@@ -589,8 +590,10 b' def _pullbundle2(pullop):'
589 op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction)
590 op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction)
590 except bundle2.UnknownPartError, exc:
591 except bundle2.UnknownPartError, exc:
591 raise util.Abort('missing support for %s' % exc)
592 raise util.Abort('missing support for %s' % exc)
592 assert len(op.records['changegroup']) == 1
593
593 pullop.cgresult = op.records['changegroup'][0]['return']
594 if pullop.fetch:
595 assert len(op.records['changegroup']) == 1
596 pullop.cgresult = op.records['changegroup'][0]['return']
594
597
595 def _pullbundle2extraprepare(pullop, kwargs):
598 def _pullbundle2extraprepare(pullop, kwargs):
596 """hook function so that extensions can extend the getbundle call"""
599 """hook function so that extensions can extend the getbundle call"""
@@ -684,7 +687,7 b' def getbundle(repo, source, heads=None, '
684 The implementation is at a very early stage and will get massive rework
687 The implementation is at a very early stage and will get massive rework
685 when the API of bundle is refined.
688 when the API of bundle is refined.
686 """
689 """
687 # build bundle here.
690 # build changegroup bundle here.
688 cg = changegroup.getbundle(repo, source, heads=heads,
691 cg = changegroup.getbundle(repo, source, heads=heads,
689 common=common, bundlecaps=bundlecaps)
692 common=common, bundlecaps=bundlecaps)
690 if bundlecaps is None or 'HG2X' not in bundlecaps:
693 if bundlecaps is None or 'HG2X' not in bundlecaps:
@@ -697,8 +700,9 b' def getbundle(repo, source, heads=None, '
697 blob = urllib.unquote(bcaps[len('bundle2='):])
700 blob = urllib.unquote(bcaps[len('bundle2='):])
698 b2caps.update(bundle2.decodecaps(blob))
701 b2caps.update(bundle2.decodecaps(blob))
699 bundler = bundle2.bundle20(repo.ui, b2caps)
702 bundler = bundle2.bundle20(repo.ui, b2caps)
700 part = bundle2.bundlepart('b2x:changegroup', data=cg.getchunks())
703 if cg:
701 bundler.addpart(part)
704 part = bundle2.bundlepart('b2x:changegroup', data=cg.getchunks())
705 bundler.addpart(part)
702 _getbundleextrapart(bundler, repo, source, heads=heads, common=common,
706 _getbundleextrapart(bundler, repo, source, heads=heads, common=common,
703 bundlecaps=bundlecaps, **kwargs)
707 bundlecaps=bundlecaps, **kwargs)
704 return util.chunkbuffer(bundler.getchunks())
708 return util.chunkbuffer(bundler.getchunks())
@@ -791,6 +791,12 b' pull'
791 added 1 changesets with 1 changes to 1 files (+1 heads)
791 added 1 changesets with 1 changes to 1 files (+1 heads)
792 (run 'hg heads' to see heads, 'hg merge' to merge)
792 (run 'hg heads' to see heads, 'hg merge' to merge)
793
793
794 pull empty
795
796 $ hg -R other pull -r 24b6387c8c8c
797 pulling from $TESTTMP/main (glob)
798 no changes found
799
794 push
800 push
795
801
796 $ hg -R main push other --rev eea13746799a
802 $ hg -R main push other --rev eea13746799a
General Comments 0
You need to be logged in to leave comments. Login now