##// END OF EJS Templates
grep: respect ui.relative-paths...
Martin von Zweigbergk -
r41576:d8c688d1 default draft
parent child Browse files
Show More
@@ -2848,6 +2848,7 b' def grep(ui, repo, pattern, *pats, **opt'
2848 2848 for i in pycompat.xrange(blo, bhi):
2849 2849 yield ('+', b[i])
2850 2850
2851 uipathfn = scmutil.getuipathfn(repo)
2851 2852 def display(fm, fn, ctx, pstates, states):
2852 2853 rev = scmutil.intrev(ctx)
2853 2854 if fm.isplain():
@@ -2875,8 +2876,8 b' def grep(ui, repo, pattern, *pats, **opt'
2875 2876 for change, l in iter:
2876 2877 fm.startitem()
2877 2878 fm.context(ctx=ctx)
2878 fm.data(node=fm.hexfunc(scmutil.binnode(ctx)))
2879 fm.write('path', '%s', fn, label='grep.filename')
2879 fm.data(node=fm.hexfunc(scmutil.binnode(ctx)), path=fn)
2880 fm.plain(uipathfn(fn), label='grep.filename')
2880 2881
2881 2882 cols = [
2882 2883 ('rev', '%d', rev, not plaingrep),
@@ -32,6 +32,20 b' simple'
32 32 port:4:vaportight
33 33 port:4:import/export
34 34
35 simple from subdirectory
36
37 $ mkdir dir
38 $ cd dir
39 $ hg grep -r tip:0 port
40 port:4:export
41 port:4:vaportight
42 port:4:import/export
43 $ hg grep -r tip:0 port --config ui.relative-paths=yes
44 ../port:4:export
45 ../port:4:vaportight
46 ../port:4:import/export
47 $ cd ..
48
35 49 simple with color
36 50
37 51 $ hg --config extensions.color= grep --config color.mode=ansi \
General Comments 0
You need to be logged in to leave comments. Login now