##// END OF EJS Templates
resolve: require -a switch to resolve all files...
Matt Mackall -
r7527:5a14a8f3 default
parent child Browse files
Show More
@@ -2340,19 +2340,26 b' def resolve(ui, repo, *pats, **opts):'
2340 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 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 2353 ms = merge_.mergestate(repo)
2347 2354 m = cmdutil.match(repo, pats, opts)
2348 2355
2349 2356 for f in ms:
2350 2357 if m(f):
2351 if opts.get("list"):
2358 if show:
2352 2359 ui.write("%s %s\n" % (ms[f].upper(), f))
2353 elif opts.get("mark"):
2360 elif mark:
2354 2361 ms.mark(f, "r")
2355 elif opts.get("unmark"):
2362 elif unmark:
2356 2363 ms.mark(f, "u")
2357 2364 else:
2358 2365 wctx = repo[None]
@@ -3312,7 +3319,8 b' table = {'
3312 3319 _('[OPTION]... SOURCE... DEST')),
3313 3320 "resolve":
3314 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 3324 ('m', 'mark', None, _('mark files as resolved')),
3317 3325 ('u', 'unmark', None, _('unmark files as resolved'))],
3318 3326 _('[OPTION]... [FILE]...')),
@@ -322,7 +322,7 b' hg merge'
322 322 echo % keyword stays outside conflict zone
323 323 cat m
324 324 echo % resolve to local
325 HGMERGE=internal:local hg resolve
325 HGMERGE=internal:local hg resolve -a
326 326 hg commit -m localresolve
327 327 cat m
328 328
@@ -44,8 +44,11 b' hg resolve baz'
44 44 echo % after
45 45 hg resolve -l
46 46
47 echo % resolve all warning
48 hg resolve
49
47 50 echo % resolve all
48 hg resolve
51 hg resolve -a
49 52
50 53 echo % after
51 54 hg resolve -l
@@ -28,6 +28,8 b' merging baz and foo to baz'
28 28 % after
29 29 U bar
30 30 R baz
31 % resolve all warning
32 abort: no files or directories specified; use --all to remerge all files
31 33 % resolve all
32 34 merging bar
33 35 warning: conflicts during merge.
General Comments 0
You need to be logged in to leave comments. Login now