Patchwork D3871: rebase: improve output of --confirm option

login
register
mail settings
Submitter phabricator
Date July 10, 2018, 3:43 a.m.
Message ID <80b20b860adbb93cb8a3c62274658049@localhost.localdomain>
Download mbox | patch
Permalink /patch/32726/
State Not Applicable
Headers show

Comments

phabricator - July 10, 2018, 3:43 a.m.
khanchi97 updated this revision to Diff 9487.
khanchi97 edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3871?vs=9387&id=9487

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

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

CHANGE DETAILS




To: khanchi97, #hg-reviewers
Cc: mercurial-devel

Patch

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
@@ -513,7 +513,6 @@ 
   merging e
   hit a merge conflict
   apply changes (yn)? y
-  rebasing 4:e860deea161a "e"
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see hg resolve, then hg rebase --continue)
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -406,7 +406,7 @@ 
             self.repo.ui.debug("rebasing on disk\n")
         self.repo.ui.log("rebase", "", rebase_imm_used=self.inmemory)
 
-    def _performrebase(self, tr):
+    def _performrebase(self, tr, supprbinfo=False):
         self._assignworkingcopy()
         repo, ui = self.repo, self.ui
         if self.keepbranchesf:
@@ -455,7 +455,8 @@ 
                     self.obsoletewithoutsuccessorindestination,
                 )
             for rev in sortedrevs:
-                self._rebasenode(tr, rev, allowdivergence, progress)
+                self._rebasenode(tr, rev, allowdivergence, progress,
+                                 supprbinfo=supprbinfo)
         p.complete()
         ui.note(_('rebase merging completed\n'))
 
@@ -504,7 +505,8 @@ 
                 mergemod.mergestate.clean(repo)
             return newnode
 
-    def _rebasenode(self, tr, rev, allowdivergence, progressfn):
+    def _rebasenode(self, tr, rev, allowdivergence, progressfn,
+                    supprbinfo=False):
         repo, ui, opts = self.repo, self.ui, self.opts
         dest = self.destmap[rev]
         ctx = repo[rev]
@@ -535,7 +537,8 @@ 
                                   self.skipped))
             self.state[rev] = dest
         elif self.state[rev] == revtodo:
-            ui.status(_('rebasing %s\n') % desc)
+            if not supprbinfo:
+                ui.status(_('rebasing %s\n') % desc)
             progressfn(ctx)
             p1, p2, base = defineparents(repo, rev, self.destmap,
                                          self.state, self.skipped,
@@ -879,21 +882,22 @@ 
                     rbsrt._prepareabortorcontinue(isabort=True,
                                                   backup=False,
                                                   suppwarns=True)
-                    _dorebase(ui, repo, opts, inmemory=False)
+                    _dorebase(ui, repo, opts, inmemory=False, supprbinfo=True)
                 else:
                     # finish unfinished rebase
                     rbsrt._finishrebase()
             else:
                 # no need to store backup in case of dryrun
                 rbsrt._prepareabortorcontinue(isabort=True, backup=False,
                                               suppwarns=True)
 
-def _dorebase(ui, repo, opts, inmemory=False):
+def _dorebase(ui, repo, opts, inmemory=False, supprbinfo=False):
     rbsrt = rebaseruntime(repo, ui, inmemory, opts)
-    return _origrebase(ui, repo, opts, rbsrt, inmemory=inmemory)
+    return _origrebase(ui, repo, opts, rbsrt, inmemory=inmemory,
+                       supprbinfo=supprbinfo)
 
 def _origrebase(ui, repo, opts, rbsrt, inmemory=False, leaveunfinished=False,
-                supptrwarns=False):
+                supptrwarns=False, supprbinfo=False):
     with repo.wlock(), repo.lock():
         # Validate input and define rebasing points
         destf = opts.get('dest', None)
@@ -962,7 +966,7 @@ 
             if singletr and not inmemory:
                 dsguard = dirstateguard.dirstateguard(repo, 'rebase')
             with util.acceptintervention(dsguard):
-                rbsrt._performrebase(tr)
+                rbsrt._performrebase(tr, supprbinfo=supprbinfo)
                 if not leaveunfinished:
                     rbsrt._finishrebase()