tests/test-diff-change.t
author Angel Ezquerra <angel.ezquerra@gmail.com>
Fri, 06 Sep 2013 00:38:28 +0200
changeset 19811 5e10d41e7b9c
parent 16913 f2719b387380
child 26019 85f5352c7ca7
permissions -rw-r--r--
merge: let the user choose to merge, keep local or keep remote subrepo revisions When a subrepo has changed on the local and remote revisions, prompt the user whether it wants to merge those subrepo revisions, keep the local revision or keep the remote revision. Up until now mercurial would always perform a merge on a subrepo that had changed on the local and the remote revisions. This is often inconvenient. For example: - You may want to perform the actual subrepo merge after you have merged the parent subrepo files. - Some subrepos may be considered "read only", in the sense that you are not supposed to add new revisions to them. In those cases "merging a subrepo" means choosing which _existing_ revision you want to use on the merged revision. This is often the case for subrepos that contain binary dependencies (such as DLLs, etc). This new prompt makes mercurial better cope with those common scenarios. Notes: - The default behavior (which is the one that is used when ui is not interactive) remains unchanged (i.e. merge is the default action). - This prompt will be shown even if the ui --tool flag is set. - I don't know of a way to test the "keep local" and "keep remote" options (i.e. to force the test to choose those options). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1378420708 -7200 # Fri Sep 06 00:38:28 2013 +0200 # Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d # Parent 50d721553198cea51c30f53b76d41dc919280097 merge: let the user choose to merge, keep local or keep remote subrepo revisions When a subrepo has changed on the local and remote revisions, prompt the user whether it wants to merge those subrepo revisions, keep the local revision or keep the remote revision. Up until now mercurial would always perform a merge on a subrepo that had changed on the local and the remote revisions. This is often inconvenient. For example: - You may want to perform the actual subrepo merge after you have merged the parent subrepo files. - Some subrepos may be considered "read only", in the sense that you are not supposed to add new revisions to them. In those cases "merging a subrepo" means choosing which _existing_ revision you want to use on the merged revision. This is often the case for subrepos that contain binary dependencies (such as DLLs, etc). This new prompt makes mercurial better cope with those common scenarios. Notes: - The default behavior (which is the one that is used when ui is not interactive) remains unchanged (i.e. merge is the default action). - This prompt will be shown even if the ui --tool flag is set. - I don't know of a way to test the "keep local" and "keep remote" options (i.e. to force the test to choose those options).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     1
Testing diff --change
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
     2
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     3
  $ hg init a
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     4
  $ cd a
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
     5
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     6
  $ echo "first" > file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     7
  $ hg add file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     8
  $ hg commit -m 'first commit' # 0
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
     9
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    10
  $ echo "second" > file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    11
  $ hg commit -m 'second commit' # 1
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    12
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    13
  $ echo "third" > file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    14
  $ hg commit -m 'third commit' # 2
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    15
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    16
  $ hg diff --nodates --change 1
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    17
  diff -r 4bb65dda5db4 -r e9b286083166 file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    18
  --- a/file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    19
  +++ b/file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    20
  @@ -1,1 +1,1 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    21
  -first
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    22
  +second
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    23
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    24
  $ hg diff --change e9b286083166
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    25
  diff -r 4bb65dda5db4 -r e9b286083166 file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    26
  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    27
  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    28
  @@ -1,1 +1,1 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    29
  -first
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    30
  +second
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    31
16790
2a0efa1112ac revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents: 16487
diff changeset
    32
Test dumb revspecs (issue3474)
2a0efa1112ac revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents: 16487
diff changeset
    33
2a0efa1112ac revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents: 16487
diff changeset
    34
  $ hg diff -r 2:2
2a0efa1112ac revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents: 16487
diff changeset
    35
  $ hg diff -r "2 and 1"
2a0efa1112ac revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents: 16487
diff changeset
    36
  abort: empty revision range
2a0efa1112ac revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents: 16487
diff changeset
    37
  [255]
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    38
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    39
Testing diff --change when merge:
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    40
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    41
  $ for i in 1 2 3 4 5 6 7 8 9 10; do
16487
4fe874697a4d tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents: 12136
diff changeset
    42
  >    echo $i >> file.txt
4fe874697a4d tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents: 12136
diff changeset
    43
  > done
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    44
  $ hg commit -m "lots of text" # 3
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    45
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    46
  $ sed -e 's,^2$,x,' file.txt > file.txt.tmp
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    47
  $ mv file.txt.tmp file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    48
  $ hg commit -m "change 2 to x" # 4
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    49
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    50
  $ hg up -r 3
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    51
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    52
  $ sed -e 's,^8$,y,' file.txt > file.txt.tmp
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    53
  $ mv file.txt.tmp file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    54
  $ hg commit -m "change 8 to y"
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    55
  created new head
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    56
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    57
  $ hg up -C -r 4
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    58
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    59
  $ hg merge -r 5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    60
  merging file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    61
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    62
  (branch merge, don't forget to commit)
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    63
  $ hg commit -m "merge 8 to y" # 6
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    64
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    65
  $ hg diff --change 5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    66
  diff -r ae119d680c82 -r 9085c5c02e52 file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    67
  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    68
  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    69
  @@ -6,6 +6,6 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    70
   5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    71
   6
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    72
   7
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    73
  -8
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    74
  +y
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    75
   9
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    76
   10
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    77
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    78
must be similar to 'hg diff --change 5':
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    79
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    80
  $ hg diff -c 6
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    81
  diff -r 273b50f17c6d -r 979ca961fd2e file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    82
  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    83
  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    84
  @@ -6,6 +6,6 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    85
   5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    86
   6
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    87
   7
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    88
  -8
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    89
  +y
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    90
   9
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    91
   10
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    92
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16790
diff changeset
    93
  $ cd ..