The modern pager API is to use `ui.pager()` explicitly just before the time
a command needs a pager. It's now hard-coded in individual commands, and
opt-in by default. Users wanting to disable pagers for certain commands need
to disable them explicitly. Ideally we don't need the pager extensions or
the `pager.attend` setting.
This patch migrates `show`, `smartlog`, `fastannotate`, and `grep` to use
the modern API.
Differential Revision: https://phab.mercurial-scm.org/D437
Summary:
We've seen a couple of issues when there are lots of public commits between a
head and master bookmark. Smartlog tries to draw all of the public commits
and drawing it can be too slow. See example below
```
o - some commit that smartlog wants to draw
/
o
.
. -- many commits
.
o - master bookmarks
```
This issue happens often while using infinitepush extension.
Let's fix it by drawing just one public commit between a head and master.
We could of course avoid drawing this public commit at all, but in that case
output would be smth like
```
o - some commit that smartlog wants to draw
/
o
| - many commits in betwee, but user doesn't see it because there are no dots
o - master bookmarks
```
Test Plan: Slowly run tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D168
Makes obs markers for undos more meaningful. When an undo performs a strict one
to one change, the written obs marker reflects that and the user even gets a
helpful ui message in smartlog. One to many undos do not support such obs
markers (currently) because we can't tell splits and divergence apart easily.
Differential Revision: https://phab.mercurial-scm.org/D108
The old smartlog revset is no longer used.
Test Plan:
Confirmed no user uses `smartlog('all')` or `smartlog('recent')` by searching
`smartlog(` globally.
Differential Revision: https://phab.mercurial-scm.org/D48
Summary:
debuginhibit was removed since we no longer have a separate inhibit state.
smartlog hack about changing "o" to "x" was removed since "obsolete()"
revset is correct and the hack is unnecessary now.
directaccess was removed from tests since inhibit does not depend on it.
`- obsolete()` was added to some revsets to avoid divergence and other
surprises.
Use `inhibit.revive` API in infinitepush and reset to revive changesets
properly.
Remove various hacky code that mangle inhibit state in corner cases.
Most test changes are `o` changed to `x` in output since we draw
`obsolete()` state correctly now. `test-infinitepush-backup-remotefilelog.t`
change was because output could be `bytes/sec` instead of `KB/sec`.
Test Plan: arc unit
Reviewers: #mercurial, kulshrax
Reviewed By: kulshrax
Subscribers: kulshrax, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5391361
Signature: t1:5391361:1499722618:d3c1cf629f0c59ecdf1dfd5e653c1eb6176646b8
Summary:
We have seem some errors when closing the database during `db.close()`. This
diff nukes the database if that happens.
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5305123
Signature: t1:5305123:1498166056:8355e861c18c670e6342e541f2bc55d65bc7b1c8
Summary:
Now that fbamend has most of the features we want. Replace evolve
used by tests.
Minor changes are made to some extensions to make test pass:
- reset: drop commit reviving support (was provided by "hg touch")
- smartlog: do not assume who provides "allsuccessors" revset
- fbamend: return 1 on "nothing changed"
- fbamend: write operation data for split and fold
- fbamend: do not print incompatibility notice
- fbamend: do not disable itself when rebase is not enabled
- inhibit: remove `bookmark -D` option - use `prune -B` instead
Test Plan: arc unit
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5258813
Signature: t1:5258813:1497604051:0c7334f9a6554cf31aaaaa2a4995b17d4e445847
Summary:
`gdbm` is unavailable on Windows. Python provides module called `anydbm` which
abstracts the implementation of `dbm` and is even capable of using a dump
Python-only implementation if nothing is installed.
Test Plan: - rt
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5154620
Summary:
`revlog.ancestor` is expensive on long changelog, but is only called a few
(about 30) times for smartlog usage. Therefore we could simply cache the
result in a key-value database.
This speeds up smartlog by about 200ms.
Test Plan: Added a new test
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5135746
Signature: t1:5135746:1495783503:411260551fd29fda42c9fc809b56f8f77fb2eaf4
Summary: Upstream has deprecated cmdutil.commands() in favor of registrar.commands()
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5106486
Signature: t1:5106486:1495485074:0e20f00622cc651e8c9dda837f84dd84cc51099e
Summary:
The function signature for a number of functions relating to templating changed.
In addition, the templater layer now requires that template functions have been
registered via the decorator, otherwise a require attribute is missing and
things blow up.
Test Plan: arc unit. rt.
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4908220
Signature: t1:4908220:1492545033:66f089e03a6064ae96ca36f3abf99ecb6d48d422
Summary:
`mercurial.revset` was recently split into `revset + revsetlang + smartset`.
Update our code accordingly.
D4604848 has fixed the `revsetlang` part. This patch fixes the remaining
`smartset` part.
Also fixes some test failures introduced by D4547080.
Test Plan: `arc unit`
Reviewers: #mercurial
Subscribers: jeroenv, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4595417
Summary:
Previously, smartlog use `tip` as the fallback master, and prompts:
warning: there is no master changeset locally, try pulling from server
if master is `tip`.
That makes smartlog less friendly for external users. This patch removes the
prompt and changes the fallback master to the last public revision so it
works out-of-box.
Test Plan: `arc unit`
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4555346
Signature: t1:4555346:1487036530:35a5fa65d5419e7324d3203fa52de9a82b8132e3
Summary: The template keyword for split was not producing output because obsmarkers with multiple successors were being filtered out.
Test Plan: Correct "Split into XXX, YYY" labels appear in smartlog. Tests have been added for all of the obsolescence-related smartlog template keywords.
Reviewers: #sourcecontrol, rmcelroy, durham
Reviewed By: durham
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4396453
Signature: t1:4396453:1484880307:bfdc60385e42fee169ff2f0ec4f85dd0747b55c9
Summary:
Many of the template keywords in our extensions were being registered
incorrectly, causing their help output to be rendered incorrectly in the
"hg help templates" output. The ones in smartlog.py were particularly bad, as
most of them showed only their description, without displaying the name of the
template. In smartlog.py only singlepublicsuccessor was being displayed
correctly, because it's docstring explicitly included it's own name at the
start.
This fixes all of our extensions to consistently use the
registrar.templatekeyword() decorator to register the keywords. This decorator
automatically prefixes the help message with the keyword name. The
mercurial/extensions.py code will explicitly check to see if an extension
contains an "templatekeyword" attribute, and if so it will register any
keywords contained in this registry after calling extsetup().
Test Plan:
Added new unit tests to check the output of "hg help templates" for the
affected keywords.
Reviewers: #sourcecontrol, kulshrax, ikostia, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, net-systems-diffs@, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4427729
Signature: t1:4427729:1484831476:17b478a5e867dfc3f85402588c381bf8b1831107
Summary: The --limit option was carried over from the option list for `hg log`. However, it doesn't do anything in smartlog, so this diff removes it from the option list.
Test Plan: `hg smartlog --help` no longer shows `--limit`.
Reviewers: #mercurial
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4363187
Tasks: 15186221
Summary:
Using `testedwith = 'internal'` is not a good habit [1]. Having it
auto-updated in batch would also introduce a lot of churn. This diff makes
them "ships-with-fb-hgext". If we do want to fill the ideal "testedwith"
information, we could put it in a centric place, like a "fbtestedwith"
extension rewriting those "ships-with-fb-hgext" on the fly.
Maybe having in-repo tags for tested Mercurial releases is also a good idea.
[1]: www.mercurial-scm.org/repo/hg/rev/2af1014c2534
Test Plan: `arc lint`
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4244689
Signature: t1:4244689:1480440027:3dc18d017b48beba1176fbfd120351889259eb4b
Summary: Add template keywords for split, folded, and histedited successors. This will enable us to show "(Histedited as XXX)" annotations in smartlog.
Test Plan: By itself this should be a no-op. All unit tests still pass. The effects of this aren't visible unless a user uses a version of our facebook.rc config file that contains updated smartlog templates. See D4209113.
Reviewers: durham
Reviewed By: durham
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4209314
Signature: t1:4209314:1479744837:8eeeeb7a031abfabeb302abde9e4b1f3d789a479
Summary:
The fake node has an illegal revision number that cannot be used in the
`allsuccessors` revset.
Test Plan: It should work in theory. I couldn't construct a testcase relatively quickly.
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4082186
Signature: t1:4082186:1477503381:ac646071af5ad0e63a83ca7199e62a75ef736bce
Summary: Make nodes with visible successors render as 'x' in hg smartlog output. Previously these nodes were rendered as 'o' because the inhibit extension made them appear to be non-obsolete.
Test Plan:
1. Create a stack of commits.
2. Amend a commit in the middle of the stack.
3. Run `hg sl`, observe that although the precursor of the amended commit renders as an 'x'.
4. Run `hg unamend`, then update to a different commit (so the precursor is not the current commit and thus not rendered as '@').
5. Observe that the precursor now appears as 'o' again because it has no visible successors.
Reviewers: #sourcecontrol, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4071058
Tasks: 13652083
Signature: t1:4071058:1477434742:f57bf5a07b6b9497472deb8445f5fc01a5379f8c
Summary:
This patch removes the unused line and space so it looks a bit better:
```
.
.
.
| o o
| | |
| | |
| o o
|/ /
| |
o o
. .
. .
(before) (after)
```
Due to the current implementation of graphlog, it's a bit hacky to achieve the
above effect.
Test Plan: Run `test-smartlog*.t`
Reviewers: #mercurial, ttung, mjpieters, durham
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D3881516
Signature: t1:3881516:1475170264:477c66b2372d04c4e5d7c8fbb69de30599706e5d
Summary:
Now that the graph module can draw "..." for grand parents, it's no longer
to have fake nodes for that purpose. Remove most fake node related logic.
This will make the output more compact.
Note that the fake node is still used for "indentnonpublic" and its output
is slightly changed to display an "o" node, which will be fixed in the next
diff.
Since we now rely on a recent version of mercurial, remove some "inspect"
check for ancient mercurial support.
Test Plan: Run the modified `test-smartlog.t` and other `test-smartlog*.t`.
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3880771
Signature: t1:3880771:1474306496:3400c70efbb569c5096e724720ead1992b87f160
Summary:
One thing that may confuse new users is that when draft changesets are on top
of public changesets:
```
o draft
|
o remote/master
```
It's unclear whether the draft changeset is already in the master branch, or not.
This diff adds an option to move the drafts to the second column to indicate they
are not part of master.
Test Plan: Run `test-smartlog.t`
Reviewers: ttung, durham, #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3876951
Signature: t1:3876951:1474043568:c97b26b49917f36a5197af93ea386658b91d56a4
Summary:
"changeset" is a more official term and let's use it. Note that this patch
only changes documentation / i18n messages visible to the users and header
comment blocks to developers. Other places like comments in the code are
untouched.
With the "dialect" extension enabled, users will still see the more friendly
term - "commit".
Test Plan:
`arc unit`. Note the remotefilelog failure is probably unrelated - seems
related to ongoing / upcoming manifest refactoring upstream.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3900394
Signature: t1:3900394:1474470348:6a1b5691e2599cc47df18b227d56d1f9d3c7c906
Summary:
Add docstring so `hg help -e smartlog` works and the config options are more
visible to users.
Rename "commit" to "changeset" so it sounds more official in the hg community.
Test Plan: No logic change. Code Review
Reviewers: durham, #mercurial, ttung, mjpieters
Reviewed By: mjpieters
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3876938
Signature: t1:3876938:1474288105:cb751cc868e70761cf3b34749eabf2a32c886a2d
Summary:
Be a better citizen under system python path.
Fix all tests issues and change setup.py to use glob pattern to include
all extensions.
Test Plan:
Run tests and `make local`.
Also build and install the package and run `hg sl` in major repos.
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3534311
Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2