Bug 5374 - revsets: add around(set, depth) and extend ancestors(set[, depth]) / descendants(set[, depth])
Summary: revsets: add around(set, depth) and extend ancestors(set[, depth]) / descenda...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: PC Windows
: wish feature
Assignee: Yuya Nishihara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-20 16:25 UTC by timeless
Modified: 2017-07-10 00:00 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description timeless 2016-09-20 16:25 UTC
When investigating (hg log -G, hg bisect, ...) it's common to have a sense of what an interesting commit is, but want to see what's around it (ancestors to some depth, descendants to some depth).

We propose to add:
around(set, depth) -- which will include all* changesets which are ancestors/descendants of a changeset in set

and add an optional argument depth to ancestors(set) and descendants(set) as:
ancestors(set[, depth]) -- will include depth levels of ancestors of changesets in set
descendants(set[, depth]) -- will include depth levels of descendants of changesets in set

ancestors(set, 0) == set
descendants(set, 0) == set
around(set, 0) == set
around(set, 1) = ancestors(set, 1) + descendants(set, 1)
Comment 1 Yuya Nishihara 2016-10-13 11:18 UTC
(marked as confirmed since the proposal sounds generally nice.)
Comment 2 Bugzilla 2017-03-13 00:00 UTC
Bug was inactive for 150 days, archiving
Comment 3 Gregory Szorc 2017-03-13 00:35 UTC
Reopening because this does sound very nice!
Comment 4 Yuya Nishihara 2017-06-17 11:56 UTC
ancestors(set, depth) and descendants(set, depth) will be basic building
blocks of set{generation} operator. So I started implementing them.

http://markmail.org/message/sjnnwa43s4eksu62

I won't add around() because it can be easily defined as an alias.
Comment 5 Bugzilla 2017-07-02 00:00 UTC
Bug was set to IN_PROGRESS for 14 days, moving back to confirmed
Comment 6 Yuya Nishihara 2017-07-02 00:52 UTC
Implemented by 272a44cac57e and a53bfc2845f2.
Comment 7 Bugzilla 2017-07-10 00:00 UTC
Bug was set to TESTING for 8 days, resolving