Show More
@@ -2087,10 +2087,17 b' def _docommit(ui, repo, *pats, **opts):' | |||||
2087 | extra[b'close'] = b'1' |
|
2087 | extra[b'close'] = b'1' | |
2088 |
|
2088 | |||
2089 | if repo[b'.'].closesbranch(): |
|
2089 | if repo[b'.'].closesbranch(): | |
2090 | raise error.InputError( |
|
2090 | # Not ideal, but let us do an extra status early to prevent early | |
2091 | _(b'current revision is already a branch closing head') |
|
2091 | # bail out. | |
2092 | ) |
|
2092 | matcher = scmutil.match(repo[None], pats, opts) | |
2093 | elif not bheads: |
|
2093 | s = repo.status(match=matcher) | |
|
2094 | if s.modified or s.added or s.removed: | |||
|
2095 | bheads = repo.branchheads(branch, closed=True) | |||
|
2096 | else: | |||
|
2097 | msg = _(b'current revision is already a branch closing head') | |||
|
2098 | raise error.InputError(msg) | |||
|
2099 | ||||
|
2100 | if not bheads: | |||
2094 | raise error.InputError( |
|
2101 | raise error.InputError( | |
2095 | _(b'branch "%s" has no heads to close') % branch |
|
2102 | _(b'branch "%s" has no heads to close') % branch | |
2096 | ) |
|
2103 | ) |
@@ -283,6 +283,19 b' verify update will accept invalid legacy' | |||||
283 | abort: current revision is already a branch closing head |
|
283 | abort: current revision is already a branch closing head | |
284 | [10] |
|
284 | [10] | |
285 |
|
285 | |||
|
286 | $ echo foo > b | |||
|
287 | $ hg commit -d '9 0' --close-branch -m 're-closing this branch' | |||
|
288 | ||||
|
289 | $ echo bar > b | |||
|
290 | $ hg commit -d '9 0' --close-branch -m 're-closing this branch' bh1 | |||
|
291 | abort: current revision is already a branch closing head | |||
|
292 | [10] | |||
|
293 | $ hg commit -d '9 0' --close-branch -m 're-closing this branch' b | |||
|
294 | ||||
|
295 | $ hg debugstrip --rev 13: --no-backup | |||
|
296 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
297 | $ hg revert --all --no-backup | |||
|
298 | ||||
286 | $ hg log -r tip --debug |
|
299 | $ hg log -r tip --debug | |
287 | changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f |
|
300 | changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f | |
288 | branch: b |
|
301 | branch: b |
General Comments 0
You need to be logged in to leave comments.
Login now