Mercurial > public > mercurial-scm > hg
comparison hgext/githelp.py @ 35715:8dbd000f7de9
githelp: improve help for `git add`
The old code was referencing record and crecord, which are
deprecated. `hg commit --interactive` is the preferred mechanism
to use.
In addition, there was duplicate code in this function. It has
been removed.
Tests have been added to cover this function.
Differential Revision: https://phab.mercurial-scm.org/D1723
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 18 Dec 2017 20:51:20 -0800 |
parents | 113281667205 |
children | 05b8adf38c55 |
comparison
equal
deleted
inserted
replaced
35714:113281667205 | 35715:8dbd000f7de9 |
---|---|
154 ('p', 'patch', None, ''), | 154 ('p', 'patch', None, ''), |
155 ] | 155 ] |
156 args, opts = parseoptions(ui, cmdoptions, args) | 156 args, opts = parseoptions(ui, cmdoptions, args) |
157 | 157 |
158 if (opts.get('patch')): | 158 if (opts.get('patch')): |
159 ui.status(_("note: hg crecord has a better UI to record changes\n")) | 159 ui.status(_("note: Mercurial will commit when complete, " |
160 ui.status(_("note: record and crecord will commit when complete, " | 160 "as there is no staging area in Mercurial\n\n")) |
161 "as there is no staging area in mercurial\n\n")) | 161 cmd = Command('commit --interactive') |
162 cmd = Command('record') | |
163 else: | 162 else: |
164 cmd = Command("add") | 163 cmd = Command("add") |
165 | 164 |
166 if not opts.get('all'): | |
167 cmd.extend(args) | |
168 else: | |
169 ui.status(_("note: use hg addremove to remove files that have " | |
170 "been deleted.\n\n")) | |
171 if not opts.get('all'): | 165 if not opts.get('all'): |
172 cmd.extend(args) | 166 cmd.extend(args) |
173 else: | 167 else: |
174 ui.status(_("note: use hg addremove to remove files that have " | 168 ui.status(_("note: use hg addremove to remove files that have " |
175 "been deleted.\n\n")) | 169 "been deleted.\n\n")) |