##// END OF EJS Templates
push: move changeset push logic in its own function...
Pierre-Yves David -
r20463:f1b532a3 default
parent child Browse files
Show More
@@ -141,7 +141,23 b' def push(repo, remote, force=False, revs'
141 discovery.checkheads(unfi, pushop.remote, outgoing,
141 discovery.checkheads(unfi, pushop.remote, outgoing,
142 remoteheads, pushop.newbranch,
142 remoteheads, pushop.newbranch,
143 bool(inc), newbm)
143 bool(inc), newbm)
144 _pushchangeset(pushop)
145 _pushsyncphase(pushop)
146 _pushobsolete(pushop)
147 finally:
148 if lock is not None:
149 lock.release()
150 finally:
151 if locallock is not None:
152 locallock.release()
144
153
154 _pushbookmark(pushop)
155 return pushop.ret
156
157 def _pushchangeset(pushop):
158 """Make the actual push of changeset bundle to remote repo"""
159 outgoing = pushop.outgoing
160 unbundle = pushop.remote.capable('unbundle')
145 # TODO: get bundlecaps from remote
161 # TODO: get bundlecaps from remote
146 bundlecaps = None
162 bundlecaps = None
147 # create a changegroup from local
163 # create a changegroup from local
@@ -155,8 +171,7 b' def push(repo, remote, force=False, revs'
155 'push',
171 'push',
156 fastpath=True)
172 fastpath=True)
157 else:
173 else:
158 cg = pushop.repo.getlocalbundle('push', outgoing,
174 cg = pushop.repo.getlocalbundle('push', outgoing, bundlecaps)
159 bundlecaps)
160
175
161 # apply changegroup to remote
176 # apply changegroup to remote
162 if unbundle:
177 if unbundle:
@@ -178,18 +193,6 b' def push(repo, remote, force=False, revs'
178 pushop.ret = pushop.remote.addchangegroup(cg, 'push',
193 pushop.ret = pushop.remote.addchangegroup(cg, 'push',
179 pushop.repo.url())
194 pushop.repo.url())
180
195
181 _pushsyncphase(pushop)
182 _pushobsolete(pushop)
183 finally:
184 if lock is not None:
185 lock.release()
186 finally:
187 if locallock is not None:
188 locallock.release()
189
190 _pushbookmark(pushop)
191 return pushop.ret
192
193 def _pushsyncphase(pushop):
196 def _pushsyncphase(pushop):
194 """synchronise phase information locally and remotly"""
197 """synchronise phase information locally and remotly"""
195 unfi = pushop.repo.unfiltered()
198 unfi = pushop.repo.unfiltered()
General Comments 0
You need to be logged in to leave comments. Login now