Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 18955:f3245f22771c
commit: allow closing "non-head" changesets
Backout acd61dc44a39. The changeset prevented closing non-head changesets but
did not provide any rationale or test case and I don't see what value it adds.
Users might have their reasons to commit something anywhere - and close it
immediately.
And contrary to the comment that is removed: The topo heads set is _not_
included in the branch heads set of the current branch. It do not include
closed topological heads.
The change thus prevented closing commits on top of closing commits. A valid
usecase for that is to merge closed heads to reduce the number of topological
heads.
The only existing test coverage for this is the failing double close in
test-revset.t. It was added in 3cc2e34d7a7d and seems to not be intentional.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 10 Apr 2013 13:12:24 +0200 |
parents | 3a72c89a83ec |
children | 1a9ad84583ee |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Jun 13 23:06:34 2012 +0200 +++ b/mercurial/commands.py Wed Apr 10 13:12:24 2013 +0200 @@ -1299,10 +1299,6 @@ extra = {} if opts.get('close_branch'): - if repo['.'].node() not in repo.branchheads(): - # The topo heads set is included in the branch heads set of the - # current branch, so it's sufficient to test branchheads - raise util.Abort(_('can only close branch heads')) extra['close'] = 1 branch = repo[None].branch()