1141 @command('^commit|ci', |
1141 @command('^commit|ci', |
1142 [('A', 'addremove', None, |
1142 [('A', 'addremove', None, |
1143 _('mark new/missing files as added/removed before committing')), |
1143 _('mark new/missing files as added/removed before committing')), |
1144 ('', 'close-branch', None, |
1144 ('', 'close-branch', None, |
1145 _('mark a branch as closed, hiding it from the branch list')), |
1145 _('mark a branch as closed, hiding it from the branch list')), |
1146 ] + walkopts + commitopts + commitopts2, |
1146 ] + walkopts + commitopts + commitopts2 + subrepoopts, |
1147 _('[OPTION]... [FILE]...')) |
1147 _('[OPTION]... [FILE]...')) |
1148 def commit(ui, repo, *pats, **opts): |
1148 def commit(ui, repo, *pats, **opts): |
1149 """commit the specified files or all outstanding changes |
1149 """commit the specified files or all outstanding changes |
1150 |
1150 |
1151 Commit changes to the given files into the repository. Unlike a |
1151 Commit changes to the given files into the repository. Unlike a |
1165 |
1165 |
1166 See :hg:`help dates` for a list of formats valid for -d/--date. |
1166 See :hg:`help dates` for a list of formats valid for -d/--date. |
1167 |
1167 |
1168 Returns 0 on success, 1 if nothing changed. |
1168 Returns 0 on success, 1 if nothing changed. |
1169 """ |
1169 """ |
|
1170 if opts.get('subrepos'): |
|
1171 # Let --subrepos on the command line overide config setting. |
|
1172 ui.setconfig('ui', 'commitsubrepos', True) |
|
1173 |
1170 extra = {} |
1174 extra = {} |
1171 if opts.get('close_branch'): |
1175 if opts.get('close_branch'): |
1172 if repo['.'].node() not in repo.branchheads(): |
1176 if repo['.'].node() not in repo.branchheads(): |
1173 # The topo heads set is included in the branch heads set of the |
1177 # The topo heads set is included in the branch heads set of the |
1174 # current branch, so it's sufficient to test branchheads |
1178 # current branch, so it's sufficient to test branchheads |