Commit Graph

9 Commits

Author SHA1 Message Date
Pulkit Goyal
0456ca2613 unamend: drop unused vars, query after taking lock, use ctx.hex() for extras
This is the followup of review on D821.

Differential Revision: https://phab.mercurial-scm.org/D1579
2017-12-03 00:29:51 +05:30
Pulkit Goyal
c4428f695a uncommit: unify functions _uncommitdirstate and _unamenddirstate to one
The _unamenddirstate() function was inspired by _uncommitdirstate() function as
the logic was same but we were unable to use the latter function directly. So
previous patch introduced the _unamenddirstate() function and now this patch
unifies both the function and we have a _fixdirstate() function.

Adding function in previous patch and unifying in a later patch makes the
reasoning easier and also leaves the last patch dedicated to what it is meant to
be.

Differential Revision: https://phab.mercurial-scm.org/D971
2017-10-06 04:17:36 +05:30
Pulkit Goyal
9e302c97ba unamend: move fb extension unamend to core
unamend extension adds an unamend command which undoes the effect of the amend
command. This patch moves the unamend command from that extension to uncommit
extension and this one does not completely undoes the effect of amend command as
it creates a new commit, rather than reviving the old one back.

This also adds tests for the same.

.. feature::

   A new unamend command in uncommit extension which undoes the effect of the
   amend command by creating a new changeset which was there before amend and
   moving the changes that were amended to the working directory.

Differential Revision: https://phab.mercurial-scm.org/D821
2017-09-24 00:56:52 +05:30
Pulkit Goyal
5fe15c38d8 py3: handle keyword arguments in hgext/uncommit.py
Differential Revision: https://phab.mercurial-scm.org/D1323
2017-10-23 00:06:23 +05:30
Boris Feld
25a39ffc75 configitems: register the 'experimental.uncommitondirtywdir' config 2017-10-12 00:38:18 +02:00
Pulkit Goyal
00565cf47d uncommit: add an experimental.uncommitondirtywdir config
There are people who wants to do `hg uncommit` on dirty working directory, so
this patch adds a config which can be used to the achieve that.

Adds tests for the same.

Differential Revision: https://phab.mercurial-scm.org/D735
2017-09-20 02:40:25 +05:30
Pulkit Goyal
060e15ae30 uncommit: don't allow bare uncommit on dirty working directory
As per IRC discussion and suggestion by Augie, we should not allow bare `hg
uncommit` on dirty working directory.

Differential Revision: https://phab.mercurial-scm.org/D734
2017-09-20 02:18:01 +05:30
Pulkit Goyal
cbd5fda657 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
2017-09-16 02:34:13 +05:30
Pulkit Goyal
64bd8ed9ad uncommit: move fb-extension to core which uncommits a changeset
uncommit extension in fb-hgext adds a uncommit command which by default
uncommits a changeset and move all the changes to the working directory. If
file names are passed, uncommit moves the changes from those files to the
working directory and left the changeset with remaining committed files.

The uncommit extension in fb-hgext does not creates an empty commit like the one
in evolve extension unless user has specified ui.alllowemptycommit to True.

The test file added is a combination of tests from test-uncommit.t,
test-uncommit-merge.t and test-uncommit-bookmark.t from fb-hgext.

.. feature::

   A new uncommit extension which provides `hg uncommit` using which one can
   uncommit part or all of the changeset. This command undoes the effect of a
   local commit, returning the affected files to their uncommitted state.

Differential Revision: https://phab.mercurial-scm.org/D529
2017-08-24 22:55:56 +05:30