##// END OF EJS Templates
test-rebase: add a test showing rebasestate left behind...
Jun Wu -
r33055:be358471 default
parent child Browse files
Show More
@@ -1,6 +1,7 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extensions]
3 3 > rebase=
4 > drawdag=$TESTDIR/drawdag.py
4 5 >
5 6 > [phases]
6 7 > publish=False
@@ -915,3 +916,42 b' Testing from upper head'
915 916 date: Thu Jan 01 00:00:00 1970 +0000
916 917 summary: second source with subdir
917 918
919 Testing rebase being called inside another transaction
920
921 $ cd $TESTTMP
922 $ hg init tr-state
923 $ cd tr-state
924 $ cat > $TESTTMP/wraprebase.py <<EOF
925 > from __future__ import absolute_import
926 > from mercurial import extensions
927 > def _rebase(orig, ui, repo, *args, **kwargs):
928 > with repo.wlock():
929 > with repo.lock():
930 > with repo.transaction('wrappedrebase'):
931 > return orig(ui, repo, *args, **kwargs)
932 > def wraprebase(loaded):
933 > assert loaded
934 > rebasemod = extensions.find('rebase')
935 > extensions.wrapcommand(rebasemod.cmdtable, 'rebase', _rebase)
936 > def extsetup(ui):
937 > extensions.afterloaded('rebase', wraprebase)
938 > EOF
939
940 $ cat >> .hg/hgrc <<EOF
941 > [extensions]
942 > wraprebase=$TESTTMP/wraprebase.py
943 > [experimental]
944 > evolution=all
945 > EOF
946
947 $ hg debugdrawdag <<'EOS'
948 > B C
949 > |/
950 > A
951 > EOS
952
953 $ hg rebase -s C -d B
954 rebasing 2:dc0947a82db8 "C" (C tip)
955
956 $ [ -f .hg/rebasestate ] && echo 'WRONG: rebasestate should not exist'
957 WRONG: rebasestate should not exist
General Comments 0
You need to be logged in to leave comments. Login now