diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -677,6 +677,7 @@ ('a', 'abort', False, _('abort an interrupted rebase')), ('', 'auto-orphans', '', _('automatically rebase orphan revisions ' 'in the specified revset (EXPERIMENTAL)')), + ('', 'no-backup', False, _('do not save backup copies of files')), ] + cmdutil.dryrunopts + cmdutil.formatteropts, _('[-s REV | -b REV] [-d REV] [OPTION]')) def rebase(ui, repo, **opts): @@ -879,6 +880,7 @@ destspace = opts.get('_destspace') contf = opts.get('continue') abortf = opts.get('abort') + backup = not opts.get('no_backup') if opts.get('interactive'): try: if extensions.find('histedit'): @@ -909,7 +911,7 @@ ms = mergemod.mergestate.read(repo) mergeutil.checkunresolved(ms) - retcode = rbsrt._prepareabortorcontinue(abortf) + retcode = rbsrt._prepareabortorcontinue(abortf, backup=backup) if retcode is not None: return retcode else: diff --git a/tests/test-rebase-abort.t b/tests/test-rebase-abort.t --- a/tests/test-rebase-abort.t +++ b/tests/test-rebase-abort.t @@ -501,3 +501,50 @@ rebase aborted $ cd .. +========================= +Test --no-backup option | +========================= + $ hg init nobackup + $ cd nobackup + $ echo a>a + $ hg ci -qAma + $ echo b>b + $ hg ci -qAmb + $ echo c>c + $ hg ci -qAmc + $ hg up 0 -q + $ echo conflict>c + $ hg ci -Am "conflict with c" + adding c + created new head + $ hg log -GT "{rev}: {firstline(desc)}\n" + @ 3: conflict with c + | + | o 2: c + | | + | o 1: b + |/ + o 0: a + + $ hg rebase -s 1 -d . + rebasing 1:d2ae7f538514 "b" + rebasing 2:177f92b77385 "c" + merging c + warning: conflicts while merging c! (edit, then use 'hg resolve --mark') + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] +When --no-backup flag is not passed: + $ hg rebase --abort + saved backup bundle to $TESTTMP/nobackup/.hg/strip-backup/518b9bc3afb6-6c356d34-backup.hg + rebase aborted + $ hg rebase -s 1 -d . + rebasing 1:d2ae7f538514 "b" + rebasing 2:177f92b77385 "c" + merging c + warning: conflicts while merging c! (edit, then use 'hg resolve --mark') + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] +When --no-backup flag is passed: + $ hg rebase --abort --no-backup + rebase aborted + $ cd ..