D3764: rebase: no need to store backup during dry-run while aborting

2018-06-22 Thread khanchi97 (Sushil khanchi)
khanchi97 added a comment.


  In https://phab.mercurial-scm.org/D3764#59797, @pulkit wrote:
  
  > @khanchi97 you should have created a new differential so that we don't 
loose your earlier patch titled: 'rebase: improve output of --dry-run' which is 
yet under review.
  
  
  Oh sorry, it was by mistake.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3764

To: khanchi97, #hg-reviewers
Cc: indygreg, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3764: rebase: no need to store backup during dry-run while aborting

2018-06-22 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  @khanchi97 you should have created a new differential so that we don't loose 
your earlier patch titled: 'rebase: improve output of --dry-run' which is yet 
under review.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3764

To: khanchi97, #hg-reviewers
Cc: indygreg, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3764: rebase: no need to store backup during dry-run while aborting

2018-06-22 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  In https://phab.mercurial-scm.org/D3764#59443, @indygreg wrote:
  
  > In https://phab.mercurial-scm.org/D3764#59425, @pulkit wrote:
  >
  > > Thinking out loud here: I see that `--dry-run` for rebase will be very 
useful for automation. How about returning 1 when there are conflicts and 
returning 0 when there are no conflicts? Also maybe we should add formatter 
support to the dry-run output for each command so that automation can read the 
JSON output and tell user what can happen.
  >
  >
  > I approve of both of these feature suggestions! However, they should be 
implemented in standalone changesets and not incorporated into this one.
  
  
  I agree.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3764

To: khanchi97, #hg-reviewers
Cc: indygreg, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3764: rebase: no need to store backup during dry-run while aborting

2018-06-22 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9258.
khanchi97 edited the summary of this revision.
khanchi97 retitled this revision from "rebase: improve output of --dry-run" to 
"rebase: no need to store backup during dry-run while aborting".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3764?vs=9126=9258

REVISION DETAIL
  https://phab.mercurial-scm.org/D3764

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -212,7 +212,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  saved backup bundle to 
$TESTTMP/repo1/repo2/skrepo/.hg/strip-backup/c83b1da5b1ae-f1e0beb9-backup.hg
   rebase aborted
 
   $ hg diff
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -341,8 +341,9 @@
 hint = _('use "hg rebase --abort" to clear broken state')
 raise error.Abort(msg, hint=hint)
 if isabort:
-return abort(self.repo, self.originalwd, self.destmap,
- self.state, activebookmark=self.activebookmark)
+nobackup = opts.get('nobackup')
+return abort(self.repo, self.originalwd, self.destmap, self.state,
+ activebookmark=self.activebookmark, nobackup=nobackup)
 
 def _preparenewrebase(self, destmap):
 if not destmap:
@@ -828,7 +829,7 @@
 else:
 ui.status(_('there will be no conflict, you can rebase\n'))
 finally:
-_origrebase(ui, repo, abort=True)
+_origrebase(ui, repo, abort=True, nobackup=True)
 elif inmemory:
 try:
 # in-memory merge doesn't support conflicts, so if we hit any, 
abort
@@ -859,6 +860,7 @@
 destspace = opts.get('_destspace')
 contf = opts.get('continue')
 abortf = opts.get('abort')
+nobackup = opts.get('nobackup')
 if opts.get('interactive'):
 try:
 if extensions.find('histedit'):
@@ -889,7 +891,7 @@
 ms = mergemod.mergestate.read(repo)
 mergeutil.checkunresolved(ms)
 
-retcode = rbsrt._prepareabortorcontinue(abortf)
+retcode = rbsrt._prepareabortorcontinue(abortf, nobackup=nobackup)
 if retcode is not None:
 return retcode
 else:
@@ -1543,7 +1545,7 @@
 
 return False
 
-def abort(repo, originalwd, destmap, state, activebookmark=None):
+def abort(repo, originalwd, destmap, state, activebookmark=None, 
nobackup=False):
 '''Restore the repository to its original state.  Additional args:
 
 activebookmark: the name of the bookmark that should be active after the
@@ -1588,7 +1590,10 @@
 
 # Strip from the first rebased revision
 if rebased:
-repair.strip(repo.ui, repo, strippoints)
+if nobackup:
+repair.strip(repo.ui, repo, strippoints, backup=False)
+else:
+repair.strip(repo.ui, repo, strippoints)
 
 if activebookmark and activebookmark in repo._bookmarks:
 bookmarks.activate(repo, activebookmark)



To: khanchi97, #hg-reviewers
Cc: indygreg, pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel