Show More
@@ -874,5 +874,5 b' def summaryhook(ui, repo):' | |||||
874 | def extsetup(ui): |
|
874 | def extsetup(ui): | |
875 | cmdutil.summaryhooks.add('histedit', summaryhook) |
|
875 | cmdutil.summaryhooks.add('histedit', summaryhook) | |
876 | cmdutil.unfinishedstates.append( |
|
876 | cmdutil.unfinishedstates.append( | |
877 | ['histedit-state', False, _('histedit in progress'), |
|
877 | ['histedit-state', False, True, _('histedit in progress'), | |
878 | _("use 'hg histedit --continue' or 'hg histedit --abort'")]) |
|
878 | _("use 'hg histedit --continue' or 'hg histedit --abort'")]) |
@@ -800,5 +800,5 b' def uisetup(ui):' | |||||
800 | _("specify merge tool for rebase"))) |
|
800 | _("specify merge tool for rebase"))) | |
801 | cmdutil.summaryhooks.add('rebase', summaryhook) |
|
801 | cmdutil.summaryhooks.add('rebase', summaryhook) | |
802 | cmdutil.unfinishedstates.append( |
|
802 | cmdutil.unfinishedstates.append( | |
803 | ['rebasestate', False, _('rebase in progress'), |
|
803 | ['rebasestate', False, False, _('rebase in progress'), | |
804 | _("use 'hg rebase --continue' or 'hg rebase --abort'")]) |
|
804 | _("use 'hg rebase --continue' or 'hg rebase --abort'")]) |
@@ -685,7 +685,7 b' def extsetup(ui):' | |||||
685 | revset.symbols['transplanted'] = revsettransplanted |
|
685 | revset.symbols['transplanted'] = revsettransplanted | |
686 | templatekw.keywords['transplanted'] = kwtransplanted |
|
686 | templatekw.keywords['transplanted'] = kwtransplanted | |
687 | cmdutil.unfinishedstates.append( |
|
687 | cmdutil.unfinishedstates.append( | |
688 | ['series', True, _('transplant in progress'), |
|
688 | ['series', True, False, _('transplant in progress'), | |
689 | _("use 'hg transplant --continue' or 'hg update' to abort")]) |
|
689 | _("use 'hg transplant --continue' or 'hg update' to abort")]) | |
690 |
|
690 | |||
691 | # tell hggettext to extract docstrings from these functions: |
|
691 | # tell hggettext to extract docstrings from these functions: |
@@ -2107,20 +2107,22 b' summaryhooks = util.hooks()' | |||||
2107 | # A list of state files kept by multistep operations like graft. |
|
2107 | # A list of state files kept by multistep operations like graft. | |
2108 | # Since graft cannot be aborted, it is considered 'clearable' by update. |
|
2108 | # Since graft cannot be aborted, it is considered 'clearable' by update. | |
2109 | # note: bisect is intentionally excluded |
|
2109 | # note: bisect is intentionally excluded | |
2110 | # (state file, clearable, error, hint) |
|
2110 | # (state file, clearable, allowcommit, error, hint) | |
2111 | unfinishedstates = [ |
|
2111 | unfinishedstates = [ | |
2112 | ('graftstate', True, _('graft in progress'), |
|
2112 | ('graftstate', True, False, _('graft in progress'), | |
2113 | _("use 'hg graft --continue' or 'hg update' to abort")), |
|
2113 | _("use 'hg graft --continue' or 'hg update' to abort")), | |
2114 | ('updatestate', True, _('last update was interrupted'), |
|
2114 | ('updatestate', True, False, _('last update was interrupted'), | |
2115 | _("use 'hg update' to get a consistent checkout")) |
|
2115 | _("use 'hg update' to get a consistent checkout")) | |
2116 | ] |
|
2116 | ] | |
2117 |
|
2117 | |||
2118 | def checkunfinished(repo): |
|
2118 | def checkunfinished(repo, commit=False): | |
2119 | '''Look for an unfinished multistep operation, like graft, and abort |
|
2119 | '''Look for an unfinished multistep operation, like graft, and abort | |
2120 | if found. It's probably good to check this right before |
|
2120 | if found. It's probably good to check this right before | |
2121 | bailifchanged(). |
|
2121 | bailifchanged(). | |
2122 | ''' |
|
2122 | ''' | |
2123 | for f, clearable, msg, hint in unfinishedstates: |
|
2123 | for f, clearable, allowcommit, msg, hint in unfinishedstates: | |
|
2124 | if commit and allowcommit: | |||
|
2125 | continue | |||
2124 | if repo.vfs.exists(f): |
|
2126 | if repo.vfs.exists(f): | |
2125 | raise util.Abort(msg, hint=hint) |
|
2127 | raise util.Abort(msg, hint=hint) | |
2126 |
|
2128 | |||
@@ -2128,9 +2130,9 b' def clearunfinished(repo):' | |||||
2128 | '''Check for unfinished operations (as above), and clear the ones |
|
2130 | '''Check for unfinished operations (as above), and clear the ones | |
2129 | that are clearable. |
|
2131 | that are clearable. | |
2130 | ''' |
|
2132 | ''' | |
2131 | for f, clearable, msg, hint in unfinishedstates: |
|
2133 | for f, clearable, allowcommit, msg, hint in unfinishedstates: | |
2132 | if not clearable and repo.vfs.exists(f): |
|
2134 | if not clearable and repo.vfs.exists(f): | |
2133 | raise util.Abort(msg, hint=hint) |
|
2135 | raise util.Abort(msg, hint=hint) | |
2134 | for f, clearable, msg, hint in unfinishedstates: |
|
2136 | for f, clearable, allowcommit, msg, hint in unfinishedstates: | |
2135 | if clearable and repo.vfs.exists(f): |
|
2137 | if clearable and repo.vfs.exists(f): | |
2136 | util.unlink(repo.join(f)) |
|
2138 | util.unlink(repo.join(f)) |
@@ -1336,7 +1336,7 b' def commit(ui, repo, *pats, **opts):' | |||||
1336 | # Save this for restoring it later |
|
1336 | # Save this for restoring it later | |
1337 | oldcommitphase = ui.config('phases', 'new-commit') |
|
1337 | oldcommitphase = ui.config('phases', 'new-commit') | |
1338 |
|
1338 | |||
1339 | cmdutil.checkunfinished(repo) |
|
1339 | cmdutil.checkunfinished(repo, commit=True) | |
1340 |
|
1340 | |||
1341 | branch = repo[None].branch() |
|
1341 | branch = repo[None].branch() | |
1342 | bheads = repo.branchheads(branch) |
|
1342 | bheads = repo.branchheads(branch) |
@@ -73,8 +73,8 b' Go at a random point and try to continue' | |||||
73 | (use 'hg histedit --continue' or 'hg histedit --abort') |
|
73 | (use 'hg histedit --continue' or 'hg histedit --abort') | |
74 | [255] |
|
74 | [255] | |
75 |
|
75 | |||
76 | commit, then edit the revision (temporarily disable histedit to allow commit) |
|
76 | commit, then edit the revision | |
77 | $ hg ci -m 'wat' --config 'extensions.histedit=!' |
|
77 | $ hg ci -m 'wat' | |
78 | created new head |
|
78 | created new head | |
79 | $ echo a > e |
|
79 | $ echo a > e | |
80 | $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle |
|
80 | $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle |
@@ -214,7 +214,7 b' dropped revision.' | |||||
214 | > 5 |
|
214 | > 5 | |
215 | > EOF |
|
215 | > EOF | |
216 | $ hg resolve --mark file |
|
216 | $ hg resolve --mark file | |
217 | $ hg commit -m '+5.2' --config 'extensions.histedit=!' |
|
217 | $ hg commit -m '+5.2' | |
218 | created new head |
|
218 | created new head | |
219 | $ echo 6 >> file |
|
219 | $ echo 6 >> file | |
220 | $ HGEDITOR=cat hg histedit --continue |
|
220 | $ HGEDITOR=cat hg histedit --continue |
General Comments 0
You need to be logged in to leave comments.
Login now