Show More
@@ -148,6 +148,12 b' class rebaseruntime(object):' | |||
|
148 | 148 | if e: |
|
149 | 149 | self.extrafns = [e] |
|
150 | 150 | |
|
151 | self.keepf = opts.get('keep', False) | |
|
152 | self.keepbranchesf = opts.get('keepbranches', False) | |
|
153 | # keepopen is not meant for use on the command line, but by | |
|
154 | # other extensions | |
|
155 | self.keepopen = opts.get('keepopen', False) | |
|
156 | ||
|
151 | 157 | @command('rebase', |
|
152 | 158 | [('s', 'source', '', |
|
153 | 159 | _('rebase the specified changeset and descendants'), _('REV')), |
@@ -275,12 +281,6 b' def rebase(ui, repo, **opts):' | |||
|
275 | 281 | destspace = opts.get('_destspace') |
|
276 | 282 | contf = opts.get('continue') |
|
277 | 283 | abortf = opts.get('abort') |
|
278 | keepf = opts.get('keep', False) | |
|
279 | keepbranchesf = opts.get('keepbranches', False) | |
|
280 | # keepopen is not meant for use on the command line, but by | |
|
281 | # other extensions | |
|
282 | keepopen = opts.get('keepopen', False) | |
|
283 | ||
|
284 | 284 | if opts.get('interactive'): |
|
285 | 285 | try: |
|
286 | 286 | if extensions.find('histedit'): |
@@ -310,8 +310,9 b' def rebase(ui, repo, **opts):' | |||
|
310 | 310 | |
|
311 | 311 | try: |
|
312 | 312 | (rbsrt.originalwd, rbsrt.target, rbsrt.state, |
|
313 |
rbsrt.skipped, rbsrt.collapsef, keepf, |
|
|
314 | rbsrt.external, rbsrt.activebookmark) = restorestatus(repo) | |
|
313 | rbsrt.skipped, rbsrt.collapsef, rbsrt.keepf, | |
|
314 | rbsrt.keepbranchesf, rbsrt.external, | |
|
315 | rbsrt.activebookmark) = restorestatus(repo) | |
|
315 | 316 | rbsrt.collapsemsg = restorecollapsemsg(repo) |
|
316 | 317 | except error.RepoLookupError: |
|
317 | 318 | if abortf: |
@@ -347,7 +348,7 b' def rebase(ui, repo, **opts):' | |||
|
347 | 348 | return _nothingtorebase() |
|
348 | 349 | |
|
349 | 350 | allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt) |
|
350 | if (not (keepf or allowunstable) | |
|
351 | if (not (rbsrt.keepf or allowunstable) | |
|
351 | 352 | and repo.revs('first(children(%ld) - %ld)', |
|
352 | 353 | rebaseset, rebaseset)): |
|
353 | 354 | raise error.Abort( |
@@ -377,7 +378,7 b' def rebase(ui, repo, **opts):' | |||
|
377 | 378 | return _nothingtorebase() |
|
378 | 379 | |
|
379 | 380 | root = min(rebaseset) |
|
380 | if not keepf and not repo[root].mutable(): | |
|
381 | if not rbsrt.keepf and not repo[root].mutable(): | |
|
381 | 382 | raise error.Abort(_("can't rebase public changeset %s") |
|
382 | 383 | % repo[root], |
|
383 | 384 | hint=_('see "hg help phases" for details')) |
@@ -389,10 +390,10 b' def rebase(ui, repo, **opts):' | |||
|
389 | 390 | rbsrt.external = externalparent(repo, rbsrt.state, |
|
390 | 391 | rbsrt.targetancestors) |
|
391 | 392 | |
|
392 | if dest.closesbranch() and not keepbranchesf: | |
|
393 | if dest.closesbranch() and not rbsrt.keepbranchesf: | |
|
393 | 394 | ui.status(_('reopening closed branch head %s\n') % dest) |
|
394 | 395 | |
|
395 | if keepbranchesf: | |
|
396 | if rbsrt.keepbranchesf: | |
|
396 | 397 | # insert _savebranch at the start of extrafns so if |
|
397 | 398 | # there's a user-provided extrafn it can clobber branch if |
|
398 | 399 | # desired |
@@ -438,8 +439,8 b' def rebase(ui, repo, **opts):' | |||
|
438 | 439 | rbsrt.targetancestors, |
|
439 | 440 | obsoletenotrebased) |
|
440 | 441 | storestatus(repo, rbsrt.originalwd, rbsrt.target, |
|
441 | rbsrt.state, rbsrt.collapsef, keepf, | |
|
442 | keepbranchesf, rbsrt.external, | |
|
442 | rbsrt.state, rbsrt.collapsef, rbsrt.keepf, | |
|
443 | rbsrt.keepbranchesf, rbsrt.external, | |
|
443 | 444 | rbsrt.activebookmark) |
|
444 | 445 | storecollapsemsg(repo, rbsrt.collapsemsg) |
|
445 | 446 | if len(repo[None].parents()) == 2: |
@@ -462,7 +463,7 b' def rebase(ui, repo, **opts):' | |||
|
462 | 463 | editor = cmdutil.getcommiteditor(editform=editform, **opts) |
|
463 | 464 | newnode = concludenode(repo, rev, p1, p2, extrafn=extrafn, |
|
464 | 465 | editor=editor, |
|
465 | keepbranches=keepbranchesf, | |
|
466 | keepbranches=rbsrt.keepbranchesf, | |
|
466 | 467 | date=rbsrt.date) |
|
467 | 468 | else: |
|
468 | 469 | # Skip commit if we are collapsing |
@@ -501,7 +502,7 b' def rebase(ui, repo, **opts):' | |||
|
501 | 502 | ui.progress(_('rebasing'), None) |
|
502 | 503 | ui.note(_('rebase merging completed\n')) |
|
503 | 504 | |
|
504 | if rbsrt.collapsef and not keepopen: | |
|
505 | if rbsrt.collapsef and not rbsrt.keepopen: | |
|
505 | 506 | p1, p2, _base = defineparents(repo, min(rbsrt.state), |
|
506 | 507 | rbsrt.target, rbsrt.state, |
|
507 | 508 | rbsrt.targetancestors, |
@@ -521,7 +522,7 b' def rebase(ui, repo, **opts):' | |||
|
521 | 522 | newnode = concludenode(repo, rev, p1, rbsrt.external, |
|
522 | 523 | commitmsg=commitmsg, |
|
523 | 524 | extrafn=extrafn, editor=editor, |
|
524 | keepbranches=keepbranchesf, | |
|
525 | keepbranches=rbsrt.keepbranchesf, | |
|
525 | 526 | date=rbsrt.date) |
|
526 | 527 | if newnode is None: |
|
527 | 528 | newrev = rbsrt.target |
@@ -559,7 +560,7 b' def rebase(ui, repo, **opts):' | |||
|
559 | 560 | ui.note(_("update back to initial working directory parent\n")) |
|
560 | 561 | hg.updaterepo(repo, newwd, False) |
|
561 | 562 | |
|
562 | if not keepf: | |
|
563 | if not rbsrt.keepf: | |
|
563 | 564 | collapsedas = None |
|
564 | 565 | if rbsrt.collapsef: |
|
565 | 566 | collapsedas = newnode |
General Comments 0
You need to be logged in to leave comments.
Login now