ma-ti
ma-ti

Reputation: 134

Phases: How to specify as range endpoint the first non-obsolete predecessor of an obsolete changeset?

Problem: When using the 'evolve' extension for Mercurial some changesets are marked obsolete and are therefore hidden for example to the 'log' command, like this:

$ hg log -11:
abort: hidden revision '-11'!
(use --hidden to access hidden revisions)

$ hg log -12: -T '{rev}'
o 27916
|
| o 27915
| |\
| o | 27914
| | |
| o | 27913
| |/
| | o 27912
| | |
| | o 27911
| | |\
| | o | 27910
| | | |
| | o | 27909
| | | |
| | | | @ 27908
| | | | |
| | | | o 27905
| | | | |

Question: Is there a way to specify a range endpoint to represent either a non-hidden changeset or, if the given changeset is hidden (like '-11'), the preceding non-hidden ancestor (in this example '-12')? I looked at the 'revsets' documentation but failed to find a combination which worked.

Upvotes: 0

Views: 75

Answers (1)

planetmaker
planetmaker

Reputation: 6044

The answer to your question lies in the proper use of revsets. Checkout hg help revsets for more indepth information.

In this case this should work:

hg glog -r"last(ancestors(-11) and not hidden())::-11" --hidden

It will list all changesets from -11 to the first non-hidden ancestor of -11 (including those two).

Upvotes: 1

Related Questions