# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-09-15 21:04:13 # Node ID f94442d4698402f27201527b0663c93253ef7831 # Parent 3e92322d3b1f70f57e1ad61345f163e9ab6dec43 uncommit: rename the flag 'empty' to 'keep' which retains empty changeset This patch renames the flag 'empty' which retains the empty changeset if all the files are uncommitted to 'keep'. Differential Revision: https://phab.mercurial-scm.org/D726 diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -133,7 +133,7 @@ def _uncommitdirstate(repo, oldctx, matc ds.copy(src, dst) @command('uncommit', - [('', 'empty', False, _('allow an empty commit after uncommiting')), + [('', 'keep', False, _('allow an empty commit after uncommiting')), ] + commands.walkopts, _('[OPTION]... [FILE]...')) def uncommit(ui, repo, *pats, **opts): @@ -163,7 +163,7 @@ def uncommit(ui, repo, *pats, **opts): with repo.transaction('uncommit'): match = scmutil.match(old, pats, opts) - newid = _commitfiltered(repo, old, match, opts.get('empty')) + newid = _commitfiltered(repo, old, match, opts.get('keep')) if newid is None: ui.status(_("nothing to uncommit\n")) return 1 diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -30,7 +30,7 @@ Help for uncommit options ([+] can be repeated): - --empty allow an empty commit after uncommiting + --keep allow an empty commit after uncommiting -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns @@ -286,7 +286,7 @@ Uncommit leaving an empty changeset > P > EOS $ hg up Q -q - $ hg uncommit --empty + $ hg uncommit --keep $ hg log -G -T '{desc} FILES: {files}' @ Q FILES: |