Show More
@@ -1353,6 +1353,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||
|
1353 | 1353 | iter = [('', l) for l in states] |
|
1354 | 1354 | for change, l in iter: |
|
1355 | 1355 | cols = [fn, str(rev)] |
|
1356 | before, match, after = None, None, None | |
|
1356 | 1357 | if opts.get('line_number'): |
|
1357 | 1358 | cols.append(str(l.linenum)) |
|
1358 | 1359 | if opts.get('all'): |
@@ -1367,8 +1368,15 b' def grep(ui, repo, pattern, *pats, **opt' | |||
|
1367 | 1368 | continue |
|
1368 | 1369 | filerevmatches[c] = 1 |
|
1369 | 1370 | else: |
|
1370 |
|
|
|
1371 | ui.write(sep.join(cols), eol) | |
|
1371 | before = l.line[:l.colstart] | |
|
1372 | match = l.line[l.colstart:l.colend] | |
|
1373 | after = l.line[l.colend:] | |
|
1374 | ui.write(sep.join(cols)) | |
|
1375 | if before is not None: | |
|
1376 | ui.write(sep + before) | |
|
1377 | ui.write(match, label='grep.match') | |
|
1378 | ui.write(after) | |
|
1379 | ui.write(eol) | |
|
1372 | 1380 | found = True |
|
1373 | 1381 | return found |
|
1374 | 1382 |
General Comments 0
You need to be logged in to leave comments.
Login now