Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 27143:fab21bac1024
commands: add example for 'hg add'
author | Mathias De Mar? <mathias.demare@gmail.com> |
---|---|
date | Wed, 25 Nov 2015 18:10:31 +0100 |
parents | dfdac09b57dd |
children | 24440cc7b441 |
comparison
equal
deleted
inserted
replaced
27142:060f83d219b9 | 27143:fab21bac1024 |
---|---|
188 | 188 |
189 If no names are given, add all files to the repository. | 189 If no names are given, add all files to the repository. |
190 | 190 |
191 .. container:: verbose | 191 .. container:: verbose |
192 | 192 |
193 An example showing how new (unknown) files are added | 193 Examples: |
194 automatically by :hg:`add`:: | 194 |
195 | 195 - New (unknown) files are added |
196 $ ls | 196 automatically by :hg:`add`:: |
197 foo.c | 197 |
198 $ hg status | 198 $ ls |
199 ? foo.c | 199 foo.c |
200 $ hg add | 200 $ hg status |
201 adding foo.c | 201 ? foo.c |
202 $ hg status | 202 $ hg add |
203 A foo.c | 203 adding foo.c |
204 $ hg status | |
205 A foo.c | |
206 | |
207 - Specific files to be added can be specified:: | |
208 | |
209 $ ls | |
210 bar.c foo.c | |
211 $ hg status | |
212 ? bar.c | |
213 ? foo.c | |
214 $ hg add bar.c | |
215 $ hg status | |
216 A bar.c | |
217 ? foo.c | |
204 | 218 |
205 Returns 0 if all files are successfully added. | 219 Returns 0 if all files are successfully added. |
206 """ | 220 """ |
207 | 221 |
208 m = scmutil.match(repo[None], pats, opts) | 222 m = scmutil.match(repo[None], pats, opts) |