tests/test-histedit-edit.t
branchstable
changeset 21028 a0f437e2f5a9
parent 20117 aa9385f983fa
child 21233 213fd1a99cd9
equal deleted inserted replaced
20957:469d949a7cb8 21028:a0f437e2f5a9
   187   date:        Thu Jan 01 00:00:00 1970 +0000
   187   date:        Thu Jan 01 00:00:00 1970 +0000
   188   summary:     f
   188   summary:     f
   189   
   189   
   190 
   190 
   191 modify the message
   191 modify the message
       
   192 
       
   193 check saving last-message.txt, at first
       
   194 
       
   195   $ cat > $TESTTMP/commitfailure.py <<EOF
       
   196   > from mercurial import util
       
   197   > def reposetup(ui, repo):
       
   198   >     class commitfailure(repo.__class__):
       
   199   >         def commit(self, *args, **kwargs):
       
   200   >             raise util.Abort('emulating unexpected abort')
       
   201   >     repo.__class__ = commitfailure
       
   202   > EOF
       
   203   $ cat > .hg/hgrc <<EOF
       
   204   > [extensions]
       
   205   > commitfailure = $TESTTMP/commitfailure.py
       
   206   > EOF
       
   207 
       
   208   $ cat > $TESTTMP/editor.sh <<EOF
       
   209   > echo "==== before editing"
       
   210   > cat \$1
       
   211   > echo "===="
       
   212   > echo "check saving last-message.txt" >> \$1
       
   213   > EOF
       
   214   $ rm -f .hg/last-message.txt
       
   215   $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF | fixbundle
       
   216   > mess 1fd3b2fe7754 f
       
   217   > EOF
       
   218   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   219   ==== before editing
       
   220   f
       
   221   ====
       
   222   abort: emulating unexpected abort
       
   223   $ cat .hg/last-message.txt
       
   224   f
       
   225   check saving last-message.txt
       
   226 
       
   227   $ cat > .hg/hgrc <<EOF
       
   228   > [extensions]
       
   229   > commitfailure = !
       
   230   > EOF
       
   231   $ hg histedit --abort -q
       
   232 
       
   233 then, check "modify the message" itself
       
   234 
   192   $ hg histedit tip --commands - 2>&1 << EOF | fixbundle
   235   $ hg histedit tip --commands - 2>&1 << EOF | fixbundle
   193   > mess 1fd3b2fe7754 f
   236   > mess 1fd3b2fe7754 f
   194   > EOF
   237   > EOF
   195   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   238   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   196   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   239   0 files updated, 0 files merged, 0 files removed, 0 files unresolved