mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
7ebb123c54
Summary: Catnotate is a version of hg cat with output annotated with file name and line number. Such output is very useful when running hg cat on multiple files (for example in commit hooks). Test Plan: unit tests Reviewers: #sourcecontrol, pyd, mpm, durham, rmcelroy Reviewed By: rmcelroy Differential Revision: https://phabricator.fb.com/D2497470 Signature: t1:2497470:1444842798:9192ef3ef1603d068e7f38777def81a43bed0414
49 lines
677 B
Perl
49 lines
677 B
Perl
Test catnotate
|
|
|
|
$ hg init repo1
|
|
$ cd repo1
|
|
$ cat > .hg/hgrc <<EOF
|
|
> [extensions]
|
|
> sparse=$(dirname $TESTDIR)/catnotate.py
|
|
> strip=
|
|
> EOF
|
|
|
|
$ cat > a <<EOF
|
|
> Hell
|
|
> on
|
|
> world
|
|
> EOF
|
|
|
|
$ cat > b <<EOF
|
|
> Hello
|
|
> world
|
|
> EOF
|
|
$ echo -e "\0" >> b
|
|
|
|
$ hg add a b
|
|
$ hg commit -m "Hello :)"
|
|
$ hg catnotate a b
|
|
a:1: Hell
|
|
a:2: on
|
|
a:3: world
|
|
a:4:
|
|
b: binary file
|
|
|
|
$ hg catnotate -a a b
|
|
a:1: Hell
|
|
a:2: on
|
|
a:3: world
|
|
a:4:
|
|
b:1: Hello
|
|
b:2: world
|
|
b:3: \x00 (esc)
|
|
b:4:
|
|
|
|
$ hg update 0
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ hg catnotate --rev . a
|
|
a:1: Hell
|
|
a:2: on
|
|
a:3: world
|
|
a:4:
|