Commit Graph

16 Commits

Author SHA1 Message Date
Aida Getoeva
8940a7c464 uncommit: move to core
Summary: Moving extension `uncommit` to the core.

Reviewed By: quark-zju

Differential Revision: D10447651

fbshipit-source-id: 2ccf7db858b78e0811ffef742c82237259492719
2018-10-30 08:00:05 -07:00
Phil Cohen
498fe837ae tweakdefaults: move config overrides to core
Summary: tweakdefaults was overriding two configs to reconcile core/fb behavior. Let's just fold it in to the default.

Reviewed By: quark-zju

Differential Revision: D10432786

fbshipit-source-id: 2f56baa2d11d7814bffc489e56cb155548d1fc97
2018-10-18 03:15:26 -07:00
Mark Thomas
f18bd9714d help: improve some help messages
Summary: Make a few help messages clearer.

Reviewed By: phillco

Differential Revision: D10356915

fbshipit-source-id: 277d4cecbd17b647d6dd01209ff6f93a926d37d4
2018-10-15 09:37:19 -07:00
Mark Thomas
36c697f8e0 help: new default help
Summary:
Replace the default help for Mercurial with a curated list of interesting
commands, categorized by their use case.

Reviewed By: phillco

Differential Revision: D10356916

fbshipit-source-id: 65e578a4bfde7b0ad04e7107f4e77d8ea882d78a
2018-10-15 09:37:18 -07:00
Jun Wu
2682422a3e uncommit: fix "restoring deletion" case for treestate
Summary:
The uncommit command does some low-level changes to dirstate - it changes the
parents without updating the tree. Then it uses traditional dirstate APIs to
update the tree.

Treestate and traditional dirstate differ on the "remove" API - treestate would
make it a no-op-ish if the file is not already tracked. Traditional dirstate
would create such an entry blindly and then mark it as "removed".

Treestate cannot simply create the entry because it needs "EXIST_P1" or
"EXIST_P2" information, which is outside the "remove" API itself.

To fix this, teach "uncommit" to write a treestate entry in this case.

The longer term fix would probably be removing the low-level "setparents"
calls.

Reviewed By: DurhamG

Differential Revision: D9282452

fbshipit-source-id: 9a0f0ac2f1bc2a4296c10f95819457f4f9585a82
2018-08-13 08:35:43 -07:00
Jun Wu
c66764acec test-uncommit: add a case where treestate behaves wrong
Summary: Reported by bzawada at https://fburl.com/ji58tnyq.

Reviewed By: DurhamG

Differential Revision: D9282451

fbshipit-source-id: e320383bcb64662ee0e7129fc436aecbb88055c6
2018-08-10 18:25:21 -07:00
Jun Wu
96a9afa2a5 drawdag: inline drawdag
Summary:
Since we have `debugbuilddag` as a builtin command, and `drawdag` is
pretty useful for writing clean test cases. Let's inline it. This would
simplify many tests since `drawdag=..." is no longer needed.

Reviewed By: DurhamG

Differential Revision: D6827925

fbshipit-source-id: b749f57fd5c55b2cb000dd2da2c2f9bc2386a519
2018-04-13 21:50:59 -07:00
Jun Wu
7fa918cefd perftweaks: move commit head detection removal logic to core
Summary: Also change the internal API so it no longer accepts the "heads" argument.

Reviewed By: ryanmce

Differential Revision: D6745865

fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
2018-04-13 21:50:52 -07:00
Pulkit Goyal
a0250b29d4 rewriteutil: use precheck() in uncommit and amend commands
Differential Revision: https://phab.mercurial-scm.org/D1526
2017-11-28 05:50:45 +05:30
Boris Feld
50cd57c3da config: use 'experimental.evolution.allowunstable'
Extract 'experimental.evolution' = allowunstable as
'experimental.evolution.allowunstable'.

We keep the new option in the 'experimental.evolution' namespace in order to
stay coherent with other options ('experimental.evolution.bundle-obsmarker'
and 'experimental.evolution.track-operation') ease the renaming as possibly
'evolution.allowunstable'.

Differential Revision: https://phab.mercurial-scm.org/D1150
2017-09-28 18:56:40 +01:00
Boris Feld
a95ef2baa9 config: use 'experimental.evolution.create-markers'
Extract 'experimental.evolution' = createmarkers as
'experimental.evolution.createmarkers'.

We keep the new option in the 'experimental.evolution' namespace in order to
stay coherent with other options ('experimental.evolution.bundle-obsmarker'
and 'experimental.evolution.track-operation') ease the renaming as possibly
'evolution.createmarkers'.

Differential Revision: https://phab.mercurial-scm.org/D1149
2017-09-28 18:19:06 +01:00
Pulkit Goyal
ed45fa92a4 uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Differential Revision: https://phab.mercurial-scm.org/D809
2017-09-24 19:37:55 +05:30
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