( )⚙ D2396 stack: import Evolve stack test file

This is an archive of the discontinued Mercurial Phabricator instance.

stack: import Evolve stack test file
ClosedPublic

Authored by lothiraldan on Feb 23 2018, 5:36 AM.

Details

Summary

Import Evolve stack test file for starting to have good coverage on stack
definition.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

lothiraldan created this revision.Feb 23 2018, 5:36 AM

I haven't looked at the remainder of the series, but it feels weird to basically reinvent a special case of hg log as a debug command. I do see there is a commit introducing a revset for stack. Perhaps we could move it up in the series so we don't need what might be a not-very-useful debug command?

lothiraldan updated this revision to Diff 6213.Feb 28 2018, 6:59 PM
indygreg added a subscriber: yuja.Mar 19 2018, 3:59 PM
indygreg accepted this revision.
indygreg added inline comments.
mercurial/revset.py
1536

I'm not sure if the predicate should be prefixed with an underscore to mark it as internal. My reading of the help code is that the lack of a docstring will hide it from the docs.

I /think/ this is OK. But I wouldn't be surprised if @yuja or someone told me it needs changed. I'll queue this for now. We can always fix it up later if it is a problem.

This revision is now accepted and ready to land.Mar 19 2018, 3:59 PM
This revision was automatically updated to reflect the committed changes.
martinvonz added inline comments.
tests/test-stack.t
81

What if this was @ in the hg repo and only commits 4 and 5 were my own, then I would not want it to be part of my stack. It feels like a definition of upstream would be very helpful. Perhaps a way of providing a separate upstream per commit would be useful. Let's say upstream() was a revset, then I feel like something like "only(., upstream(.))" would be my stack. Of course, it gets weird if I have a history like we have here and I have defined the upstream of 4 to be 2 and the upstream of 5 to be 3 (or the other way around). I guess only commits that share an upstream can be part of the same stack.

96–108

I think I would have preferred to see all of these in my stack rather than just commit 6. Would you?

yuja added inline comments.Mar 21 2018, 10:14 AM
mercurial/revset.py
1536

If it's internal (i.e. shouldn't be accessible by user), _stack() is preferred.
If it's just experimental, it can be hidden by "(EXPERIMENTAL)"
in docstring.

1541

Nit: I prefer stackmod. and name the revset function as stack().

yuja added inline comments.Mar 21 2018, 10:29 AM
mercurial/revset.py
1549

This breaks the order of tip:0 & stack() for example, and is moot
since 68fcc5503ec5, which makes stacks follow the standard order.

lothiraldan added inline comments.Apr 5 2018, 11:35 AM
tests/test-stack.t
96–108

The goal of this series is to define a clean stack definition API. We started by reusing the existing bits from histsedit and show stack.

I've added a first way to configure the stack definition through configuration. I think seeing all the drafts is a good idea and we will works in a later series to have a way to include them in the stack.

lothiraldan marked 3 inline comments as done.Apr 5 2018, 12:24 PM
lothiraldan added inline comments.
mercurial/revset.py
1549

I have send a follow-up https://phab.mercurial-scm.org/D3136