[PATCH 2 of 2] histedit: reword message when a changeset produces no changes
timeless
timeless at mozdev.org
Wed Mar 2 17:40:34 EST 2016
# HG changeset patch
# User timeless <timeless at 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.
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
More information about the Mercurial-devel
mailing list