sapling/tests/test-fb-hgext-rage.t
Stanislau Hlebik a82197d560 use getcmdanddefaultopts in rage
Summary:
It makes sure that adding new options to the commands won't break them. For
example, rage sparse output was broken, and this diff fixes it.

Note that this changes behavior of the rage - if, say, smartlog extension is not enabled on the client, then there will be no output in the rage. Previously it wasn't the case. I think that's not the big problem, because:
a) The extensions are the most common ones and enabled everywhere
b) If they are disabled, then we'll immediately see a problem in hg rage.

However I need to change a test to make it pass. I need to add extensions and change grep output, because `hg rage --preview` has a few lines with `blackbox` in it.

Differential Revision: D7193297

fbshipit-source-id: dde2752ebc7dd3e3edea5c44576d0986f7d18744
2018-04-13 21:51:24 -07:00

34 lines
691 B
Perl

$ cat >> $HGRCPATH << EOF
> [extensions]
> blackbox=
> rage=
> smartlog=
> sparse=
> EOF
$ hg init repo
$ cd repo
#if osx
$ echo "[rage]" >> .hg/hgrc
$ echo "rpmbin = /""bin/rpm" >> .hg/hgrc
#endif
$ hg rage --preview | grep -o 'hg blackbox'
hg blackbox
Test with shared repo
$ cat >> $HGRCPATH << EOF
> [extensions]
> share=
> EOF
$ cd ..
$ hg share repo repo2
updating working directory
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
Create fake infinitepush backup state to be collected by rage
$ echo "fakestate" > repo/.hg/infinitepushbackupstate
$ cd repo2
$ hg rage --preview | grep -o 'fakestate'
fakestate