tests/test-commit-interactive-curses.t
changeset 28638 44319097e7b9
parent 28543 f7874de435c5
child 29862 e7766022a61a
equal deleted inserted replaced
28637:4874b8efe7d2 28638:44319097e7b9
   221   editor ran
   221   editor ran
   222   $ hg cat -r . x
   222   $ hg cat -r . x
   223   foo
   223   foo
   224   hello world
   224   hello world
   225 
   225 
   226 
   226 Testing the review option. The entire final filtered patch should show
       
   227 up in the editor and be editable. We will unselect the second file and
       
   228 the first hunk of the third file. During review, we will decide that
       
   229 "lower" sounds better than "bottom", and the final commit should
       
   230 reflect this edition.
       
   231 
       
   232   $ hg update -C .
       
   233   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   234   $ echo "top" > c
       
   235   $ cat x >> c
       
   236   $ echo "bottom" >> c
       
   237   $ mv c x
       
   238   $ echo "third a" >> a
       
   239   $ echo "we will unselect this" >> b
       
   240 
       
   241   $ cat > editor.sh <<EOF
       
   242   > cat "\$1"
       
   243   > cat "\$1" | sed s/bottom/lower/ > tmp
       
   244   > mv tmp "\$1"
       
   245   > EOF
       
   246   $ cat > testModeCommands <<EOF
       
   247   > KEY_DOWN
       
   248   > TOGGLE
       
   249   > KEY_DOWN
       
   250   > f
       
   251   > KEY_DOWN
       
   252   > TOGGLE
       
   253   > R
       
   254   > EOF
       
   255 
       
   256   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit  -i -m "review hunks" -d "0 0"
       
   257   # To remove '-' lines, make them ' ' lines (context).
       
   258   # To remove '+' lines, delete them.
       
   259   # Lines starting with # will be removed from the patch.
       
   260   #
       
   261   # If the patch applies cleanly, the edited patch will immediately
       
   262   # be finalised. If it does not apply cleanly, rejects files will be
       
   263   # generated. You can use those when you try again.
       
   264   diff --git a/a b/a
       
   265   --- a/a
       
   266   +++ b/a
       
   267   @@ -1,2 +1,3 @@
       
   268    a
       
   269    a
       
   270   +third a
       
   271   diff --git a/x b/x
       
   272   --- a/x
       
   273   +++ b/x
       
   274   @@ -1,2 +1,3 @@
       
   275    foo
       
   276    hello world
       
   277   +bottom
       
   278 
       
   279   $ hg cat -r . a
       
   280   a
       
   281   a
       
   282   third a
       
   283 
       
   284   $ hg cat -r . b
       
   285   x
       
   286   1
       
   287   2
       
   288   3
       
   289   4
       
   290   5
       
   291   6
       
   292   7
       
   293   8
       
   294   9
       
   295   10
       
   296   y
       
   297 
       
   298   $ hg cat -r . x
       
   299   foo
       
   300   hello world
       
   301   lower
   227 Check ui.interface logic for the chunkselector
   302 Check ui.interface logic for the chunkselector
   228 
   303 
   229 The default interface is text
   304 The default interface is text
   230   $ cp $HGRCPATH.pretest $HGRCPATH
   305   $ cp $HGRCPATH.pretest $HGRCPATH
   231   $ chunkselectorinterface() {
   306   $ chunkselectorinterface() {