tests/test-extdiff.t
author Michael Fyles <mf@vorston.net>
Thu, 26 Jul 2012 11:38:13 +0100
branchstable
changeset 23138 72a89cf86fcd
parent 22117 c1d93edcf004
child 23152 b8f6d840d3ec
permissions -rw-r--r--
extdiff: quote user-supplied options passed to shell $ hg extdiff -p cmd -o "name <user@example.com>" resulted in a shell redirection error (due to the less-than sign), rather than passing the single option to cmd. This was due to options not being quoted for passing to the shell, via util.system(). Apply util.shellquote() to each of the user-specified options (-o) to the comparison program before they are concatenated and passed to util.system(). The requested external diff command (-p) and the files/directories being compared are already quoted correctly. The discussion at the time of changeset be98c5ce4022 correctly noted that this course of action breaks whitespace-separated options specified for external diff commands in the configuration. The lower part of the patch corrects this by lexing options read from the configuration file into separate options rather than reading them all into the first option. Update test to cover these conditions. Related changesets (reverse-chronological): - be98c5ce4022 (fix reverted to make configuration file options work) - 453097750fbf (issue fixed but without fix for configuration file)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     1
  $ echo "[extensions]" >> $HGRCPATH
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     2
  $ echo "extdiff=" >> $HGRCPATH
2906
453097750fbf extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     4
  $ hg init a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     5
  $ cd a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     6
  $ echo a > a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     7
  $ echo b > b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     8
  $ hg add
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
     9
  adding a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    10
  adding b
2906
453097750fbf extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    12
Should diff cloned directories:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    13
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    14
  $ hg extdiff -o -r $opt
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    15
  Only in a: a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    16
  Only in a: b
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
    17
  [1]
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    18
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    19
  $ echo "[extdiff]" >> $HGRCPATH
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    20
  $ echo "cmd.falabala=echo" >> $HGRCPATH
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    21
  $ echo "opts.falabala=diffing" >> $HGRCPATH
23138
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
    22
  $ echo "cmd.edspace=echo" >> $HGRCPATH
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
    23
  $ echo 'opts.edspace="name  <user@example.com>"' >> $HGRCPATH
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    24
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    25
  $ hg falabala
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    26
  diffing a.000000000000 a
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
    27
  [1]
2906
453097750fbf extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    28
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    29
  $ hg help falabala
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    30
  hg falabala [OPTION]... [FILE]...
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    31
  
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    32
  use 'echo' to diff repository (or selected files)
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    33
  
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    34
      Show differences between revisions for the specified files, using the
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    35
      'echo' program.
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    36
  
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    37
      When two revision arguments are given, then changes are shown between
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    38
      those revisions. If only one revision is specified then that revision is
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    39
      compared to the working directory, and, when no revisions are specified,
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    40
      the working directory files are compared to its parent.
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    41
  
22117
c1d93edcf004 help: fold repeatable option message into option table header
Matt Mackall <mpm@selenic.com>
parents: 22110
diff changeset
    42
  options ([+] can be repeated):
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    43
  
15145
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14024
diff changeset
    44
   -o --option OPT [+]      pass option to comparison program
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14024
diff changeset
    45
   -r --rev REV [+]         revision
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14024
diff changeset
    46
   -c --change REV          change made by revision
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14024
diff changeset
    47
   -I --include PATTERN [+] include names matching the given patterns
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14024
diff changeset
    48
   -X --exclude PATTERN [+] exclude names matching the given patterns
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    49
  
22110
26f7c8033bed help: tweak --verbose command help hint
Matt Mackall <mpm@selenic.com>
parents: 17837
diff changeset
    50
  (some details hidden, use --verbose to show complete help)
2906
453097750fbf extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    51
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    52
  $ hg ci -d '0 0' -mtest1
2906
453097750fbf extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    53
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    54
  $ echo b >> a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    55
  $ hg ci -d '1 0' -mtest2
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    56
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    57
Should diff cloned files directly:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    58
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    59
  $ hg falabala -r 0:1
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
    60
  diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
    61
  [1]
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    62
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    63
Test diff during merge:
2906
453097750fbf extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    64
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    65
  $ hg update -C 0
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    66
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    67
  $ echo c >> c
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    68
  $ hg add c
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    69
  $ hg ci -m "new branch" -d '1 0'
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    70
  created new head
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    71
  $ hg merge 1
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    72
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    73
  (branch merge, don't forget to commit)
2906
453097750fbf extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    74
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    75
Should diff cloned file against wc file:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    76
12587
e3247ceaca5e tests: removed test names in tests
Erik Zielke <ez@aragost.com>
parents: 12346
diff changeset
    77
  $ hg falabala
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
    78
  diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
    79
  [1]
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    80
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    81
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    82
Test --change option:
3330
49966b5ab16f fix traceback of extdiff after a merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2990
diff changeset
    83
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    84
  $ hg ci -d '2 0' -mtest3
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    85
  $ hg falabala -c 1
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
    86
  diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
    87
  [1]
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    88
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    89
Check diff are made from the first parent:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    90
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    91
  $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
    92
  diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    93
  diff-like tools yield a non-zero exit code
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    94
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
    95
#if execbit
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
    96
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    97
Test extdiff of multiple files in tmp dir:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    98
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
    99
  $ hg update -C 0 > /dev/null
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   100
  $ echo changed > a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   101
  $ echo changed > b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   102
  $ chmod +x b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   103
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   104
Diff in working directory, before:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   105
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   106
  $ hg diff --git
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   107
  diff --git a/a b/a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   108
  --- a/a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   109
  +++ b/a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   110
  @@ -1,1 +1,1 @@
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   111
  -a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   112
  +changed
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   113
  diff --git a/b b/b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   114
  old mode 100644
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   115
  new mode 100755
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   116
  --- a/b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   117
  +++ b/b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   118
  @@ -1,1 +1,1 @@
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   119
  -b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   120
  +changed
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   121
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   122
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   123
Edit with extdiff -p:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   124
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   125
Prepare custom diff/edit tool:
8065
66d0a03d3afc extdiff: preserve execute-bit across copies (issue1562)
Patrick Mezard <pmezard@gmail.com>
parents: 7758
diff changeset
   126
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   127
  $ cat > 'diff tool.py' << EOT
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   128
  > #!/usr/bin/env python
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   129
  > import time
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   130
  > time.sleep(1) # avoid unchanged-timestamp problems
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   131
  > file('a/a', 'ab').write('edited\n')
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   132
  > file('a/b', 'ab').write('edited\n')
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   133
  > EOT
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   134
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   135
  $ chmod +x 'diff tool.py'
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   136
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   137
will change to /tmp/extdiff.TMP and populate directories a.TMP and a
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   138
and start tool
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
   139
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   140
  $ hg extdiff -p "`pwd`/diff tool.py"
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
   141
  [1]
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   142
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   143
Diff in working directory, after:
9956
6045a8c4dbbc extdiff: respect --option in command aliases (issue949)
Sune Foldager <cryo@cyanite.org>
parents: 8212
diff changeset
   144
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   145
  $ hg diff --git
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   146
  diff --git a/a b/a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   147
  --- a/a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   148
  +++ b/a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   149
  @@ -1,1 +1,2 @@
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   150
  -a
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   151
  +changed
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   152
  +edited
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   153
  diff --git a/b b/b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   154
  old mode 100644
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   155
  new mode 100755
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   156
  --- a/b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   157
  +++ b/b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   158
  @@ -1,1 +1,2 @@
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   159
  -b
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   160
  +changed
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   161
  +edited
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   162
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   163
Test extdiff with --option:
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   164
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   165
  $ hg extdiff -p echo -o this -c 1
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
   166
  this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
   167
  [1]
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   168
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   169
  $ hg falabala -o this -c 1
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
   170
  diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
   171
  [1]
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   172
23138
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   173
Test extdiff's handling of options with spaces in them:
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   174
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   175
  $ hg edspace -c 1
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   176
  name  <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   177
  [1]
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   178
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   179
  $ hg extdiff -p echo -o "name  <user@example.com>" -c 1
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   180
  name  <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   181
  [1]
72a89cf86fcd extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents: 22117
diff changeset
   182
13660
a56c1b2bff18 Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents: 12640
diff changeset
   183
Test with revsets:
a56c1b2bff18 Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents: 12640
diff changeset
   184
a56c1b2bff18 Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents: 12640
diff changeset
   185
  $ hg extdif -p echo -c "rev(1)"
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
   186
  */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12304
diff changeset
   187
  [1]
13660
a56c1b2bff18 Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents: 12640
diff changeset
   188
a56c1b2bff18 Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents: 12640
diff changeset
   189
  $ hg extdif -p echo -r "0::1"
13762
3740792dbe51 test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard <pmezard@gmail.com>
parents: 13660
diff changeset
   190
  */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
13660
a56c1b2bff18 Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents: 12640
diff changeset
   191
  [1]
14024
92b768e9f80c merge with stable
Thomas Arendsen Hein <thomas@intevation.de>
parents: 13762 14021
diff changeset
   192
14021
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   193
  $ cd ..
12304
41dd368b6fe8 tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents: 10775
diff changeset
   194
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   195
#endif
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   196
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   197
#if symlink
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   198
14024
92b768e9f80c merge with stable
Thomas Arendsen Hein <thomas@intevation.de>
parents: 13762 14021
diff changeset
   199
Test symlinks handling (issue1909)
92b768e9f80c merge with stable
Thomas Arendsen Hein <thomas@intevation.de>
parents: 13762 14021
diff changeset
   200
14021
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   201
  $ hg init testsymlinks
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   202
  $ cd testsymlinks
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   203
  $ echo a > a
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   204
  $ hg ci -Am adda
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   205
  adding a
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   206
  $ echo a >> a
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   207
  $ ln -s missing linka
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   208
  $ hg add linka
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   209
  $ hg falabala -r 0 --traceback
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   210
  diffing testsymlinks.07f494440405 testsymlinks
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   211
  [1]
3eb632d9cf42 extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents: 12640
diff changeset
   212
  $ cd ..
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   213
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   214
#endif