sapling/tests/test-smartlog-tweakdefaults.t
Saurabh Singh 7f3e8286a8 amend: fixing tests following the removal of redundant commit in amend
Summary:
cmdutil.amend was changed recently to get rid of the redundant commit during
the amend operation. As a result, we need to update the tests which were aware
of the redundant commit. This commit achieves the same.

Note that as a result of the amend behavior change, the dirsync and copytrace
extensions were broken. They will be be fixed in subsequent commits on top of
this commit. For now, the broken tests for these extensions were removed from
the commit. Eventually, I will fold all the fixes together so that revision
history of the tests is not messed up. This is primarily done only to aid the
review.

Test Plan: Ran the test suite after updating the tests.
2017-09-08 09:58:14 -07:00

45 lines
1.5 KiB
Perl

$ cat >> $HGRCPATH << EOF
> [extensions]
> rebase=
> smartlog=$TESTDIR/../hgext3rd/smartlog.py
> tweakdefaults=$TESTDIR/../hgext3rd/tweakdefaults.py
> fbamend=$TESTDIR/../hgext3rd/fbamend
> [experimental]
> evolution=createmarkers
> allowdivergence=on
> EOF
Prepare a repo for amend checks
$ hg init repo
$ cd repo
$ echo root > root && hg ci -Am root # rev 0
adding root
$ echo base > base && hg ci -Am base # rev 1
adding base
$ echo a > a && hg ci -Am a # rev 2
adding a
$ echo aa > a && hg amend # rev 3
$ hg up --hidden -r 2
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo aaa > a && hg amend # rev 4
Check the amend template keywords
$ hg log --hidden -r 2 -T "{node} amended as {amendsuccessors % '{short(amendsuccessor)} '}\n"
6e2c701de62843743b3ad0c4397a88605f0aa7c9 amended as [a-f0-9]* [a-f0-9]* (re)
Prepare a repo for rebase checks
$ hg up 0
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ echo b > b && hg ci -Am b # rev 5
adding b
created new head
$ hg rebase --hidden -r 5 -d 1 # rev 6
rebasing 5:1e9a3c00cbe9 "b" (tip)
$ hg rebase --hidden -r 5 -d 2 # rev 7
rebasing 5:1e9a3c00cbe9 "b"
Check the rebase template keywords
$ hg log --hidden -r 5 -T "{node} rebased as {rebasesuccessors % '{short(rebasesuccessor)} '}\n"
1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc rebased as [a-f0-9]* [a-f0-9]* (re)