Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 7655:cce37dab7ad6
branch closing: mark closed branches with a 'close' extra
Adds a --close-branch option to commit.
When --close-branch is present the commit will mark the changeset
with close=1 in the changeset extras field.
If a regular changeset is added on top of a closed head the branch
is no longer considered closed, and thus re-opened.
author | John Mulligan <phlogistonjohn@asynchrono.us> |
---|---|
date | Wed, 14 Jan 2009 21:47:38 -0500 |
parents | 9a1ea6587557 |
children | 6a24fb994701 |
comparison
equal
deleted
inserted
replaced
7654:816b708f23af | 7655:cce37dab7ad6 |
---|---|
611 If no commit message is specified, the configured editor is started to | 611 If no commit message is specified, the configured editor is started to |
612 enter a message. | 612 enter a message. |
613 | 613 |
614 See 'hg help dates' for a list of formats valid for -d/--date. | 614 See 'hg help dates' for a list of formats valid for -d/--date. |
615 """ | 615 """ |
616 extra = {} | |
617 if opts.get('close_branch'): | |
618 extra['close'] = 1 | |
616 def commitfunc(ui, repo, message, match, opts): | 619 def commitfunc(ui, repo, message, match, opts): |
617 return repo.commit(match.files(), message, opts.get('user'), opts.get('date'), | 620 return repo.commit(match.files(), message, opts.get('user'), |
618 match, force_editor=opts.get('force_editor')) | 621 opts.get('date'), match, force_editor=opts.get('force_editor'), |
622 extra=extra) | |
619 | 623 |
620 node = cmdutil.commit(ui, repo, commitfunc, pats, opts) | 624 node = cmdutil.commit(ui, repo, commitfunc, pats, opts) |
621 if not node: | 625 if not node: |
622 return | 626 return |
623 cl = repo.changelog | 627 cl = repo.changelog |
3132 _('[OPTION]... SOURCE [DEST]')), | 3136 _('[OPTION]... SOURCE [DEST]')), |
3133 "^commit|ci": | 3137 "^commit|ci": |
3134 (commit, | 3138 (commit, |
3135 [('A', 'addremove', None, | 3139 [('A', 'addremove', None, |
3136 _('mark new/missing files as added/removed before committing')), | 3140 _('mark new/missing files as added/removed before committing')), |
3141 ('', 'close-branch', None, | |
3142 _('mark a branch as closed, hiding it from the branch list')), | |
3137 ] + walkopts + commitopts + commitopts2, | 3143 ] + walkopts + commitopts + commitopts2, |
3138 _('[OPTION]... [FILE]...')), | 3144 _('[OPTION]... [FILE]...')), |
3139 "copy|cp": | 3145 "copy|cp": |
3140 (copy, | 3146 (copy, |
3141 [('A', 'after', None, _('record a copy that has already occurred')), | 3147 [('A', 'after', None, _('record a copy that has already occurred')), |