tests/test-commit-interactive-curses.t
branchstable
changeset 27914 505a10b504ed
parent 27321 dcdf0a52ad36
child 28542 71e12fc53b80
equal deleted inserted replaced
27913:91ac8cb79125 27914:505a10b504ed
   191   diff -r a6735021574d -r c1d239d165ae x
   191   diff -r a6735021574d -r c1d239d165ae x
   192   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   192   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   193   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   194   @@ -0,0 +1,1 @@
   194   @@ -0,0 +1,1 @@
   195   +hello world
   195   +hello world
       
   196 
       
   197 Editing a hunk puts you back on that hunk when done editing (issue5041)
       
   198 To do that, we change two lines in a file, pretend to edit the second line,
       
   199 exit, toggle the line selected at the end of the edit and commit.
       
   200 The first line should be recorded if we were put on the second line at the end
       
   201 of the edit.
       
   202 
       
   203   $ hg update -C .
       
   204   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   205   $ echo "foo" > x
       
   206   $ echo "hello world" >> x
       
   207   $ echo "bar" >> x
       
   208   $ cat <<EOF >testModeCommands
       
   209   > f
       
   210   > KEY_DOWN
       
   211   > KEY_DOWN
       
   212   > KEY_DOWN
       
   213   > KEY_DOWN
       
   214   > e
       
   215   > TOGGLE
       
   216   > X
       
   217   > EOF
       
   218   $ printf "printf 'editor ran\n'; exit 0" > editor.sh
       
   219   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit  -i -m "edit hunk" -d "0 0"
       
   220   editor ran
       
   221   $ hg cat -r . x
       
   222   foo
       
   223   hello world
       
   224 
       
   225