2017-10-03 12:09:23 +03:00
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [extensions]
|
|
|
|
> tweakdefaults=$TESTDIR/../hgext3rd/tweakdefaults.py
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
Setup repo
|
|
|
|
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
$ touch a
|
|
|
|
$ hg commit -Aqm a
|
|
|
|
$ mkdir dir
|
|
|
|
$ touch dir/b
|
|
|
|
$ hg commit -Aqm b
|
|
|
|
$ hg up -q 0
|
|
|
|
$ echo x >> a
|
|
|
|
$ hg commit -Aqm a2
|
|
|
|
|
|
|
|
Test that warning is shown whenever ':' is used with singlecolonwarn set
|
|
|
|
|
2017-10-03 12:09:23 +03:00
|
|
|
$ hg log -T '{rev} ' -r '0:2' --config tweakdefaults.singlecolonwarn=1
|
2017-10-03 12:09:23 +03:00
|
|
|
warning: use of ':' is deprecated
|
2017-10-03 12:09:23 +03:00
|
|
|
0 1 2 (no-eol)
|
|
|
|
$ hg log -T '{rev} ' -r '0:2'
|
|
|
|
0 1 2 (no-eol)
|
|
|
|
$ hg log -T '{rev} ' -r ':2' --config tweakdefaults.singlecolonwarn=1
|
2017-10-03 12:09:23 +03:00
|
|
|
warning: use of ':' is deprecated
|
2017-10-03 12:09:23 +03:00
|
|
|
0 1 2 (no-eol)
|
|
|
|
$ hg log -T '{rev} ' -r ':2'
|
|
|
|
0 1 2 (no-eol)
|
|
|
|
$ hg log -T '{rev} ' -r '0:' --config tweakdefaults.singlecolonwarn=1
|
2017-10-03 12:09:23 +03:00
|
|
|
warning: use of ':' is deprecated
|
2017-10-03 12:09:23 +03:00
|
|
|
0 1 2 (no-eol)
|
|
|
|
$ hg log -T '{rev} ' -r '0:'
|
|
|
|
0 1 2 (no-eol)
|
2017-10-03 12:09:23 +03:00
|
|
|
|
|
|
|
In this testcase warning should not be shown
|
2017-10-03 12:09:23 +03:00
|
|
|
$ hg log -T '{rev} ' -r ':' --config tweakdefaults.singlecolonwarn=1
|
|
|
|
0 1 2 (no-eol)
|
|
|
|
|
2017-10-03 12:09:23 +03:00
|
|
|
Check that the custom message can be used
|
2017-10-03 12:09:23 +03:00
|
|
|
$ hg log -T '{rev} ' -r '0:' --config tweakdefaults.singlecolonwarn=1 --config tweakdefaults.singlecolonmsg="hey stop that"
|
2017-10-03 12:09:23 +03:00
|
|
|
hey stop that
|
2017-10-03 12:09:23 +03:00
|
|
|
0 1 2 (no-eol)
|