##// 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 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]
@@ -3312,7 +3319,8 b' table = {'
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]...')),
@@ -322,7 +322,7 b' hg merge'
322 echo % keyword stays outside conflict zone
322 echo % keyword stays outside conflict zone
323 cat m
323 cat m
324 echo % resolve to local
324 echo % resolve to local
325 HGMERGE=internal:local hg resolve
325 HGMERGE=internal:local hg resolve -a
326 hg commit -m localresolve
326 hg commit -m localresolve
327 cat m
327 cat m
328
328
@@ -44,8 +44,11 b' hg resolve baz'
44 echo % after
44 echo % after
45 hg resolve -l
45 hg resolve -l
46
46
47 echo % resolve all warning
48 hg resolve
49
47 echo % resolve all
50 echo % resolve all
48 hg resolve
51 hg resolve -a
49
52
50 echo % after
53 echo % after
51 hg resolve -l
54 hg resolve -l
@@ -28,6 +28,8 b' merging baz and foo to baz'
28 % after
28 % after
29 U bar
29 U bar
30 R baz
30 R baz
31 % resolve all warning
32 abort: no files or directories specified; use --all to remerge all files
31 % resolve all
33 % resolve all
32 merging bar
34 merging bar
33 warning: conflicts during merge.
35 warning: conflicts during merge.
General Comments 0
You need to be logged in to leave comments. Login now