Skip to content

Commit

Permalink
docs revsets.md: fixup 4d08c2c
Browse files Browse the repository at this point in the history
This makes the examples in
https://martinvonz.github.io/jj/prerelease/revsets/#operators render
properly at the cost of worse (but readable) rendering on GitHub.

Also fixes a typo.
  • Loading branch information
ilyagr committed Jun 18, 2024
1 parent b8e921e commit a6d470d
Showing 1 changed file with 73 additions and 76 deletions.
149 changes: 73 additions & 76 deletions docs/revsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,143 +78,140 @@ only symbols.
You can use parentheses to control evaluation order, such as `(x & y) | z` or
`x & (y | z)`.

<details>
<summary>Examples:</summary>
??? examples

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

**Operator** `x-`
Given this history:
```
D
|\
| o C
| |
o | B
|/
o A
|
o root()
```

`D-``{C,B}`
**Operator** `x-`

`B-``{A}`
`D-` ⇒ `{C,B}`

`A-``{root()}`
`B-` ⇒ `{A}`

`root()-``{}` (empty set)
`A-` ⇒ `{root()}`

`none()-``{}` (empty set)
`root()-` ⇒ `{}` (empty set)

`(D|A)-``{C,B,root()}`
`none()-` ⇒ `{}` (empty set)

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

**Operator** `x+`
`(C|B)-` ⇒ `{A}`

`D+``{}` (empty set)
**Operator** `x+`

`B+``{D}`
`D+` ⇒ `{}` (empty set)

`A+``{B,C}`
`B+` ⇒ `{D}`

`root()+``{A}`
`A+` ⇒ `{B,C}`

`none()+``{}` (empty set)
`root()+` ⇒ `{A}`

`(C|B)+``{D}`
`none()+` ⇒ `{}` (empty set)

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

**Operator** `x::`
`(B|root())+` ⇒ `{D,A}`

`D::``{D}`
**Operator** `x::`

`B::``{D,B}`
`D::` ⇒ `{D}`

`A::``{D,C,B,A}`
`B::` ⇒ `{D,B}`

`root()::``{D,C,B,A,root()}`
`A::` ⇒ `{D,C,B,A}`

`::none()``{}` (empty set)
`root()::` ⇒ `{D,C,B,A,root()}`

`(C|B)::``{D,C,B}`
`none()::` ⇒ `{}` (empty set)

**Operator** `x..`
`(C|B)::` ⇒ `{D,C,B}`

`D..``{}` (empty set)
**Operator** `x..`

`B..``{D,C}` (note that, unlike `B::`, this includes `C`)
`D..` ⇒ `{}` (empty set)

`A..``{D,C,B}`
`B..` ⇒ `{D,C}` (note that, unlike `B::`, this includes `C`)

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

`none()..``{D,C,B,A,root()}`
`root()..` ⇒ `{D,C,B,A}`

`(C|B)..``{D}`
`none()..` ⇒ `{D,C,B,A,root()}`

**Operator** `::x`
`(C|B)..` ⇒ `{D}`

`::D``{D,C,B,A,root()}`
**Operator** `::x`

`::B``{B,A,root()}`
`::D` ⇒ `{D,C,B,A,root()}`

`::A``{A,root()}`
`::B` ⇒ `{B,A,root()}`

`::root()``{root()}`
`::A` ⇒ `{A,root()}`

`::none()``{}` (empty set)
`::root()` ⇒ `{root()}`

`::(C|B)``{C,B,A,root()}`
`::none()` ⇒ `{}` (empty set)

**Operator** `..x`
`::(C|B)` ⇒ `{C,B,A,root()}`

`..D``{D,C,B,A}`
**Operator** `..x`

`..B``{B,A}`
`..D` ⇒ `{D,C,B,A}`

`..A``{A}`
`..B` ⇒ `{B,A}`

`..root()``{}` (empty set)
`..A` ⇒ `{A}`

`..none()``{}` (empty set)
`..root()` ⇒ `{}` (empty set)

`..(C|B)``{C,B,A}`
`..none()` ⇒ `{}` (empty set)

**Operator** `x::y`
`..(C|B)` ⇒ `{C,B,A}`

`D::D``{D}`
**Operator** `x::y`

`B::D``{D,B}` (note that, unlike `B..D`, this includes `B` and excludes `C`)
`D::D` ⇒ `{D}`

`A::D``{D,C,B,A}`
`B::D` ⇒ `{D,B}` (note that, unlike `B..D`, this includes `B` and excludes `C`)

`root()::D``{D,C,B,A,root()}`
`A::D` ⇒ `{D,C,B,A}`

`none()::D``{}` (empty set)
`root()::D` ⇒ `{D,C,B,A,root()}`

`D::B``{}` (empty set)
`none()::D` ⇒ `{}` (empty set)

`(C|B)::(C|B)``{C,B}`
`D::B` ⇒ `{}` (empty set)

**Operator** `x..y`
`(C|B)::(C|B)` ⇒ `{C,B}`

`D..D``{}` (empty set)
**Operator** `x..y`

`B..D``{D,C}` (note that, unlike `B::D`, this includes `C` and excludes `B`)
`D..D` ⇒ `{}` (empty set)

`A..D``{D,C,B}`
`B..D` ⇒ `{D,C}` (note that, unlike `B::D`, this includes `C` and excludes `B`)

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

`none()..D``{D,C,B,A,root()}`
`root()..D` ⇒ `{D,C,B,A}`

`D..B``{}` (empty set)
`none()..D` ⇒ `{D,C,B,A,root()}`

`(C|B)..(C|B)``{}` (empty set)
`D..B` ⇒ `{}` (empty set)

</details>
`(C|B)..(C|B)` ⇒ `{}` (empty set)

## Functions

Expand Down

0 comments on commit a6d470d

Please sign in to comment.