summaryrefslogtreecommitdiff
path: root/tests/test-rebase-conflicts.t
blob: 2ee4bdd7e69b2e43aa3de74b7b37106d0a78d077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > graphlog=
  > rebase=
  > 
  > [alias]
  > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
  > EOF

  $ hg init a
  $ cd a
  $ echo c1 >common
  $ hg add common
  $ hg ci -m C1

  $ echo c2 >>common
  $ hg ci -m C2

  $ echo c3 >>common
  $ hg ci -m C3

  $ hg up -q -C 1

  $ echo l1 >>extra
  $ hg add extra
  $ hg ci -m L1
  created new head

  $ sed -e 's/c2/l2/' common > common.new
  $ mv common.new common
  $ hg ci -m L2

  $ echo l3 >> extra2
  $ hg add extra2
  $ hg ci -m L3

  $ hg tglog
  @  5: 'L3'
  |
  o  4: 'L2'
  |
  o  3: 'L1'
  |
  | o  2: 'C3'
  |/
  o  1: 'C2'
  |
  o  0: 'C1'
  
Try to call --continue:

  $ hg rebase --continue
  abort: no rebase in progress
  [255]

Conflicting rebase:

  $ hg rebase -s 3 -d 2
  merging common
  warning: conflicts during merge.
  merging common failed!
  abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
  [255]

Try to continue without solving the conflict:

  $ hg rebase --continue 
  abort: unresolved merge conflicts (see hg help resolve)
  [255]

Conclude rebase:

  $ echo 'resolved merge' >common
  $ hg resolve -m common
  $ hg rebase --continue
  saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)

  $ hg tglog
  @  5: 'L3'
  |
  o  4: 'L2'
  |
  o  3: 'L1'
  |
  o  2: 'C3'
  |
  o  1: 'C2'
  |
  o  0: 'C1'
  
Check correctness:

  $ hg cat -r 0 common
  c1

  $ hg cat -r 1 common
  c1
  c2

  $ hg cat -r 2 common
  c1
  c2
  c3

  $ hg cat -r 3 common
  c1
  c2
  c3

  $ hg cat -r 4 common
  resolved merge

  $ hg cat -r 5 common
  resolved merge