##// END OF EJS Templates
treediscovery: switch to command executor interface...
Gregory Szorc -
r37652:0ed11f93 default
parent child Browse files
Show More
@@ -36,7 +36,8 b' def findcommonincoming(repo, remote, hea'
36 base = set()
36 base = set()
37
37
38 if not heads:
38 if not heads:
39 heads = remote.heads()
39 with remote.commandexecutor() as e:
40 heads = e.callcommand('heads', {}).result()
40
41
41 if repo.changelog.tip() == nullid:
42 if repo.changelog.tip() == nullid:
42 base.add(nullid)
43 base.add(nullid)
@@ -65,7 +66,10 b' def findcommonincoming(repo, remote, hea'
65 # a 'branch' here is a linear segment of history, with four parts:
66 # a 'branch' here is a linear segment of history, with four parts:
66 # head, root, first parent, second parent
67 # head, root, first parent, second parent
67 # (a branch always has two parents (or none) by definition)
68 # (a branch always has two parents (or none) by definition)
68 unknown = collections.deque(remote.branches(unknown))
69 with remote.commandexecutor() as e:
70 branches = e.callcommand('branches', {'nodes': unknown}).result()
71
72 unknown = collections.deque(branches)
69 while unknown:
73 while unknown:
70 r = []
74 r = []
71 while unknown:
75 while unknown:
@@ -107,7 +111,12 b' def findcommonincoming(repo, remote, hea'
107 repo.ui.debug("request %d: %s\n" %
111 repo.ui.debug("request %d: %s\n" %
108 (reqcnt, " ".join(map(short, r))))
112 (reqcnt, " ".join(map(short, r))))
109 for p in xrange(0, len(r), 10):
113 for p in xrange(0, len(r), 10):
110 for b in remote.branches(r[p:p + 10]):
114 with remote.commandexecutor() as e:
115 branches = e.callcommand('branches', {
116 'nodes': r[p:p + 10],
117 }).result()
118
119 for b in branches:
111 repo.ui.debug("received %s:%s\n" %
120 repo.ui.debug("received %s:%s\n" %
112 (short(b[0]), short(b[1])))
121 (short(b[0]), short(b[1])))
113 unknown.append(b)
122 unknown.append(b)
@@ -117,7 +126,11 b' def findcommonincoming(repo, remote, hea'
117 newsearch = []
126 newsearch = []
118 reqcnt += 1
127 reqcnt += 1
119 repo.ui.progress(_('searching'), reqcnt, unit=_('queries'))
128 repo.ui.progress(_('searching'), reqcnt, unit=_('queries'))
120 for n, l in zip(search, remote.between(search)):
129
130 with remote.commandexecutor() as e:
131 between = e.callcommand('between', {'pairs': search}).result()
132
133 for n, l in zip(search, between):
121 l.append(n[1])
134 l.append(n[1])
122 p = n[0]
135 p = n[0]
123 f = 1
136 f = 1
General Comments 0
You need to be logged in to leave comments. Login now