314 # Nodeids are needed to reset bookmarks |
314 # Nodeids are needed to reset bookmarks |
315 nstate = {} |
315 nstate = {} |
316 for k, v in state.iteritems(): |
316 for k, v in state.iteritems(): |
317 if v > nullmerge: |
317 if v > nullmerge: |
318 nstate[repo[k].node()] = repo[v].node() |
318 nstate[repo[k].node()] = repo[v].node() |
|
319 # XXX this is the same as dest.node() for the non-continue path -- |
|
320 # this should probably be cleaned up |
|
321 targetnode = repo[target].node() |
319 |
322 |
320 if not keepf: |
323 if not keepf: |
321 collapsedas = None |
324 collapsedas = None |
322 if collapsef: |
325 if collapsef: |
323 collapsedas = newrev |
326 collapsedas = newrev |
324 clearrebased(ui, repo, state, skipped, collapsedas) |
327 clearrebased(ui, repo, state, skipped, collapsedas) |
325 |
328 |
326 if currentbookmarks: |
329 if currentbookmarks: |
327 updatebookmarks(repo, dest, nstate, currentbookmarks) |
330 updatebookmarks(repo, targetnode, nstate, currentbookmarks) |
328 |
331 |
329 clearstatus(repo) |
332 clearstatus(repo) |
330 ui.note(_("rebase completed\n")) |
333 ui.note(_("rebase completed\n")) |
331 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True) |
334 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True) |
332 if skipped: |
335 if skipped: |
499 if mq.guard_re.split(s, 1)[0] not in skippedpatches] |
502 if mq.guard_re.split(s, 1)[0] not in skippedpatches] |
500 mq.fullseries[:] = newseries |
503 mq.fullseries[:] = newseries |
501 mq.seriesdirty = True |
504 mq.seriesdirty = True |
502 mq.savedirty() |
505 mq.savedirty() |
503 |
506 |
504 def updatebookmarks(repo, dest, nstate, originalbookmarks): |
507 def updatebookmarks(repo, targetnode, nstate, originalbookmarks): |
505 'Move bookmarks to their correct changesets, and delete divergent ones' |
508 'Move bookmarks to their correct changesets, and delete divergent ones' |
506 destnode = dest.node() |
|
507 marks = repo._bookmarks |
509 marks = repo._bookmarks |
508 for k, v in originalbookmarks.iteritems(): |
510 for k, v in originalbookmarks.iteritems(): |
509 if v in nstate: |
511 if v in nstate: |
510 # update the bookmarks for revs that have moved |
512 # update the bookmarks for revs that have moved |
511 marks[k] = nstate[v] |
513 marks[k] = nstate[v] |
512 bookmarks.deletedivergent(repo, [destnode], k) |
514 bookmarks.deletedivergent(repo, [targetnode], k) |
513 |
515 |
514 marks.write() |
516 marks.write() |
515 |
517 |
516 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches, |
518 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches, |
517 external): |
519 external): |