Show More
@@ -177,6 +177,7 b' class rebaseruntime(object):' | |||||
177 | if e: |
|
177 | if e: | |
178 | self.extrafns = [e] |
|
178 | self.extrafns = [e] | |
179 |
|
179 | |||
|
180 | self.backupf = ui.configbool('ui', 'history-editing-backup') | |||
180 | self.keepf = opts.get('keep', False) |
|
181 | self.keepf = opts.get('keep', False) | |
181 | self.keepbranchesf = opts.get('keepbranches', False) |
|
182 | self.keepbranchesf = opts.get('keepbranches', False) | |
182 | self.obsoletenotrebased = {} |
|
183 | self.obsoletenotrebased = {} | |
@@ -343,7 +344,9 b' class rebaseruntime(object):' | |||||
343 | msg = _('cannot continue inconsistent rebase') |
|
344 | msg = _('cannot continue inconsistent rebase') | |
344 | hint = _('use "hg rebase --abort" to clear broken state') |
|
345 | hint = _('use "hg rebase --abort" to clear broken state') | |
345 | raise error.Abort(msg, hint=hint) |
|
346 | raise error.Abort(msg, hint=hint) | |
|
347 | ||||
346 | if isabort: |
|
348 | if isabort: | |
|
349 | backup = backup and self.backupf | |||
347 | return abort(self.repo, self.originalwd, self.destmap, self.state, |
|
350 | return abort(self.repo, self.originalwd, self.destmap, self.state, | |
348 | activebookmark=self.activebookmark, backup=backup, |
|
351 | activebookmark=self.activebookmark, backup=backup, | |
349 | suppwarns=suppwarns) |
|
352 | suppwarns=suppwarns) | |
@@ -585,11 +588,7 b' class rebaseruntime(object):' | |||||
585 | # case and realize that the commit was in progress. |
|
588 | # case and realize that the commit was in progress. | |
586 | self.storestatus() |
|
589 | self.storestatus() | |
587 |
|
590 | |||
588 |
def _finishrebase(self |
|
591 | def _finishrebase(self): | |
589 | """ |
|
|||
590 | backup: if False, no backup will be stored when stripping rebased |
|
|||
591 | revisions |
|
|||
592 | """ |
|
|||
593 | repo, ui, opts = self.repo, self.ui, self.opts |
|
592 | repo, ui, opts = self.repo, self.ui, self.opts | |
594 | fm = ui.formatter('rebase', opts) |
|
593 | fm = ui.formatter('rebase', opts) | |
595 | fm.startitem() |
|
594 | fm.startitem() | |
@@ -636,7 +635,7 b' class rebaseruntime(object):' | |||||
636 | if self.collapsef and not self.keepf: |
|
635 | if self.collapsef and not self.keepf: | |
637 | collapsedas = newnode |
|
636 | collapsedas = newnode | |
638 | clearrebased(ui, repo, self.destmap, self.state, self.skipped, |
|
637 | clearrebased(ui, repo, self.destmap, self.state, self.skipped, | |
639 | collapsedas, self.keepf, fm=fm, backup=backup) |
|
638 | collapsedas, self.keepf, fm=fm, backup=self.backupf) | |
640 |
|
639 | |||
641 | clearstatus(repo) |
|
640 | clearstatus(repo) | |
642 | clearcollapsemsg(repo) |
|
641 | clearcollapsemsg(repo) | |
@@ -833,8 +832,6 b' def rebase(ui, repo, **opts):' | |||||
833 | userrevs = list(repo.revs(opts.get('auto_orphans'))) |
|
832 | userrevs = list(repo.revs(opts.get('auto_orphans'))) | |
834 | opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)] |
|
833 | opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)] | |
835 | opts['dest'] = '_destautoorphanrebase(SRC)' |
|
834 | opts['dest'] = '_destautoorphanrebase(SRC)' | |
836 | backup = ui.configbool('ui', 'history-editing-backup') |
|
|||
837 | opts['backup'] = backup |
|
|||
838 |
|
835 | |||
839 | if dryrun: |
|
836 | if dryrun: | |
840 | return _dryrunrebase(ui, repo, opts) |
|
837 | return _dryrunrebase(ui, repo, opts) | |
@@ -856,7 +853,6 b' def rebase(ui, repo, **opts):' | |||||
856 | def _dryrunrebase(ui, repo, opts): |
|
853 | def _dryrunrebase(ui, repo, opts): | |
857 | rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts) |
|
854 | rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts) | |
858 | confirm = opts.get('confirm') |
|
855 | confirm = opts.get('confirm') | |
859 | backup = opts.get('backup') |
|
|||
860 | if confirm: |
|
856 | if confirm: | |
861 | ui.status(_('starting in-memory rebase\n')) |
|
857 | ui.status(_('starting in-memory rebase\n')) | |
862 | else: |
|
858 | else: | |
@@ -878,7 +874,7 b' def _dryrunrebase(ui, repo, opts):' | |||||
878 | if not ui.promptchoice(_(b'apply changes (yn)?' |
|
874 | if not ui.promptchoice(_(b'apply changes (yn)?' | |
879 | b'$$ &Yes $$ &No')): |
|
875 | b'$$ &Yes $$ &No')): | |
880 | # finish unfinished rebase |
|
876 | # finish unfinished rebase | |
881 |
rbsrt._finishrebase( |
|
877 | rbsrt._finishrebase() | |
882 | else: |
|
878 | else: | |
883 | rbsrt._prepareabortorcontinue(isabort=True, backup=False, |
|
879 | rbsrt._prepareabortorcontinue(isabort=True, backup=False, | |
884 | suppwarns=True) |
|
880 | suppwarns=True) | |
@@ -909,7 +905,6 b' def _origrebase(ui, repo, opts, rbsrt, i' | |||||
909 | destspace = opts.get('_destspace') |
|
905 | destspace = opts.get('_destspace') | |
910 | contf = opts.get('continue') |
|
906 | contf = opts.get('continue') | |
911 | abortf = opts.get('abort') |
|
907 | abortf = opts.get('abort') | |
912 | backup = opts.get('backup') |
|
|||
913 | if opts.get('interactive'): |
|
908 | if opts.get('interactive'): | |
914 | try: |
|
909 | try: | |
915 | if extensions.find('histedit'): |
|
910 | if extensions.find('histedit'): | |
@@ -940,7 +935,7 b' def _origrebase(ui, repo, opts, rbsrt, i' | |||||
940 | ms = mergemod.mergestate.read(repo) |
|
935 | ms = mergemod.mergestate.read(repo) | |
941 | mergeutil.checkunresolved(ms) |
|
936 | mergeutil.checkunresolved(ms) | |
942 |
|
937 | |||
943 |
retcode = rbsrt._prepareabortorcontinue(abortf |
|
938 | retcode = rbsrt._prepareabortorcontinue(abortf) | |
944 | if retcode is not None: |
|
939 | if retcode is not None: | |
945 | return retcode |
|
940 | return retcode | |
946 | else: |
|
941 | else: | |
@@ -969,7 +964,7 b' def _origrebase(ui, repo, opts, rbsrt, i' | |||||
969 | with util.acceptintervention(dsguard): |
|
964 | with util.acceptintervention(dsguard): | |
970 | rbsrt._performrebase(tr) |
|
965 | rbsrt._performrebase(tr) | |
971 | if not leaveunfinished: |
|
966 | if not leaveunfinished: | |
972 |
rbsrt._finishrebase( |
|
967 | rbsrt._finishrebase() | |
973 |
|
968 | |||
974 | def _definedestmap(ui, repo, inmemory, destf=None, srcf=None, basef=None, |
|
969 | def _definedestmap(ui, repo, inmemory, destf=None, srcf=None, basef=None, | |
975 | revf=None, destspace=None): |
|
970 | revf=None, destspace=None): |
General Comments 0
You need to be logged in to leave comments.
Login now