Patchwork [4,of,8] histedit: omit useless message from abort

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 14, 2015, 11:37 p.m.
Message ID <411fed0e18c8cd18da2b.1450136245@waste.org>
Download mbox | patch
Permalink /patch/12041/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 14, 2015, 11:37 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450130894 0
#      Mon Dec 14 22:08:14 2015 +0000
# Node ID 411fed0e18c8cd18da2b87e58c9e4f6d5867118d
# Parent  4226922c73feb11bccb5457f16a4e80137a53407
histedit: omit useless message from abort

specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -997,7 +997,7 @@ 
             # check whether we should update away
             if repo.unfiltered().revs('parents() and (%n  or %ln::)',
                                     state.parentctxnode, leafs | tmpnodes):
-                hg.clean(repo, state.topmost)
+                hg.clean(repo, state.topmost, show_stats=True, quietempty=True)
             cleanupnode(ui, repo, 'created', tmpnodes)
             cleanupnode(ui, repo, 'temp', leafs)
         except Exception:
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -653,12 +653,12 @@ 
 # naming conflict in clone()
 _update = update
 
-def clean(repo, node, show_stats=True):
+def clean(repo, node, show_stats=True, quietempty=False):
     """forcibly switch the working directory to node, clobbering changes"""
     stats = updaterepo(repo, node, True)
     util.unlinkpath(repo.join('graftstate'), ignoremissing=True)
     if show_stats:
-        _showstats(repo, stats)
+        _showstats(repo, stats, quietempty)
     return stats[3] > 0
 
 def merge(repo, node, force=None, remind=True):
diff --git a/tests/test-histedit-no-change.t b/tests/test-histedit-no-change.t
--- a/tests/test-histedit-no-change.t
+++ b/tests/test-histedit-no-change.t
@@ -207,5 +207,16 @@ 
   |
   @  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
   
+aborting and not changing files can skip mentioning updating (no) files
+  $ hg up
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit --close-branch -m 'closebranch'
+  $ startediting 1 1 "(not changing anything)" # edit the 3rd of 3 changesets
+  % start editing the history (not changing anything)
+  | edit 292aec348d9e 6 closebranch
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  Make changes as needed, you may commit or record as needed now.
+  When you are finished, run hg histedit --continue to resume.
+  $ hg histedit --abort
 
   $ cd ..