##// END OF EJS Templates
rebase: recompute the set of skipped rev when using --continue (issue2330)
Benoit Boissinot -
r11843:00f8e783 stable
parent child Browse files
Show More
@@ -110,7 +110,7 b' def rebase(ui, repo, **opts):'
110 raise util.Abort(
110 raise util.Abort(
111 _('abort and continue do not allow specifying revisions'))
111 _('abort and continue do not allow specifying revisions'))
112
112
113 (originalwd, target, state, collapsef, keepf,
113 (originalwd, target, state, skipped, collapsef, keepf,
114 keepbranchesf, external) = restorestatus(repo)
114 keepbranchesf, external) = restorestatus(repo)
115 if abortf:
115 if abortf:
116 return abort(repo, originalwd, target, state)
116 return abort(repo, originalwd, target, state)
@@ -413,8 +413,18 b' def restorestatus(repo):'
413 else:
413 else:
414 oldrev, newrev = l.split(':')
414 oldrev, newrev = l.split(':')
415 state[repo[oldrev].rev()] = repo[newrev].rev()
415 state[repo[oldrev].rev()] = repo[newrev].rev()
416 skipped = set()
417 # recompute the set of skipped revs
418 if not collapse:
419 seen = set([target])
420 for old, new in sorted(state.items()):
421 if new != nullrev and new in seen:
422 skipped.add(old)
423 seen.add(new)
424 repo.ui.debug('computed skipped revs: %s\n' % skipped)
416 repo.ui.debug('rebase status resumed\n')
425 repo.ui.debug('rebase status resumed\n')
417 return originalwd, target, state, collapse, keep, keepbranches, external
426 return (originalwd, target, state, skipped,
427 collapse, keep, keepbranches, external)
418 except IOError, err:
428 except IOError, err:
419 if err.errno != errno.ENOENT:
429 if err.errno != errno.ENOENT:
420 raise
430 raise
@@ -44,3 +44,33 b" echo '% Rebase'"
44 hg up -C qtip
44 hg up -C qtip
45 hg rebase | hidebackup
45 hg rebase | hidebackup
46 hg glog --template '{rev} {desc} tags: {tags}\n'
46 hg glog --template '{rev} {desc} tags: {tags}\n'
47
48 echo
49 echo '% Now with --continue'
50 cd ..
51 hg init b
52 cd b
53 hg qinit -c # This must work even with a managed mq queue
54
55 for i in r0 r1 r2 r3 r4 r5 r6;
56 do
57 echo $i > $i
58 hg ci -Am $i
59 done
60 hg qimport -r 1:tip
61 hg up 0
62 for i in r1 r3 r7 r8;
63 do
64 echo $i > $i
65 hg ci -Am branch2-$i
66 done
67 echo somethingelse > r4
68 hg ci -Am branch2-r4
69 echo r6 > r6
70 hg ci -Am branch2-r6
71
72 hg up qtip
73 HGMERGE=internal:fail hg rebase | hidebackup
74 HGMERGE=internal:local hg resolve --all
75 hg rebase --continue | hidebackup
76 hg glog --template '{rev} {desc} tags: {tags}\n'
@@ -15,3 +15,43 b' o 1 R1 tags:'
15 |
15 |
16 o 0 C1 tags:
16 o 0 C1 tags:
17
17
18
19 % Now with --continue
20 adding r0
21 adding r1
22 adding r2
23 adding r3
24 adding r4
25 adding r5
26 adding r6
27 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
28 adding r1
29 created new head
30 adding r3
31 adding r7
32 adding r8
33 adding r4
34 adding r6
35 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
36 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
37 saved backup bundle to
38 @ 9 r5 tags: 5.diff qtip tip
39 |
40 o 8 r4 tags: 4.diff
41 |
42 o 7 r2 tags: 2.diff qbase
43 |
44 o 6 branch2-r6 tags: qparent
45 |
46 o 5 branch2-r4 tags:
47 |
48 o 4 branch2-r8 tags:
49 |
50 o 3 branch2-r7 tags:
51 |
52 o 2 branch2-r3 tags:
53 |
54 o 1 branch2-r1 tags:
55 |
56 o 0 r0 tags:
57
General Comments 0
You need to be logged in to leave comments. Login now