Commit Graph

13 Commits

Author SHA1 Message Date
Arun Kulshreshtha
b703374248 smartlog: make split successor labels work correctly
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
2017-01-20 00:24:45 -08:00
Adam Simpkins
63b7bb19c5 templates: fix help messages for template keywords
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
2017-01-19 12:52:54 -08:00
Arun Kulshreshtha
bcc5f95132 smartlog: remove --limit option
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
2016-12-22 12:07:45 -08:00
Jun Wu
f08e17d3ed testedwith: change testedwith to "ships-with-fb-hgext"
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
2016-11-29 13:24:07 +00:00
Arun Kulshreshtha
8408c71376 smartlog: add template keywords for split, fold, and histedit
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
2016-11-28 10:43:32 -08:00
Jun Wu
6318d6eb2a smartlog: do not change node char for fake nodes
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
2016-10-26 18:33:10 +01:00
Arun Kulshreshtha
5ae81e0470 smartlog: show inhibited obsolete nodes as x's
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
2016-10-25 17:22:22 -07:00
Jun Wu
efb6a83a3e smartlog: remove unused edge when indentnonpublic is set
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
2016-09-17 02:22:36 +01:00
Jun Wu
aaafeda370 smartlog: use graphstyle.grandparent to draw ellipsis
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
2016-09-17 00:51:26 +01:00
Jun Wu
dfa3d19fc2 smartlog: add an option to indent the non-public stack at the top
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
2016-09-16 16:36:10 +01:00
Jun Wu
9fea0c3f0c doc: replace "commit" where it is used as a noun with "changeset"
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
2016-09-21 15:45:25 +01:00
Jun Wu
9d18a32174 smartlog: improve documentation
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
2016-09-16 23:48:42 +01:00
Jun Wu
8a3a99ba21 hgext: move single file extensions to hgext3rd
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
2016-07-08 13:15:42 +01:00