tests/test-extdiff.t
changeset 23680 4075f2f8ea53
parent 23172 e955549cd045
child 23682 1642eb429536
equal deleted inserted replaced
23679:dd1e73c4be13 23680:4075f2f8ea53
    91 Check diff are made from the first parent:
    91 Check diff are made from the first parent:
    92 
    92 
    93   $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
    93   $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
    94   diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
    94   diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
    95   diff-like tools yield a non-zero exit code
    95   diff-like tools yield a non-zero exit code
       
    96 
       
    97 issue4463: usage of command line configuration without additional quoting
       
    98 
       
    99   $ cat <<EOF >> $HGRCPATH
       
   100   > [extdiff]
       
   101   > cmd.4463a = echo
       
   102   > opts.4463a = a-naked 'single quoted' "double quoted"
       
   103   > 4463b = echo b-naked 'single quoted' "double quoted"
       
   104   > echo =
       
   105   > EOF
       
   106   $ hg update -q -C 0
       
   107   $ echo a >> a
       
   108 #if windows
       
   109   $ hg --debug 4463a | grep '^running'
       
   110   running '"echo" a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob)
       
   111   $ hg --debug 4463b | grep '^running'
       
   112   running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob)
       
   113   $ hg --debug echo | grep '^running'
       
   114   running '"*echo*" "*\\a" "*\\a"' in */extdiff.* (glob)
       
   115 #else
       
   116   $ hg --debug 4463a | grep '^running'
       
   117   running '\'echo\' a-naked \'single quoted\' "double quoted" \'*/a\' \'$TESTTMP/a/a\'' in */extdiff.* (glob)
       
   118   $ hg --debug 4463b | grep '^running'
       
   119   running 'echo b-naked \'single quoted\' "double quoted" \'*/a\' \'$TESTTMP/a/a\'' in */extdiff.* (glob)
       
   120   $ hg --debug echo | grep '^running'
       
   121   running "'*echo*' '*/a' '$TESTTMP/a/a'" in */extdiff.* (glob)
       
   122 #endif
       
   123 
       
   124 (getting options from other than extdiff section)
       
   125 
       
   126   $ cat <<EOF >> $HGRCPATH
       
   127   > [extdiff]
       
   128   > # using diff-tools diffargs
       
   129   > 4463b2 = echo
       
   130   > # using merge-tools diffargs
       
   131   > 4463b3 = echo
       
   132   > # no diffargs
       
   133   > 4463b4 = echo
       
   134   > [diff-tools]
       
   135   > 4463b2.diffargs = b2-naked 'single quoted' "double quoted"
       
   136   > [merge-tools]
       
   137   > 4463b3.diffargs = b3-naked 'single quoted' "double quoted"
       
   138   > EOF
       
   139 #if windows
       
   140   $ hg --debug 4463b2 | grep '^running'
       
   141   running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob)
       
   142   $ hg --debug 4463b3 | grep '^running'
       
   143   running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob)
       
   144   $ hg --debug 4463b4 | grep '^running'
       
   145   running 'echo "*\\a" "*\\a"' in */extdiff.* (glob)
       
   146   $ hg --debug 4463b4 --option 'being quoted' | grep '^running'
       
   147   running 'echo "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob)
       
   148   $ hg --debug extdiff -p echo --option 'being quoted' | grep '^running'
       
   149   running '"echo" "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob)
       
   150 #else
       
   151   $ hg --debug 4463b2 | grep '^running'
       
   152   running 'echo b2-naked \'single quoted\' "double quoted" \'*/a\' \'$TESTTMP/a/a\'' in */extdiff.* (glob)
       
   153   $ hg --debug 4463b3 | grep '^running'
       
   154   running 'echo b3-naked \'single quoted\' "double quoted" \'*/a\' \'$TESTTMP/a/a\'' in */extdiff.* (glob)
       
   155   $ hg --debug 4463b4 | grep '^running'
       
   156   running "echo '*/a' '$TESTTMP/a/a'" in */extdiff.* (glob)
       
   157   $ hg --debug 4463b4 --option 'being quoted' | grep '^running'
       
   158   running "echo 'being quoted' '*/a' '$TESTTMP/a/a'" in */extdiff.* (glob)
       
   159   $ hg --debug extdiff -p echo --option 'being quoted' | grep '^running'
       
   160   running "'echo' 'being quoted' '*/a' '$TESTTMP/a/a'" in */extdiff.* (glob)
       
   161 #endif
    96 
   162 
    97 #if execbit
   163 #if execbit
    98 
   164 
    99 Test extdiff of multiple files in tmp dir:
   165 Test extdiff of multiple files in tmp dir:
   100 
   166 
   205     a
   271     a
   206     b
   272     b
   207   making snapshot of 2 files from working directory
   273   making snapshot of 2 files from working directory
   208     a
   274     a
   209     b
   275     b
   210   running "'$TESTTMP/a/dir/tool.sh'  'a.*' 'a'" in */extdiff.* (glob)
   276   running "'$TESTTMP/a/dir/tool.sh' 'a.*' 'a'" in */extdiff.* (glob)
   211   ** custom diff **
   277   ** custom diff **
   212   cleaning up temp directory
   278   cleaning up temp directory
   213   [1]
   279   [1]
   214 
   280 
   215   $ cd ..
   281   $ cd ..