Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG7e7080ab8ba8: grep: improve test coverage
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
| hg-reviewers |
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | tests/test-grep.t (25 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 7d2bfde5ca39 | 526d69eeea31 | Valentin Gatien-Baron | May 17 2020, 12:49 PM |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | valentin.gatienbaron | ||
| Closed | valentin.gatienbaron | ||
| Closed | valentin.gatienbaron |
| $ cd .. | $ cd .. | ||||
| Test for showing working of allfiles flag | Test for showing working of allfiles flag | ||||
| $ hg init sng | $ hg init sng | ||||
| $ cd sng | $ cd sng | ||||
| $ echo "unmod" >> um | $ echo "unmod" >> um | ||||
| $ hg ci -A -m "adds unmod to um" | $ echo old > old | ||||
| adding um | $ hg ci -q -A -m "adds unmod to um" | ||||
| $ echo "something else" >> new | $ echo "something else" >> new | ||||
| $ hg ci -A -m "second commit" | $ hg ci -A -m "second commit" | ||||
| adding new | adding new | ||||
| $ hg grep -r "." "unmod" | $ hg grep -r "." "unmod" | ||||
| um:1:unmod | um:1:unmod | ||||
| Working directory is searched by default | Existing tracked files in the working directory are searched by default | ||||
| $ echo modified >> new | $ echo modified >> new | ||||
| $ hg grep mod | $ echo 'added' > added; hg add added | ||||
| $ echo 'added, missing' > added-missing; hg add added-missing; rm added-missing | |||||
| $ echo 'untracked' > untracked | |||||
| $ hg rm old | |||||
| $ hg grep '[^Z]' | |||||
| added:added | |||||
| new:something else | |||||
| new:modified | new:modified | ||||
| um:unmod | um:unmod | ||||
| which can be overridden by -rREV | which can be overridden by -rREV | ||||
| $ hg grep -r. mod | $ hg grep -r. mod | ||||
| um:1:unmod | um:1:unmod | ||||
| $ hg grep --diff mod | $ hg grep --diff mod | ||||
| um:0:+:unmod | um:0:+:unmod | ||||
| $ cd .. | $ cd .. | ||||
| Fix_Wdir(): test that passing wdir() t -r flag does greps on the | |||||
| files modified in the working directory | |||||
| $ cd a | |||||
| $ echo "abracadara" >> a | |||||
| $ hg add a | |||||
| $ hg grep -r "wdir()" "abra" | |||||
| a:2147483647:abracadara | |||||
| $ cd .. | |||||
| Change Default of grep by ui.tweakdefaults, that is, the files not in current | Change Default of grep by ui.tweakdefaults, that is, the files not in current | ||||
| working directory should not be grepp-ed on | working directory should not be grepp-ed on | ||||
| $ hg init ab | $ hg init ab | ||||
| $ cd ab | $ cd ab | ||||
| $ cat <<'EOF' >> .hg/hgrc | $ cat <<'EOF' >> .hg/hgrc | ||||
| > [ui] | > [ui] | ||||
| > tweakdefaults = True | > tweakdefaults = True | ||||