Show More
@@ -785,8 +785,10 b' def debugdiscovery(ui, repo, remoteurl="' | |||||
785 | # make sure tests are repeatable |
|
785 | # make sure tests are repeatable | |
786 | random.seed(int(opts['seed'])) |
|
786 | random.seed(int(opts['seed'])) | |
787 |
|
787 | |||
|
788 | ||||
|
789 | ||||
|
790 | if opts.get('old'): | |||
788 | def doit(pushedrevs, remoteheads, remote=remote): |
|
791 | def doit(pushedrevs, remoteheads, remote=remote): | |
789 | if opts.get('old'): |
|
|||
790 | if not util.safehasattr(remote, 'branches'): |
|
792 | if not util.safehasattr(remote, 'branches'): | |
791 | # enable in-client legacy support |
|
793 | # enable in-client legacy support | |
792 | remote = localrepo.locallegacypeer(remote.local()) |
|
794 | remote = localrepo.locallegacypeer(remote.local()) | |
@@ -800,13 +802,21 b' def debugdiscovery(ui, repo, remoteurl="' | |||||
800 | clnode = repo.changelog.node |
|
802 | clnode = repo.changelog.node | |
801 | common = repo.revs('heads(::%ln)', common) |
|
803 | common = repo.revs('heads(::%ln)', common) | |
802 | common = {clnode(r) for r in common} |
|
804 | common = {clnode(r) for r in common} | |
|
805 | return common, hds | |||
803 |
|
|
806 | else: | |
|
807 | def doit(pushedrevs, remoteheads, remote=remote): | |||
804 | nodes = None |
|
808 | nodes = None | |
805 | if pushedrevs: |
|
809 | if pushedrevs: | |
806 | revs = scmutil.revrange(repo, pushedrevs) |
|
810 | revs = scmutil.revrange(repo, pushedrevs) | |
807 | nodes = [repo[r].node() for r in revs] |
|
811 | nodes = [repo[r].node() for r in revs] | |
808 | common, any, hds = setdiscovery.findcommonheads(ui, repo, remote, |
|
812 | common, any, hds = setdiscovery.findcommonheads(ui, repo, remote, | |
809 | ancestorsof=nodes) |
|
813 | ancestorsof=nodes) | |
|
814 | return common, hds | |||
|
815 | ||||
|
816 | remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) | |||
|
817 | localrevs = opts['rev'] | |||
|
818 | common, hds = doit(localrevs, remoterevs) | |||
|
819 | ||||
810 |
|
|
820 | common = set(common) | |
811 |
|
|
821 | rheads = set(hds) | |
812 |
|
|
822 | lheads = set(repo.heads()) | |
@@ -817,10 +827,6 b' def debugdiscovery(ui, repo, remoteurl="' | |||||
817 |
|
|
827 | elif rheads <= common: | |
818 |
|
|
828 | ui.write(("remote is subset\n")) | |
819 |
|
829 | |||
820 | remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None) |
|
|||
821 | localrevs = opts['rev'] |
|
|||
822 | doit(localrevs, remoterevs) |
|
|||
823 |
|
||||
824 | _chunksize = 4 << 10 |
|
830 | _chunksize = 4 << 10 | |
825 |
|
831 | |||
826 | @command('debugdownload', |
|
832 | @command('debugdownload', |
General Comments 0
You need to be logged in to leave comments.
Login now