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