tests/test-amend.t
changeset 43799 5558e3437872
parent 42935 f10a0f5eedae
child 43828 36444dddaeb4
equal deleted inserted replaced
43798:32d11a23c9cf 43799:5558e3437872
   474   $ echo a > a; echo b2 > b; hg amend -q b
   474   $ echo a > a; echo b2 > b; hg amend -q b
   475   $ hg diff --stat -c .
   475   $ hg diff --stat -c .
   476    a |  2 +-
   476    a |  2 +-
   477    b |  2 +-
   477    b |  2 +-
   478    2 files changed, 2 insertions(+), 2 deletions(-)
   478    2 files changed, 2 insertions(+), 2 deletions(-)
       
   479 
       
   480 Modifying a file while the editor is open can cause dirstate corruption
       
   481 (issue6233)
       
   482 
       
   483   $ cd $TESTTMP
       
   484   $ hg init modify-during-amend; cd modify-during-amend
       
   485   $ echo r0 > foo; hg commit -qAm "r0"
       
   486   $ echo alpha > foo; hg commit -qm "alpha"
       
   487   $ echo beta >> foo
       
   488   $ cat > $TESTTMP/sleepy_editor.sh <<EOF
       
   489   > echo hi > "\$1"
       
   490   > sleep 3
       
   491   > EOF
       
   492   $ HGEDITOR="sh $TESTTMP/sleepy_editor.sh" hg commit --amend &
       
   493   $ sleep 1
       
   494   $ echo delta >> foo
       
   495   $ sleep 3
       
   496   $ if (hg diff -c . | grep 'delta' >/dev/null) || [[ -n "$(hg status)" ]]; then
       
   497   >   echo "OK."
       
   498   > else
       
   499   >   echo "Bug detected. 'delta' is not part of the commit OR the wdir"
       
   500   >   echo "Diff and status before rebuild:"
       
   501   >   hg diff
       
   502   >   hg status
       
   503   >   hg debugrebuilddirstate
       
   504   >   echo "Diff and status after rebuild:"
       
   505   >   hg diff
       
   506   >   hg status
       
   507   > fi
       
   508   OK.