##// END OF EJS Templates
rebase: use merge's ancestor parameter
Matt Mackall -
r13875:ff3c683e default
parent child Browse files
Show More
@@ -234,25 +234,6 b' def rebase(ui, repo, **opts):'
234 234 finally:
235 235 release(lock, wlock)
236 236
237 def rebasemerge(repo, rev, first=False):
238 'return the correct ancestor'
239 oldancestor = ancestor.ancestor
240
241 def newancestor(a, b, pfunc):
242 if b == rev:
243 return repo[rev].parents()[0].rev()
244 return oldancestor(a, b, pfunc)
245
246 if not first:
247 ancestor.ancestor = newancestor
248 else:
249 repo.ui.debug("first revision, do not change ancestor\n")
250 try:
251 stats = merge.update(repo, rev, True, True, False)
252 return stats
253 finally:
254 ancestor.ancestor = oldancestor
255
256 237 def checkexternal(repo, state, targetancestors):
257 238 """Check whether one or more external revisions need to be taken in
258 239 consideration. In the latter case, abort.
@@ -317,9 +298,10 b' def rebasenode(repo, rev, p1, p2, state)'
317 298 repo.ui.debug(" already in target\n")
318 299 repo.dirstate.write()
319 300 repo.ui.debug(" merge against %d:%s\n" % (repo[rev].rev(), repo[rev]))
320 first = repo[rev].rev() == repo[min(state)].rev()
321 stats = rebasemerge(repo, rev, first)
322 return stats
301 base = None
302 if repo[rev].rev() != repo[min(state)].rev():
303 base = repo[rev].parents()[0].node()
304 return merge.update(repo, rev, True, True, False, base)
323 305
324 306 def defineparents(repo, rev, target, state, targetancestors):
325 307 'Return the new parent relationship of the revision that will be rebased'
General Comments 0
You need to be logged in to leave comments. Login now