Show More
@@ -1923,6 +1923,11 b' def _computeobsoletenotrebased(repo, reb' | |||||
1923 | obsoleteextinctsuccessors, |
|
1923 | obsoleteextinctsuccessors, | |
1924 | ) |
|
1924 | ) | |
1925 |
|
1925 | |||
|
1926 | def abortrebase(ui, repo): | |||
|
1927 | with repo.wlock(), repo.lock(): | |||
|
1928 | rbsrt = rebaseruntime(repo, ui) | |||
|
1929 | rbsrt._prepareabortorcontinue(isabort=True) | |||
|
1930 | ||||
1926 | def summaryhook(ui, repo): |
|
1931 | def summaryhook(ui, repo): | |
1927 | if not repo.vfs.exists('rebasestate'): |
|
1932 | if not repo.vfs.exists('rebasestate'): | |
1928 | return |
|
1933 | return | |
@@ -1951,4 +1956,4 b' def uisetup(ui):' | |||||
1951 | _("specify merge tool for rebase"))) |
|
1956 | _("specify merge tool for rebase"))) | |
1952 | cmdutil.summaryhooks.add('rebase', summaryhook) |
|
1957 | cmdutil.summaryhooks.add('rebase', summaryhook) | |
1953 | statemod.addunfinished('rebase', fname='rebasestate', stopflag=True, |
|
1958 | statemod.addunfinished('rebase', fname='rebasestate', stopflag=True, | |
1954 | continueflag=True) |
|
1959 | continueflag=True, abortfunc=abortrebase) |
@@ -1,3 +1,5 b'' | |||||
|
1 | #testcases abortcommand abortflag | |||
|
2 | ||||
1 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
4 | > [extensions] | |
3 | > rebase= |
|
5 | > rebase= | |
@@ -9,6 +11,12 b'' | |||||
9 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" |
|
11 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
10 | > EOF |
|
12 | > EOF | |
11 |
|
13 | |||
|
14 | #if abortflag | |||
|
15 | $ cat >> $HGRCPATH <<EOF | |||
|
16 | > [alias] | |||
|
17 | > abort = rebase --abort | |||
|
18 | > EOF | |||
|
19 | #endif | |||
12 |
|
20 | |||
13 | $ hg init a |
|
21 | $ hg init a | |
14 | $ cd a |
|
22 | $ cd a | |
@@ -114,7 +122,13 b' Insert unsupported mandatory merge recor' | |||||
114 |
|
122 | |||
115 | Abort (should clear out unsupported merge state): |
|
123 | Abort (should clear out unsupported merge state): | |
116 |
|
124 | |||
117 | $ hg rebase --abort |
|
125 | #if abortcommand | |
|
126 | when in dry-run mode | |||
|
127 | $ hg abort --dry-run | |||
|
128 | rebase in progress, will be aborted | |||
|
129 | #endif | |||
|
130 | ||||
|
131 | $ hg abort | |||
118 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-6beef7d5-backup.hg |
|
132 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-6beef7d5-backup.hg | |
119 | rebase aborted |
|
133 | rebase aborted | |
120 | $ hg debugmergestate |
|
134 | $ hg debugmergestate | |
@@ -154,7 +168,7 b' earlier than 2.7 by renaming ".hg/rebase' | |||||
154 | [255] |
|
168 | [255] | |
155 | $ hg summary | grep '^rebase: ' |
|
169 | $ hg summary | grep '^rebase: ' | |
156 | rebase: (use "hg rebase --abort" to clear broken state) |
|
170 | rebase: (use "hg rebase --abort" to clear broken state) | |
157 |
$ hg |
|
171 | $ hg abort | |
158 | rebase aborted (no revision is removed, only broken state is cleared) |
|
172 | rebase aborted (no revision is removed, only broken state is cleared) | |
159 |
|
173 | |||
160 | $ cd .. |
|
174 | $ cd .. | |
@@ -271,7 +285,7 b' rebase abort should not leave working co' | |||||
271 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
285 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
272 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
286 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
273 | [1] |
|
287 | [1] | |
274 |
$ hg |
|
288 | $ hg abort | |
275 | rebase aborted |
|
289 | rebase aborted | |
276 | $ hg log -G --template "{rev} {desc} {bookmarks}" |
|
290 | $ hg log -G --template "{rev} {desc} {bookmarks}" | |
277 | @ 3 C foo |
|
291 | @ 3 C foo | |
@@ -324,7 +338,7 b' user has somehow managed to update to a ' | |||||
324 |
|
338 | |||
325 | $ cat a |
|
339 | $ cat a | |
326 | new |
|
340 | new | |
327 |
$ hg |
|
341 | $ hg abort | |
328 | rebase aborted |
|
342 | rebase aborted | |
329 | $ cat a |
|
343 | $ cat a | |
330 | new |
|
344 | new | |
@@ -405,7 +419,7 b' New operations are blocked with the corr' | |||||
405 | (use 'hg rebase --continue' or 'hg rebase --abort') |
|
419 | (use 'hg rebase --continue' or 'hg rebase --abort') | |
406 | [255] |
|
420 | [255] | |
407 |
|
421 | |||
408 |
$ hg |
|
422 | $ hg abort | |
409 | saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg |
|
423 | saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg | |
410 | rebase aborted |
|
424 | rebase aborted | |
411 | $ hg log -G --template "{rev} {desc} {bookmarks}" |
|
425 | $ hg log -G --template "{rev} {desc} {bookmarks}" | |
@@ -456,7 +470,7 b' during a rebase (issue4661)' | |||||
456 | rebasing 2:e4ea5cdc9789 "conflicting 1" |
|
470 | rebasing 2:e4ea5cdc9789 "conflicting 1" | |
457 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
471 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
458 | [1] |
|
472 | [1] | |
459 |
$ hg |
|
473 | $ hg abort | |
460 | rebase aborted |
|
474 | rebase aborted | |
461 | $ hg summary |
|
475 | $ hg summary | |
462 | parent: 3:b16646383533 tip |
|
476 | parent: 3:b16646383533 tip | |
@@ -497,7 +511,7 b' commit will cause merge conflict on reba' | |||||
497 | warning: conflicts while merging root! (edit, then use 'hg resolve --mark') |
|
511 | warning: conflicts while merging root! (edit, then use 'hg resolve --mark') | |
498 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
512 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
499 | [1] |
|
513 | [1] | |
500 |
$ hg |
|
514 | $ hg abort | |
501 | rebase aborted |
|
515 | rebase aborted | |
502 | $ cd .. |
|
516 | $ cd .. | |
503 |
|
517 |
General Comments 0
You need to be logged in to leave comments.
Login now