Patchwork [2,of,2] histedit: reword message when a changeset produces no changes

login
register
mail settings
Submitter timeless@mozdev.org
Date March 2, 2016, 10:40 p.m.
Message ID <2def64dbbe33c49f84af.1456958434@waste.org>
Download mbox | patch
Permalink /patch/13573/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

timeless@mozdev.org - March 2, 2016, 10:40 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1456958343 0
#      Wed Mar 02 22:39:03 2016 +0000
# Node ID 2def64dbbe33c49f84af380e297638911b3e94b0
# Parent  d74c1e47550daab7959a111b03136518998af86d
histedit: reword message when a changeset produces no changes

There are various ways to use histedit such that an item in
the list of things to perform will not result in a change
relative to the previous repository state.

When that happens, histedit does not keep the commit/message.

This changes the note to try to explain to the user that it
will not be present in their history.
Yuya Nishihara - March 5, 2016, 8:05 a.m.
On Wed, 02 Mar 2016 16:40:34 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1456958343 0
> #      Wed Mar 02 22:39:03 2016 +0000
> # Node ID 2def64dbbe33c49f84af380e297638911b3e94b0
> # Parent  d74c1e47550daab7959a111b03136518998af86d
> histedit: reword message when a changeset produces no changes
> 
> There are various ways to use histedit such that an item in
> the list of things to perform will not result in a change
> relative to the previous repository state.
> 
> When that happens, histedit does not keep the commit/message.
> 
> This changes the note to try to explain to the user that it
> will not be present in their history.

Sounds good. Pushed to the clowncopter, thanks.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -482,7 +482,7 @@ 
         rulectx."""
         ctx = self.repo['.']
         if ctx.node() == self.state.parentctxnode:
-            self.repo.ui.warn(_('%s: empty changeset\n') %
+            self.repo.ui.warn(_('%s: skipping changeset (no changes)\n') %
                               node.short(self.node))
             return ctx, [(self.node, tuple())]
         if ctx.node() == self.node:
diff --git a/tests/test-histedit-fold-non-commute.t b/tests/test-histedit-fold-non-commute.t
--- a/tests/test-histedit-fold-non-commute.t
+++ b/tests/test-histedit-fold-non-commute.t
@@ -117,12 +117,14 @@ 
   (hg histedit --continue to resume)
 
 just continue this time
+keep the non-commuting change, and thus the pending change will be dropped
   $ hg revert -r 'p1()' e
   $ hg resolve --mark e
   (no more unresolved files)
   continue: hg histedit --continue
+  $ hg diff
   $ hg histedit --continue 2>&1 | fixbundle
-  7b4e2f4b7bcd: empty changeset
+  7b4e2f4b7bcd: skipping changeset (no changes)
 
 log after edit
   $ hg log --graph
@@ -262,7 +264,7 @@ 
   (no more unresolved files)
   continue: hg histedit --continue
   $ hg histedit --continue 2>&1 | fixbundle
-  7b4e2f4b7bcd: empty changeset
+  7b4e2f4b7bcd: skipping changeset (no changes)
 
 log after edit
   $ hg log --graph
diff --git a/tests/test-histedit-non-commute.t b/tests/test-histedit-non-commute.t
--- a/tests/test-histedit-non-commute.t
+++ b/tests/test-histedit-non-commute.t
@@ -171,7 +171,7 @@ 
   (no more unresolved files)
   continue: hg histedit --continue
   $ hg histedit --continue 2>&1 | fixbundle
-  7b4e2f4b7bcd: empty changeset
+  7b4e2f4b7bcd: skipping changeset (no changes)
 
 log after edit
   $ hg log --graph
@@ -254,7 +254,7 @@ 
   (no more unresolved files)
   continue: hg histedit --continue
   $ hg histedit --continue 2>&1 | fixbundle
-  7b4e2f4b7bcd: empty changeset
+  7b4e2f4b7bcd: skipping changeset (no changes)
 
 post message fix
   $ hg log --graph