##// END OF EJS Templates
rebase: --abort doesn't strip away the target changeset (issue2220)...
Stefano Tortarolo -
r11316:7fa39680 default
parent child Browse files
Show More
@@ -427,7 +427,7 b' def abort(repo, originalwd, target, stat'
427 427 else:
428 428 # Strip from the first rebased revision
429 429 merge.update(repo, repo[originalwd].rev(), False, True, False)
430 rebased = filter(lambda x: x > -1, state.values())
430 rebased = filter(lambda x: x > -1 and x != target, state.values())
431 431 if rebased:
432 432 strippoint = min(rebased)
433 433 # no backup of rebased cset versions needed
@@ -6,35 +6,71 b' echo "[extensions]" >> $HGRCPATH'
6 6 echo "graphlog=" >> $HGRCPATH
7 7 echo "rebase=" >> $HGRCPATH
8 8
9 hg init a
10 cd a
11 echo 'c1' >common
12 hg add common
13 hg commit -d '0 0' -m "C1"
9 createrepo() {
10 rm -rf repo
11 hg init repo
12 cd repo
13 echo 'c1' >common
14 hg add common
15 hg commit -d '0 0' -m "C1"
14 16
15 echo 'c2' >>common
16 hg commit -d '1 0' -m "C2"
17 echo 'c2' >>common
18 hg commit -d '1 0' -m "C2"
19
20 echo 'c3' >>common
21 hg commit -d '2 0' -m "C3"
17 22
18 echo 'c3' >>common
19 hg commit -d '2 0' -m "C3"
23 hg update -C 1
24 echo 'l1' >>extra
25 hg add extra
26 hg commit -d '3 0' -m "L1"
20 27
21 hg update -C 1
22 echo 'l1' >>extra
23 hg add extra
24 hg commit -d '3 0' -m "L1"
28 sed -e 's/c2/l2/' common > common.new
29 mv common.new common
30 hg commit -d '4 0' -m "L2"
31 }
25 32
26 sed -e 's/c2/l2/' common > common.new
27 mv common.new common
28 hg commit -d '4 0' -m "L2"
29
30 hg glog --template '{rev}: {desc}\n'
33 echo
34 createrepo > /dev/null 2>&1
35 hg --config extensions.hgext.graphlog= glog --template '{rev}: {desc}\n'
31 36
32 37 echo
33 38 echo '% Conflicting rebase'
34 hg rebase -s 3 -d 2 | cleanrebase
39 hg --config extensions.hgext.rebase= rebase -s 3 -d 2 | cleanrebase
35 40
36 41 echo
37 42 echo '% Abort'
38 hg rebase --abort | cleanrebase
43 hg --config extensions.hgext.rebase= rebase --abort | cleanrebase
44
45 hg --config extensions.hgext.graphlog= glog --template '{rev}: {desc}\n'
39 46
40 hg glog --template '{rev}: {desc}\n'
47 createrepo() {
48 rm -rf repo
49 hg init repo
50 cd repo
51 echo "a">a
52 hg ci -A -m'A'
53 echo "b">b
54 hg ci -A -m'B'
55 echo "c">c
56 hg ci -A -m'C'
57 hg up 0
58 echo "b">b
59 hg ci -A -m'B bis'
60 echo "c1">c
61 hg ci -A -m'C1'
62 }
63 echo
64 echo '% Rebase and abort without generating new changesets'
65
66 echo
67 createrepo > /dev/null 2>&1
68 hg --config extensions.hgext.graphlog= glog --template '{rev}:{desc|short}\n'
69
70 hg --config extensions.hgext.rebase= rebase -b 4 -d 2 | cleanrebase
71
72 hg --config extensions.hgext.graphlog= glog --template '{rev}:{desc|short}\n'
73
74 hg rebase -a | cleanrebase
75 hg glog --template '{rev}:{desc|short}\n'
76
@@ -1,5 +1,4 b''
1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2 created new head
1
3 2 @ 4: L2
4 3 |
5 4 o 3: L1
@@ -30,3 +29,41 b' o 1: C2'
30 29 |
31 30 o 0: C1
32 31
32
33 % Rebase and abort without generating new changesets
34
35 @ 4:C1
36 |
37 o 3:B bis
38 |
39 | o 2:C
40 | |
41 | o 1:B
42 |/
43 o 0:A
44
45 warning: conflicts during merge.
46 merging c failed!
47 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
48 merging c
49 @ 4:C1
50 |
51 o 3:B bis
52 |
53 | @ 2:C
54 | |
55 | o 1:B
56 |/
57 o 0:A
58
59 rebase aborted
60 @ 4:C1
61 |
62 o 3:B bis
63 |
64 | o 2:C
65 | |
66 | o 1:B
67 |/
68 o 0:A
69
General Comments 0
You need to be logged in to leave comments. Login now