Skip to content

Commit

Permalink
docs: add examples for some revset functions too
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonz committed Jun 19, 2024
1 parent 95fbf9f commit 3ebad15
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions docs/revsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,67 @@ given [string pattern](#string-patterns).

* `working_copies()`: The working copy commits across all the workspaces.

??? examples

Given this history:
```
E
|
| D
|/|
| o C
| |
o | B
|/
o A
|
o root()
```

**function** `reachable()`

`reachable(E, A..)` ⇒ `{E,D,C,B}`

`reachable(D, A..)` ⇒ `{E,D,C,B}`

`reachable(C, A..)` ⇒ `{E,D,C,B}`

`reachable(B, A..)` ⇒ `{E,D,C,B}`

`reachable(A, A..)` ⇒ `{}` (empty set)

**function** `connected()`

`connected(E|A)` ⇒ `{E,B,A}`

`connected(D|A)` ⇒ `{D,C,B,A}`

`connected(A)` ⇒ `{A}`

**function** `heads()`

`heads(E|D)` ⇒ `{E,D}`

`heads(E|C)` ⇒ `{E,C}`

`heads(E|B)` ⇒ `{E}`

`heads(E|A)` ⇒ `{E}`

`heads(A)` ⇒ `{A}`

**function** `roots()`

`roots(E|D)` ⇒ `{E,D}`

`roots(E|C)` ⇒ `{E,C}`

`roots(E|B)` ⇒ `{B}`

`roots(E|A)` ⇒ `{A}`

`roots(A)` ⇒ `{A}`

## String patterns

Functions that perform string matching support the following pattern syntax:
Expand Down

0 comments on commit 3ebad15

Please sign in to comment.