##// END OF EJS Templates
continue: added support for rebase...
Taapas Agrawal -
r42819:db963eda default draft
parent child Browse files
Show More
@@ -1928,6 +1928,17 b' def abortrebase(ui, repo):'
1928 rbsrt = rebaseruntime(repo, ui)
1928 rbsrt = rebaseruntime(repo, ui)
1929 rbsrt._prepareabortorcontinue(isabort=True)
1929 rbsrt._prepareabortorcontinue(isabort=True)
1930
1930
1931 def continuerebase(ui, repo):
1932 with repo.wlock(), repo.lock():
1933 rbsrt = rebaseruntime(repo, ui)
1934 ms = mergemod.mergestate.read(repo)
1935 mergeutil.checkunresolved(ms)
1936 retcode = rbsrt._prepareabortorcontinue(isabort=False)
1937 if retcode is not None:
1938 return retcode
1939 rbsrt._performrebase(None)
1940 rbsrt._finishrebase()
1941
1931 def summaryhook(ui, repo):
1942 def summaryhook(ui, repo):
1932 if not repo.vfs.exists('rebasestate'):
1943 if not repo.vfs.exists('rebasestate'):
1933 return
1944 return
@@ -1956,4 +1967,5 b' def uisetup(ui):'
1956 _("specify merge tool for rebase")))
1967 _("specify merge tool for rebase")))
1957 cmdutil.summaryhooks.add('rebase', summaryhook)
1968 cmdutil.summaryhooks.add('rebase', summaryhook)
1958 statemod.addunfinished('rebase', fname='rebasestate', stopflag=True,
1969 statemod.addunfinished('rebase', fname='rebasestate', stopflag=True,
1959 continueflag=True, abortfunc=abortrebase)
1970 continueflag=True, abortfunc=abortrebase,
1971 continuefunc=continuerebase)
@@ -1,3 +1,10 b''
1 #testcases continuecommand continueflag
2 #if continueflag
3 $ cat >> $HGRCPATH <<EOF
4 > [alias]
5 > continue = rebase --continue
6 > EOF
7 #endif
1
8
2 $ . "$TESTDIR/narrow-library.sh"
9 $ . "$TESTDIR/narrow-library.sh"
3
10
@@ -69,7 +76,7 b' Can rebase onto conflicting changes insi'
69 $ echo modified3 > inside/f1
76 $ echo modified3 > inside/f1
70 $ hg resolve -m 2>&1 | grep -v continue:
77 $ hg resolve -m 2>&1 | grep -v continue:
71 (no more unresolved files)
78 (no more unresolved files)
72 $ hg rebase --continue
79 $ hg continue
73 rebasing 6:cdce97fbf653 "conflicting inside/f1" (tip)
80 rebasing 6:cdce97fbf653 "conflicting inside/f1" (tip)
74 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
81 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
75
82
@@ -1,4 +1,5 b''
1 #testcases abortcommand abortflag
1 #testcases abortcommand abortflag
2 #testcases continuecommand continueflag
2
3
3 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
5 > [extensions]
@@ -18,6 +19,13 b''
18 > EOF
19 > EOF
19 #endif
20 #endif
20
21
22 #if continueflag
23 $ cat >> $HGRCPATH <<EOF
24 > [alias]
25 > continue = rebase --continue
26 > EOF
27 #endif
28
21 $ hg init a
29 $ hg init a
22 $ cd a
30 $ cd a
23
31
@@ -162,7 +170,7 b' earlier than 2.7 by renaming ".hg/rebase'
162 $ hg --config extensions.mq= strip --quiet "destination()"
170 $ hg --config extensions.mq= strip --quiet "destination()"
163 $ mv .hg/rebasestate.back .hg/rebasestate
171 $ mv .hg/rebasestate.back .hg/rebasestate
164
172
165 $ hg rebase --continue
173 $ hg continue
166 abort: cannot continue inconsistent rebase
174 abort: cannot continue inconsistent rebase
167 (use "hg rebase --abort" to clear broken state)
175 (use "hg rebase --abort" to clear broken state)
168 [255]
176 [255]
@@ -1,3 +1,4 b''
1 #testcases continuecommand continueflag
1 Test rebase --continue with rebasestate written by legacy client
2 Test rebase --continue with rebasestate written by legacy client
2
3
3 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
@@ -6,6 +7,13 b' Test rebase --continue with rebasestate '
6 > drawdag=$TESTDIR/drawdag.py
7 > drawdag=$TESTDIR/drawdag.py
7 > EOF
8 > EOF
8
9
10 #if continueflag
11 $ cat >> $HGRCPATH <<EOF
12 > [alias]
13 > continue = rebase --continue
14 > EOF
15 #endif
16
9 $ hg init
17 $ hg init
10 $ hg debugdrawdag <<'EOF'
18 $ hg debugdrawdag <<'EOF'
11 > D H
19 > D H
@@ -40,7 +48,12 b' rebasestate generated by a legacy client'
40 > 6582e6951a9c48c236f746f186378e36f59f4928:0000000000000000000000000000000000000000
48 > 6582e6951a9c48c236f746f186378e36f59f4928:0000000000000000000000000000000000000000
41 > EOF
49 > EOF
42
50
43 $ hg rebase --continue
51 #if continuecommand
52 $ hg continue --dry-run
53 rebase in progress, will be resumed
54 #endif
55
56 $ hg continue
44 rebasing 4:c1e6b162678d "B" (B)
57 rebasing 4:c1e6b162678d "B" (B)
45 rebasing 8:6f7a236de685 "D" (D)
58 rebasing 8:6f7a236de685 "D" (D)
46 rebasing 2:de008c61a447 "E" (E)
59 rebasing 2:de008c61a447 "E" (E)
@@ -1,3 +1,4 b''
1 #testcases continuecommand continueflag
1 This emulates the effects of an hg pull --rebase in which the remote repo
2 This emulates the effects of an hg pull --rebase in which the remote repo
2 already has one local mq patch
3 already has one local mq patch
3
4
@@ -13,6 +14,12 b' already has one local mq patch'
13 > tglog = log -G --template "{rev}: {node|short} '{desc}' tags: {tags}\n"
14 > tglog = log -G --template "{rev}: {node|short} '{desc}' tags: {tags}\n"
14 > EOF
15 > EOF
15
16
17 #if continueflag
18 $ cat >> $HGRCPATH <<EOF
19 > [alias]
20 > continue = rebase --continue
21 > EOF
22 #endif
16
23
17 $ hg init a
24 $ hg init a
18 $ cd a
25 $ cd a
@@ -155,7 +162,7 b' already has one local mq patch'
155 (no more unresolved files)
162 (no more unresolved files)
156 continue: hg rebase --continue
163 continue: hg rebase --continue
157
164
158 $ hg rebase --continue
165 $ hg continue
159 already rebased 1:b4bffa6e4776 "r1" (qbase r1) as 057f55ff8f44
166 already rebased 1:b4bffa6e4776 "r1" (qbase r1) as 057f55ff8f44
160 already rebased 2:c0fd129beb01 "r2" (r2) as 1660ab13ce9a
167 already rebased 2:c0fd129beb01 "r2" (r2) as 1660ab13ce9a
161 already rebased 3:6ff5b8feed8e "r3" (r3) as 1660ab13ce9a
168 already rebased 3:6ff5b8feed8e "r3" (r3) as 1660ab13ce9a
@@ -1,3 +1,4 b''
1 #testcases continuecommand continueflag
1 Rebasing using a single transaction
2 Rebasing using a single transaction
2
3
3 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
@@ -15,6 +16,13 b' Rebasing using a single transaction'
15 > tglog = log -G --template "{rev}: {desc}"
16 > tglog = log -G --template "{rev}: {desc}"
16 > EOF
17 > EOF
17
18
19 #if continueflag
20 $ cat >> $HGRCPATH <<EOF
21 > [alias]
22 > continue = rebase --continue
23 > EOF
24 #endif
25
18 Check that a simple rebase works
26 Check that a simple rebase works
19
27
20 $ hg init simple && cd simple
28 $ hg init simple && cd simple
@@ -123,7 +131,7 b' continued'
123 $ hg resolve -m
131 $ hg resolve -m
124 (no more unresolved files)
132 (no more unresolved files)
125 continue: hg rebase --continue
133 continue: hg rebase --continue
126 $ hg rebase --continue
134 $ hg continue
127 already rebased 1:112478962961 "B" (B) as 79bc8f4973ce
135 already rebased 1:112478962961 "B" (B) as 79bc8f4973ce
128 rebasing 3:c26739dbe603 "C" (C)
136 rebasing 3:c26739dbe603 "C" (C)
129 rebasing 5:d24bb333861c "D" (D tip)
137 rebasing 5:d24bb333861c "D" (D tip)
@@ -177,7 +185,7 b' rebase can then be continued'
177 |/
185 |/
178 o 0: A
186 o 0: A
179
187
180 $ hg rebase --continue
188 $ hg continue
181 rebasing 1:112478962961 "B" (B)
189 rebasing 1:112478962961 "B" (B)
182 rebasing 3:26805aba1e60 "C" (C)
190 rebasing 3:26805aba1e60 "C" (C)
183 rebasing 5:f585351a92f8 "D" (D tip)
191 rebasing 5:f585351a92f8 "D" (D tip)
General Comments 0
You need to be logged in to leave comments. Login now