Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 5574:d4ec6d61b3ee
imported patch rev-help
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 02 Dec 2007 15:25:37 -0600 |
parents | e2da5b340651 |
children | 8788ff630c26 |
comparison
equal
deleted
inserted
replaced
5573:e2da5b340651 | 5574:d4ec6d61b3ee |
---|---|
2271 return errs | 2271 return errs |
2272 finally: | 2272 finally: |
2273 del wlock | 2273 del wlock |
2274 | 2274 |
2275 def revert(ui, repo, *pats, **opts): | 2275 def revert(ui, repo, *pats, **opts): |
2276 """revert files or dirs to their states as of some revision | 2276 """restore individual files or dirs to an earlier state |
2277 | |
2278 (use update -r to check out earlier revisions, revert does not | |
2279 change the working dir parents) | |
2277 | 2280 |
2278 With no revision specified, revert the named files or directories | 2281 With no revision specified, revert the named files or directories |
2279 to the contents they had in the parent of the working directory. | 2282 to the contents they had in the parent of the working directory. |
2280 This restores the contents of the affected files to an unmodified | 2283 This restores the contents of the affected files to an unmodified |
2281 state and unschedules adds, removes, copies, and renames. If the | 2284 state and unschedules adds, removes, copies, and renames. If the |
2282 working directory has two parents, you must explicitly specify the | 2285 working directory has two parents, you must explicitly specify the |
2283 revision to revert to. | 2286 revision to revert to. |
2284 | 2287 |
2285 Modified files are saved with a .orig suffix before reverting. | |
2286 To disable these backups, use --no-backup. | |
2287 | |
2288 Using the -r option, revert the given files or directories to their | 2288 Using the -r option, revert the given files or directories to their |
2289 contents as of a specific revision. This can be helpful to "roll | 2289 contents as of a specific revision. This can be helpful to "roll |
2290 back" some or all of a change that should not have been committed. | 2290 back" some or all of an earlier change. |
2291 | 2291 |
2292 Revert modifies the working directory. It does not commit any | 2292 Revert modifies the working directory. It does not commit any |
2293 changes, or change the parent of the working directory. If you | 2293 changes, or change the parent of the working directory. If you |
2294 revert to a revision other than the parent of the working | 2294 revert to a revision other than the parent of the working |
2295 directory, the reverted files will thus appear modified | 2295 directory, the reverted files will thus appear modified |
2299 mode of a file was changed, it is reset. | 2299 mode of a file was changed, it is reset. |
2300 | 2300 |
2301 If names are given, all files matching the names are reverted. | 2301 If names are given, all files matching the names are reverted. |
2302 | 2302 |
2303 If no arguments are given, no files are reverted. | 2303 If no arguments are given, no files are reverted. |
2304 | |
2305 Modified files are saved with a .orig suffix before reverting. | |
2306 To disable these backups, use --no-backup. | |
2304 """ | 2307 """ |
2305 | 2308 |
2306 if opts["date"]: | 2309 if opts["date"]: |
2307 if opts["rev"]: | 2310 if opts["rev"]: |
2308 raise util.Abort(_("you can't specify a revision and a date")) | 2311 raise util.Abort(_("you can't specify a revision and a date")) |
3083 [('A', 'after', None, _('record a rename that has already occurred')), | 3086 [('A', 'after', None, _('record a rename that has already occurred')), |
3084 ('f', 'force', None, | 3087 ('f', 'force', None, |
3085 _('forcibly copy over an existing managed file')), | 3088 _('forcibly copy over an existing managed file')), |
3086 ] + walkopts + dryrunopts, | 3089 ] + walkopts + dryrunopts, |
3087 _('hg rename [OPTION]... SOURCE... DEST')), | 3090 _('hg rename [OPTION]... SOURCE... DEST')), |
3088 "^revert": | 3091 "revert": |
3089 (revert, | 3092 (revert, |
3090 [('a', 'all', None, _('revert all changes when no arguments given')), | 3093 [('a', 'all', None, _('revert all changes when no arguments given')), |
3091 ('d', 'date', '', _('tipmost revision matching date')), | 3094 ('d', 'date', '', _('tipmost revision matching date')), |
3092 ('r', 'rev', '', _('revision to revert to')), | 3095 ('r', 'rev', '', _('revision to revert to')), |
3093 ('', 'no-backup', None, _('do not save backup copies of files')), | 3096 ('', 'no-backup', None, _('do not save backup copies of files')), |