Differences between revisions 1 and 2
Revision 1 as of 2017-12-06 20:19:37
Size: 807
Editor: KevinBullock
Comment:
Revision 2 as of 2017-12-06 20:25:23
Size: 1528
Editor: AugieFackler
Comment: Add some things that Kevin and I discussed today.
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
== Expect Revset ==

`expect(<set>, <int>)` revset: fails if `<set>` isn’t exactly `<int>` elements

`expect(<set>, <min>, <max>)` revset: fails if `<set>` isn’t exactly between `<min>` and `<max>` inclusive

`one(<set>)` alias for `expect(<set>, 1)`

This then allows an alias for `hg next` to be `update -r one(children(.))` with sane failure behavior, and also makes some other scripting tasks a little less difficult.

== hg shellprompt ==
`hg shellprompt bash "{branch} {node|shortest}"`: emits string for eval in bash to efficiently produce the specified template. Opens the door to first-part native prompt helpers that don’t have to start a Python. Prior art in docker’s command line tools?

Note:

This page is primarily intended for developers of Mercurial.

Good Ideas for Enhancements

Ideas that the community has discussed and largely approved of, but no one has yet implemented. This is somewhat distinct from Plan pages, although the two lists may overlap.

Projects listed here may be a good starting point for new contributors wanting to take on a more significant contribution than fixing "easy" bugs, without having to take on an up-front design discussion.

1. Expect Revset

expect(<set>, <int>) revset: fails if <set> isn’t exactly <int> elements

expect(<set>, <min>, <max>) revset: fails if <set> isn’t exactly between <min> and <max> inclusive

one(<set>) alias for expect(<set>, 1)

This then allows an alias for hg next to be update -r one(children(.)) with sane failure behavior, and also makes some other scripting tasks a little less difficult.

2. hg shellprompt

hg shellprompt bash "{branch} {node|shortest}": emits string for eval in bash to efficiently produce the specified template. Opens the door to first-part native prompt helpers that don’t have to start a Python. Prior art in docker’s command line tools?

3. See Also


CategoryDeveloper CategoryNewFeatures

WeShouldDoThat (last edited 2020-09-25 04:26:54 by MattHarbison)