# HG changeset patch # User Pierre-Yves David # Date 1340761914 -7200 # Node ID da7509e7b50c997cb06f01c96f8665d4408f9b97 # Parent c099ed0dd472df51e144fc227adbc74d24e013b1 evolve: warn when uncommit leave an empty changeset This is intended to replace the proposed --delete flag. diff -r c099ed0dd472 -r da7509e7b50c hgext/evolve.py --- a/hgext/evolve.py Wed Jun 27 03:37:49 2012 +0200 +++ b/hgext/evolve.py Wed Jun 27 03:51:54 2012 +0200 @@ -610,6 +610,9 @@ repo.dirstate.setparents(newid, node.nullid) _uncommitdirstate(repo, old, match) updatebookmarks(newid) + if not repo[newid].files(): + ui.warn(_("new changeset is empty\n")) + ui.status(_('(use "hg kill ." to remove it)\n')) finally: wlock.release() finally: diff -r c099ed0dd472 -r da7509e7b50c tests/test-uncommit.t --- a/tests/test-uncommit.t Wed Jun 27 03:37:49 2012 +0200 +++ b/tests/test-uncommit.t Wed Jun 27 03:51:54 2012 +0200 @@ -311,6 +311,17 @@ 5eb72dbe0cb4 c706fe2c12f8 5eb72dbe0cb4 e8db4aa611f6 +Display a warning if nothing left + + $ hg uncommit e + new changeset is empty + (use "hg kill ." to remove it) + $ hg debugsuccessors + 5eb72dbe0cb4 c4cbebac3751 + 5eb72dbe0cb4 c706fe2c12f8 + 5eb72dbe0cb4 e8db4aa611f6 + c4cbebac3751 4f1c269eab68 + Test instability warning $ hg ci -m touncommit @@ -318,6 +329,6 @@ $ hg ci -Am addunrelated unrelated $ hg gdown 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - [7] touncommit + [8] touncommit $ hg uncommit aa 1 new unstables changesets