Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 7527:5a14a8f3b909
resolve: require -a switch to resolve all files
Like revert -a, this should make this command slightly safer
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 19 Dec 2008 16:47:36 -0600 |
parents | f848d7f96195 |
children | eadcc075967e |
comparison
equal
deleted
inserted
replaced
7526:b7d4db95e95a | 7527:5a14a8f3b909 |
---|---|
2338 The codes used to show the status of files are: | 2338 The codes used to show the status of files are: |
2339 U = unresolved | 2339 U = unresolved |
2340 R = resolved | 2340 R = resolved |
2341 """ | 2341 """ |
2342 | 2342 |
2343 if len([x for x in opts if opts[x]]) > 1: | 2343 all, mark, unmark, show = [opts.get(o) for o in 'all mark unmark list'.split()] |
2344 | |
2345 if (show and (mark or unmark)) or (mark and unmark): | |
2344 raise util.Abort(_("too many options specified")) | 2346 raise util.Abort(_("too many options specified")) |
2347 if pats and all: | |
2348 raise util.Abort(_("can't specify --all and patterns")) | |
2349 if not (all or pats or show or mark or unmark): | |
2350 raise util.Abort(_('no files or directories specified; ' | |
2351 'use --all to remerge all files')) | |
2345 | 2352 |
2346 ms = merge_.mergestate(repo) | 2353 ms = merge_.mergestate(repo) |
2347 m = cmdutil.match(repo, pats, opts) | 2354 m = cmdutil.match(repo, pats, opts) |
2348 | 2355 |
2349 for f in ms: | 2356 for f in ms: |
2350 if m(f): | 2357 if m(f): |
2351 if opts.get("list"): | 2358 if show: |
2352 ui.write("%s %s\n" % (ms[f].upper(), f)) | 2359 ui.write("%s %s\n" % (ms[f].upper(), f)) |
2353 elif opts.get("mark"): | 2360 elif mark: |
2354 ms.mark(f, "r") | 2361 ms.mark(f, "r") |
2355 elif opts.get("unmark"): | 2362 elif unmark: |
2356 ms.mark(f, "u") | 2363 ms.mark(f, "u") |
2357 else: | 2364 else: |
2358 wctx = repo[None] | 2365 wctx = repo[None] |
2359 mctx = wctx.parents()[-1] | 2366 mctx = wctx.parents()[-1] |
2360 ms.resolve(f, wctx, mctx) | 2367 ms.resolve(f, wctx, mctx) |
3310 _('forcibly copy over an existing managed file')), | 3317 _('forcibly copy over an existing managed file')), |
3311 ] + walkopts + dryrunopts, | 3318 ] + walkopts + dryrunopts, |
3312 _('[OPTION]... SOURCE... DEST')), | 3319 _('[OPTION]... SOURCE... DEST')), |
3313 "resolve": | 3320 "resolve": |
3314 (resolve, | 3321 (resolve, |
3315 [('l', 'list', None, _('list state of files needing merge')), | 3322 [('a', 'all', None, _('remerge all unresolved files')), |
3323 ('l', 'list', None, _('list state of files needing merge')), | |
3316 ('m', 'mark', None, _('mark files as resolved')), | 3324 ('m', 'mark', None, _('mark files as resolved')), |
3317 ('u', 'unmark', None, _('unmark files as resolved'))], | 3325 ('u', 'unmark', None, _('unmark files as resolved'))], |
3318 _('[OPTION]... [FILE]...')), | 3326 _('[OPTION]... [FILE]...')), |
3319 "revert": | 3327 "revert": |
3320 (revert, | 3328 (revert, |