##// END OF EJS Templates
branch closing: mark closed branches with a 'close' extra...
John Mulligan -
r7655:cce37dab default
parent child Browse files
Show More
@@ -613,9 +613,13 b' def commit(ui, repo, *pats, **opts):'
613 613
614 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 619 def commitfunc(ui, repo, message, match, opts):
617 return repo.commit(match.files(), message, opts.get('user'), opts.get('date'),
618 match, force_editor=opts.get('force_editor'))
620 return repo.commit(match.files(), message, opts.get('user'),
621 opts.get('date'), match, force_editor=opts.get('force_editor'),
622 extra=extra)
619 623
620 624 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
621 625 if not node:
@@ -3134,6 +3138,8 b' table = {'
3134 3138 (commit,
3135 3139 [('A', 'addremove', None,
3136 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 3143 ] + walkopts + commitopts + commitopts2,
3138 3144 _('[OPTION]... [FILE]...')),
3139 3145 "copy|cp":
@@ -763,6 +763,8 b' class localrepository(repo.repository):'
763 763 match=None, force=False, force_editor=False,
764 764 p1=None, p2=None, extra={}, empty_ok=False):
765 765 wlock = lock = None
766 if extra.get("close"):
767 force = True
766 768 if files:
767 769 files = util.unique(files)
768 770 try:
@@ -837,6 +839,8 b' class localrepository(repo.repository):'
837 839 user = wctx.user()
838 840 text = wctx.description()
839 841
842 if branchname == 'default' and extra.get('close'):
843 raise util.Abort(_('closing the default branch is invalid'))
840 844 p1, p2 = [p.node() for p in wctx.parents()]
841 845 c1 = self.changelog.read(p1)
842 846 c2 = self.changelog.read(p2)
General Comments 0
You need to be logged in to leave comments. Login now