Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGeec65b706caf: extdata: demonstrate bad behavior when a subprocess emits garbage
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| pulkit |
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | tests/test-extdata.t (12 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 6ff142d6588a | f802a75da585 | Augie Fackler | Jul 8 2019, 1:57 PM |
| $ hg init repo | $ hg init repo | ||||
| $ cd repo | $ cd repo | ||||
| $ for n in 0 1 2 3 4 5 6 7 8 9 10 11; do | $ for n in 0 1 2 3 4 5 6 7 8 9 10 11; do | ||||
| > echo $n > $n | > echo $n > $n | ||||
| > hg ci -qAm $n | > hg ci -qAm $n | ||||
| > done | > done | ||||
| test revset support | test revset support | ||||
| $ cat <<'EOF' >> .hg/hgrc | $ cat <<'EOF' >> .hg/hgrc | ||||
| > [extdata] | > [extdata] | ||||
| > filedata = file:extdata.txt | > filedata = file:extdata.txt | ||||
| > notes = notes.txt | > notes = notes.txt | ||||
| > shelldata = shell:cat extdata.txt | grep 2 | > shelldata = shell:cat extdata.txt | grep 2 | ||||
| > emptygrep = shell:cat extdata.txt | grep empty | > emptygrep = shell:cat extdata.txt | grep empty | ||||
| > badparse = shell:cat badparse.txt | |||||
| > EOF | > EOF | ||||
| $ cat <<'EOF' > extdata.txt | $ cat <<'EOF' > extdata.txt | ||||
| > 2 another comment on 2 | > 2 another comment on 2 | ||||
| > 3 | > 3 | ||||
| > EOF | > EOF | ||||
| $ cat <<'EOF' > notes.txt | $ cat <<'EOF' > notes.txt | ||||
| > f6ed this change is great! | > f6ed this change is great! | ||||
| > e834 this is buggy :( | > e834 this is buggy :( | ||||
| $ hg log -qr "extdata()" | $ hg log -qr "extdata()" | ||||
| hg: parse error: extdata takes at least 1 string argument | hg: parse error: extdata takes at least 1 string argument | ||||
| [255] | [255] | ||||
| $ hg log -qr "extdata(unknown)" | $ hg log -qr "extdata(unknown)" | ||||
| abort: unknown extdata source 'unknown' | abort: unknown extdata source 'unknown' | ||||
| [255] | [255] | ||||
| test a zero-exiting source that emits garbage to confuse the revset parser | |||||
| $ cat > badparse.txt <<'EOF' | |||||
| > +---------------------------------------+ | |||||
| > 9de260b1e88e | |||||
| > EOF | |||||
| BUG: this should print the revset parse error | |||||
| $ hg log -qr "extdata(badparse)" 2>&1 | grep ValueError | |||||
| ValueError: Mixing iteration and read methods would lose data | |||||
| test template support: | test template support: | ||||
| $ hg log -r:3 -T "{node|short}{if(extdata('notes'), ' # {extdata('notes')}')}\n" | $ hg log -r:3 -T "{node|short}{if(extdata('notes'), ' # {extdata('notes')}')}\n" | ||||
| 06254b906311 # first post | 06254b906311 # first post | ||||
| e8342c9a2ed1 # this is buggy :( | e8342c9a2ed1 # this is buggy :( | ||||
| f6ed99a58333 # this change is great! | f6ed99a58333 # this change is great! | ||||
| 9de260b1e88e | 9de260b1e88e | ||||