sapling/tests/test-tweakdefaults-blame.t
Jun Wu c030cc61cb tweakdefaults: do not use template for annotate if unnecessary (BC)
Summary:
Template lacks of the "padding" feature. There is a hard-coded 13-char wide
username, 5-char wide line number, which does not look well if the usernames
are too long or too short.

This patch restores the original annotate format which is different from
the current behavior. For example, given "-uc", it shows "user node" instead
of "node:user". It also tries to make the template version as close as the
non-template one, by adjusting the order, changing separators, and making
"-c" optional (could be hidden from the output).

Test Plan: Modified existing tests

Reviewers: #sourcecontrol, ikostia

Reviewed By: ikostia

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4243830

Signature: t1:4243830:1480437984:1c679c9db516bab905d027061326a7a1524922c6
2016-11-29 11:18:00 +00:00

45 lines
1.4 KiB
Perl

$ extpath=`dirname $TESTDIR`
$ cp $extpath/hgext3rd/tweakdefaults.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]
> tweakdefaults=$TESTTMP/tweakdefaults.py
> EOF
Test wrapped blame to be able to handle the usual command line attributes
$ hg init repo
$ cd repo
$ echo "line one" > a
$ echo "line two" >> a
$ hg ci -Am "Differential Revision: https://phabricator.fb.com/D111111"
adding a
$ echo "line three" >> a
$ hg ci -Am "Differential Revision: https://phabricator.fb.com/D222222"
$ hg blame a
37b9ff139054: line one
37b9ff139054: line two
05d474df3f59: line three
$ hg blame --user a
test: line one
test: line two
test: line three
$ hg blame --date a
Thu Jan 01 00:00:00 1970 +0000: line one
Thu Jan 01 00:00:00 1970 +0000: line two
Thu Jan 01 00:00:00 1970 +0000: line three
$ hg blame --number a
0: line one
0: line two
1: line three
$ hg blame --changeset --file --line-number a
37b9ff139054 a:1: line one
37b9ff139054 a:2: line two
05d474df3f59 a:3: line three
$ hg blame --user --date --changeset --line-number a
test 37b9ff139054 Thu Jan 01 00:00:00 1970 +0000:1: line one
test 37b9ff139054 Thu Jan 01 00:00:00 1970 +0000:2: line two
test 05d474df3f59 Thu Jan 01 00:00:00 1970 +0000:3: line three
$ hg blame -p a
D111111 : line one
D111111 : line two
D222222 : line three