mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
commit: prevent closing non-head changesets
This commit is contained in:
parent
46e1b0ab1a
commit
a444a7f860
@ -717,6 +717,10 @@ def commit(ui, repo, *pats, **opts):
|
||||
"""
|
||||
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
|
||||
e = cmdutil.commiteditor
|
||||
if opts.get('force_editor'):
|
||||
|
Loading…
Reference in New Issue
Block a user