Mercurial > hg
view tests/test-backwards-remove.t @ 45725:99b8b73eb622
revset: add diff(pattern) predicate for "grep --diff"
I find this is useful in GUI log viewer since the tool only needs to support
"log -rREV" command.
This is basic implementation. Windowed search is not implemented since it
wouldn't work pretty well with the smartset API. And filename matcher is
not supported because the syntax isn't determined. My idea is to add handling
of diff(pattern, file(..)) and diff(pattern, follow(..)), which will then be
evolved to a full revset+matcher combinator support:
x & diff(pattern, y & z)
=====
y & z builds (revs(y) & revs(z), matcher(y) & matcher(z))
pair, and narrows the search space of diff()
====================
diff() returns matched (revs, matcher) pair
========================
revs and matcher will be combined respectively by &-operator, and the matcher
will optionally be used to filter "hg log -p" output
The predicate name "diff()" wouldn't be great, but grep() is already used.
Another options I can think of are "grepdiff()" and "containsdiff()".
Naming suggestions are welcome.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 08 Sep 2020 18:16:24 +0900 |
parents | 5c2a4f37eace |
children | 55c6ebd11cb9 |
line wrap: on
line source
$ hg init $ echo This is file a1 > a $ hg add a $ hg commit -m "commit #0" $ ls -A .hg a $ echo This is file b1 > b $ hg add b $ hg commit -m "commit #1" $ hg co 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved B should disappear $ ls -A .hg a