Commit Graph

18 Commits

Author SHA1 Message Date
Mark Thomas
ccab681822 visibility: support undo after split
Summary:
Undo removes visibility of commits one by one, starting at the bottom of the
stack.  This doesn't work, as the bottom of the stack is kept visible by the
commits above it.

Remove them all in one go.

Reviewed By: mitrandir77

Differential Revision: D15079353

fbshipit-source-id: 52335b6dd1bd91c7f87d1a8ee2dbefa8aff7d24b
2019-04-26 01:07:30 -07:00
Jun Wu
f0dcadfa28 smartlog: rewrite part of the logic using efficent revset
Summary:
The old code basically selects ancestors of heads.

Rewrite the logic using revsets. Assuming we're only interested in ancestors
that are drafts, we can take advantage of `draft() & ::x` optimization.

The new logic also assumes master rev is public. Otherwise it can be slightly
different from the old logic.

The new code is much faster on my repo:

New code:

  quark@devvm33994 ~/fbcode/scm/hg % ./hg log -r 'smartlog()' --hidden -T . --time | wc -c
  time: real 0.630 secs (user 0.550+0.000 sys 0.030+0.000)
  6716

Old code:

  quark@devvm33994 ~/fbcode/scm/hg % hg.real log -r 'smartlog()' --hidden -T . --time | wc -c
  time: real 5.470 secs (user 3.920+0.000 sys 1.550+0.000)
  6716

This might make the ancestorcache hack (D5135746) unnecessary.

Reviewed By: DurhamG, sfilipco

Differential Revision: D14436008

fbshipit-source-id: 3c3bf47ccb67ea0e238542995009da9b9250b43b
2019-03-14 20:14:37 -07:00
Mark Thomas
9a19e06fee strip: move extension to core and rename to debugstrip
Summary:
Move the strip extension to core.  Rename the command to `hg debugstrip` as it
is not intended for use by users.  Users should use `hg hide` instead.

Reviewed By: quark-zju

Differential Revision: D14185822

fbshipit-source-id: ef096488cb94b72a7bb79f5bf153c064e0555b34
2019-02-25 03:55:08 -08:00
Mark Thomas
933be4cf4d undo: remove duringundologlock
Summary:
The duringundologlock config and hook were used to test the undolog using
timing.  We've replaced that, so remove the hook.

Reviewed By: quark-zju

Differential Revision: D13504644

fbshipit-source-id: a6b5fb308bc8938eec72788d93c9be6c237b72d7
2018-12-19 04:02:42 -08:00
Mark Thomas
de804dc6c0 undo: use extralog in tests rather than timing
Summary:
The undo tests use timing to detect when the lock is being taken.  This is
flaky.  Instead add extra logging to detect when the lock is taken.

Reviewed By: quark-zju

Differential Revision: D13504643

fbshipit-source-id: 07b80e416047d11b4ba3e1631c2385e5f12fa36f
2018-12-19 04:02:42 -08:00
Phil Cohen
3e592b81ae filemerge: add number of textual conflicts in each file to error message
Summary:
When you get an error, let's print the number of conflicts in each file. This will give the user some sense of how much work they have to do.

The code change is entirely in `filemerge.py`, and `tests/test-merge-conflict-count.t` adds a new test.

Reviewed By: quark-zju

Differential Revision: D9815243

fbshipit-source-id: 1b73a1db293902ac7242997a7d6ae09478344068
2018-10-22 12:47:41 -07:00
Saurabh Singh
6317ba0ca2 amend: replace with the fbamend extension
Summary:
The functionality we care about is provided by the `fbamend`
extension. Therefore, lets replace the `amend` extension with the `fbamend`
extension.

Reviewed By: farnz

Differential Revision: D10320739

fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
2018-10-11 06:59:23 -07:00
Saurabh Singh
f6e0d2d1ee inhibit: remove the extension
Summary:
The logic we care about has been moved to core so we can delete the
`inhibit` extension.

Reviewed By: markbt

Differential Revision: D10276448

fbshipit-source-id: 44cabe5d561344cf8f196127ce52491e4654b598
2018-10-10 10:01:45 -07:00
Mark Thomas
283c1fd469 undo: show a hint when a user might have wanted uncommit or unamend
Summary:
If a user uses `hg undo` to undo a `commit` or `amend` operation, this discards
the changes.  If they wanted to keep them in the working copy, they should have
used `hg uncommit` or `hg unamend`.

Provide a hint telling the user how to get back their changes, and letting them
know that `hg uncommit` and `hg unamend` exist.

Reviewed By: quark-zju

Differential Revision: D9346061

fbshipit-source-id: 300b1ac851a12ccf2432ba2c11fceac619667701
2018-08-22 03:50:55 -07:00
Jun Wu
0e88e00ceb commit: auto revive committed commits
Summary: It makes no sense for newly committed commits to be obsoleted.

Reviewed By: DurhamG

Differential Revision: D9236660

fbshipit-source-id: 95e4076bb9acde67aaab95f25a6de27d761cd960
2018-08-20 23:24:50 -07:00
Jun Wu
238cda6c14 amend: use hint framework for restack
Summary: This allows people to silence the hint.

Reviewed By: markbt

Differential Revision: D7392127

fbshipit-source-id: ac16f952a178d567ce13e22946127456972ebe85
2018-04-13 21:51:49 -07:00
Jun Wu
10bf57de39 prune: use hint framework
Summary:
This allows users to silence the "hide" advice.

In the future, we might want to change "hide/unhide" to only affect visibility
without changing obsolesce. So "strip" is not fully deprecated yet.

Reviewed By: markbt

Differential Revision: D7392131

fbshipit-source-id: 2448d4c91dffce31d29e2dd99078cb555c9a8f8c
2018-04-13 21:51:49 -07:00
Mark Thomas
629b2a9ec4 smartlog: always show latest public ancestor of draft commits
Summary:
Smartlog is supposed to show the latest public ancestor of all draft commits,
however this doesn't always happen.

The reason is a boundary error in the test for finding public commits.  If the
latest public ancestor is also the common ancestor (fairly normal), then it
will be excluded.

Reviewed By: quark-zju

Differential Revision: D7140139

fbshipit-source-id: 6999f7ad14f86653ebe4d4f6543b9c7533871cf2
2018-04-13 21:51:21 -07:00
Phil Cohen
de4ccf5688 restack: remove old pre-obsolesence fixup
Summary:
Per discussion with @[100000771202578:kulshrax] [1], the new behavior is enabled everywhere, and is also vastly preferable. Let's nuke the old code, as well as the config declaration and all places that manually enabled it.

[1]

> also, it looks like the pre-restack logic is still in that function, and the modern restack code path is still gated by a config option
> we should probably remove that

Reviewed By: kulshrax

Differential Revision: D7031365

fbshipit-source-id: dcc620c292bac03fdc0aa144546d4628bb673046
2018-04-13 21:51:13 -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
Jun Wu
fe0a348d39 perftweaks: move effectflag removal logic to core
Summary: This removes the effectflag logic from both core and perftweaks.

Reviewed By: ryanmce

Differential Revision: D6745769

fbshipit-source-id: 55ed1676e7117bca358471c256805ded7bc83f3c
2018-04-13 21:50:52 -07:00
Kostia Balytskyi
b27a46c987 fb-hgext: fix copied fb-hgext tests
Summary:
This is a big bulk of generally almost-obvious fixes to the moved tests. Mostly
these fixes have to do with correct importing of the actual extensions.

Depends on D6675329

Test Plan:
- ./run-tests.py fails less after this commit
- see further commits for more test fixes

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675344
2018-01-09 03:06:09 -08:00
Kostia Balytskyi
e75b9fc1b1 fb-hgext: move most of hgext3rd and related tests to core
Summary:
This commit moves most of the stuff in hgext3rd and related tests to
hg-crew/hgext and hg-crew/test respectively.

The things that are not moved are the ones which require some more complex
imports.


Depends on D6675309

Test Plan: - tests are failing at this commit, fixes are in the following commits

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675329
2018-01-09 03:03:59 -08:00