tests/test-merge9.t
author Brodie Rao <brodie@bitheap.org>
Sun, 12 Sep 2010 18:05:53 -0500
changeset 12314 f2daa6ab514a
parent 11982 56d9b73487ff
child 12316 4134686b83e1
permissions -rw-r--r--
merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C' Without specifying the parent revision of the working copy, users will update to tip, which is most likely the other head they were trying to merge, not the revision they were at before the merge.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
     1
test that we don't interrupt the merge session if
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
     2
a file-level merge failed
4682
dc5920ea12f8 merge: fix small bug with a failed merge across a rename
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     3
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
     4
  $ hg init repo
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
     5
  $ cd repo
4682
dc5920ea12f8 merge: fix small bug with a failed merge across a rename
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     6
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
     7
  $ echo foo > foo
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
     8
  $ echo a > bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
     9
  $ hg ci -Am 'add foo'
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    10
  adding bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    11
  adding foo
4682
dc5920ea12f8 merge: fix small bug with a failed merge across a rename
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    12
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    13
  $ hg mv foo baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    14
  $ echo b >> bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    15
  $ echo quux > quux1
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    16
  $ hg ci -Am 'mv foo baz'
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    17
  adding quux1
4682
dc5920ea12f8 merge: fix small bug with a failed merge across a rename
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    18
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    19
  $ hg up -qC 0
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    20
  $ echo >> foo
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    21
  $ echo c >> bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    22
  $ echo quux > quux2
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    23
  $ hg ci -Am 'change foo'
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    24
  adding quux2
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    25
  created new head
4682
dc5920ea12f8 merge: fix small bug with a failed merge across a rename
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    26
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    27
test with the rename on the remote side
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    28
  $ HGMERGE=false hg merge
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    29
  merging bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    30
  merging bar failed!
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    31
  merging foo and baz to baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    32
  1 files updated, 1 files merged, 0 files removed, 1 files unresolved
12314
f2daa6ab514a merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents: 11982
diff changeset
    33
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    34
  $ hg resolve -l
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    35
  U bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    36
  R baz
4682
dc5920ea12f8 merge: fix small bug with a failed merge across a rename
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    37
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    38
test with the rename on the local side
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    39
  $ hg up -C 1
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    40
  3 files updated, 0 files merged, 1 files removed, 0 files unresolved
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    41
  $ HGMERGE=false hg merge
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    42
  merging bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    43
  merging bar failed!
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    44
  merging baz and foo to baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    45
  1 files updated, 1 files merged, 0 files removed, 1 files unresolved
12314
f2daa6ab514a merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents: 11982
diff changeset
    46
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
6518
92ccccb55ba3 resolve: new command
Matt Mackall <mpm@selenic.com>
parents: 4682
diff changeset
    47
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    48
show unresolved
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    49
  $ hg resolve -l
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    50
  U bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    51
  R baz
6518
92ccccb55ba3 resolve: new command
Matt Mackall <mpm@selenic.com>
parents: 4682
diff changeset
    52
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    53
unmark baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    54
  $ hg resolve -u baz
6518
92ccccb55ba3 resolve: new command
Matt Mackall <mpm@selenic.com>
parents: 4682
diff changeset
    55
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    56
show
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    57
  $ hg resolve -l
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    58
  U bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    59
  U baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    60
  $ hg st
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    61
  M bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    62
  M baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    63
  M quux2
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    64
  ? bar.orig
6518
92ccccb55ba3 resolve: new command
Matt Mackall <mpm@selenic.com>
parents: 4682
diff changeset
    65
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    66
re-resolve baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    67
  $ hg resolve baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    68
  merging baz and foo to baz
6518
92ccccb55ba3 resolve: new command
Matt Mackall <mpm@selenic.com>
parents: 4682
diff changeset
    69
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    70
after resolve
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    71
  $ hg resolve -l
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    72
  U bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    73
  R baz
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    74
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    75
resolve all warning
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    76
  $ hg resolve
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    77
  abort: no files or directories specified; use --all to remerge all files
7527
5a14a8f3b909 resolve: require -a switch to resolve all files
Matt Mackall <mpm@selenic.com>
parents: 6518
diff changeset
    78
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    79
resolve all
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    80
  $ hg resolve -a
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    81
  merging bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    82
  warning: conflicts during merge.
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    83
  merging bar failed!
6518
92ccccb55ba3 resolve: new command
Matt Mackall <mpm@selenic.com>
parents: 4682
diff changeset
    84
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    85
after
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    86
  $ hg resolve -l
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    87
  U bar
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    88
  R baz
6518
92ccccb55ba3 resolve: new command
Matt Mackall <mpm@selenic.com>
parents: 4682
diff changeset
    89
11982
56d9b73487ff tests: unify test-merge9
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 8167
diff changeset
    90
  $ true