tests/test-extdiff.t
changeset 12316 4134686b83e1
parent 12304 41dd368b6fe8
child 12328 b63f6422d2a7
equal deleted inserted replaced
12315:ca58f6475f1d 12316:4134686b83e1
    12 Should diff cloned directories:
    12 Should diff cloned directories:
    13 
    13 
    14   $ hg extdiff -o -r $opt
    14   $ hg extdiff -o -r $opt
    15   Only in a: a
    15   Only in a: a
    16   Only in a: b
    16   Only in a: b
       
    17   [1]
    17 
    18 
    18   $ echo "[extdiff]" >> $HGRCPATH
    19   $ echo "[extdiff]" >> $HGRCPATH
    19   $ echo "cmd.falabala=echo" >> $HGRCPATH
    20   $ echo "cmd.falabala=echo" >> $HGRCPATH
    20   $ echo "opts.falabala=diffing" >> $HGRCPATH
    21   $ echo "opts.falabala=diffing" >> $HGRCPATH
    21 
    22 
    22   $ hg falabala
    23   $ hg falabala
    23   diffing a.000000000000 a
    24   diffing a.000000000000 a
       
    25   [1]
    24 
    26 
    25   $ hg help falabala
    27   $ hg help falabala
    26   hg falabala [OPTION]... [FILE]...
    28   hg falabala [OPTION]... [FILE]...
    27   
    29   
    28   use 'echo' to diff repository (or selected files)
    30   use 'echo' to diff repository (or selected files)
    54 
    56 
    55 Should diff cloned files directly:
    57 Should diff cloned files directly:
    56 
    58 
    57   $ hg falabala -r 0:1
    59   $ hg falabala -r 0:1
    58   diffing a.8a5febb7f867/a a.34eed99112ab/a
    60   diffing a.8a5febb7f867/a a.34eed99112ab/a
       
    61   [1]
    59 
    62 
    60 Test diff during merge:
    63 Test diff during merge:
    61 
    64 
    62   $ hg update -C 0
    65   $ hg update -C 0
    63   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    66   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    70   (branch merge, don't forget to commit)
    73   (branch merge, don't forget to commit)
    71 
    74 
    72 Should diff cloned file against wc file:
    75 Should diff cloned file against wc file:
    73 
    76 
    74   $ hg falabala > out
    77   $ hg falabala > out
       
    78   [1]
    75 
    79 
    76 Cleanup the output since the wc is a tmp directory:
    80 Cleanup the output since the wc is a tmp directory:
    77 
    81 
    78   $ sed  's:\(diffing [^ ]* \).*\(\/test-extdiff\):\1[tmp]\2:' out
    82   $ sed  's:\(diffing [^ ]* \).*\(\/test-extdiff\):\1[tmp]\2:' out
    79   diffing a.2a13a4d2da36/a [tmp]/test-extdiff.t/a/a
    83   diffing a.2a13a4d2da36/a [tmp]/test-extdiff.t/a/a
    81 Test --change option:
    85 Test --change option:
    82 
    86 
    83   $ hg ci -d '2 0' -mtest3
    87   $ hg ci -d '2 0' -mtest3
    84   $ hg falabala -c 1
    88   $ hg falabala -c 1
    85   diffing a.8a5febb7f867/a a.34eed99112ab/a
    89   diffing a.8a5febb7f867/a a.34eed99112ab/a
       
    90   [1]
    86 
    91 
    87 Check diff are made from the first parent:
    92 Check diff are made from the first parent:
    88 
    93 
    89   $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
    94   $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
    90   diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
    95   diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
   131   $ chmod +x 'diff tool.py'
   136   $ chmod +x 'diff tool.py'
   132 
   137 
   133 # will change to /tmp/extdiff.TMP and populate directories a.TMP and a
   138 # will change to /tmp/extdiff.TMP and populate directories a.TMP and a
   134 # and start tool
   139 # and start tool
   135   $ hg extdiff -p "`pwd`/diff tool.py"
   140   $ hg extdiff -p "`pwd`/diff tool.py"
       
   141   [1]
   136 
   142 
   137 Diff in working directory, after:
   143 Diff in working directory, after:
   138 
   144 
   139   $ hg diff --git
   145   $ hg diff --git
   140   diff --git a/a b/a
   146   diff --git a/a b/a
   156 
   162 
   157 Test extdiff with --option:
   163 Test extdiff with --option:
   158 
   164 
   159   $ hg extdiff -p echo -o this -c 1
   165   $ hg extdiff -p echo -o this -c 1
   160   this a.8a5febb7f867/a a.34eed99112ab/a
   166   this a.8a5febb7f867/a a.34eed99112ab/a
       
   167   [1]
   161 
   168 
   162   $ hg falabala -o this -c 1
   169   $ hg falabala -o this -c 1
   163   diffing this a.8a5febb7f867/a a.34eed99112ab/a
   170   diffing this a.8a5febb7f867/a a.34eed99112ab/a
       
   171   [1]
   164 
   172 
   165   $ true
   173   $ true
   166 
   174