##// END OF EJS Templates
merge: add --tool argument to merge and resolve...
Steve Borho -
r12750:05bd2658 default
parent child Browse files
Show More
@@ -2563,11 +2563,17 b' def merge(ui, repo, node=None, **opts):'
2563 2563 updates to the repository are allowed. The next commit will have
2564 2564 two parents.
2565 2565
2566 ``--tool`` can be used to specify the merge tool used for file
2567 merges. It overrides the HGMERGE environment variable and your
2568 configuration files.
2569
2566 2570 If no revision is specified, the working directory's parent is a
2567 2571 head revision, and the current branch contains exactly one other
2568 2572 head, the other head is merged with by default. Otherwise, an
2569 2573 explicit revision with which to merge with must be provided.
2570 2574
2575 :hg:`resolve` must be used to resolve unresolved files.
2576
2571 2577 To undo an uncommitted merge, use :hg:`update --clean .` which
2572 2578 will check out a clean copy of the original merge parent, losing
2573 2579 all changes.
@@ -2580,6 +2586,12 b' def merge(ui, repo, node=None, **opts):'
2580 2586 if not node:
2581 2587 node = opts.get('rev')
2582 2588
2589 t = opts.get('tool')
2590 if t:
2591 if 'HGMERGE' in os.environ:
2592 os.environ['HGMERGE'] = t
2593 ui.setconfig('ui', 'merge', t)
2594
2583 2595 if not node:
2584 2596 branch = repo.changectx(None).branch()
2585 2597 bheads = repo.branchheads(branch)
@@ -2932,10 +2944,12 b' def resolve(ui, repo, *pats, **opts):'
2932 2944
2933 2945 The resolve command can be used in the following ways:
2934 2946
2935 - :hg:`resolve FILE...`: attempt to re-merge the specified files,
2936 discarding any previous merge attempts. Re-merging is not
2947 - :hg:`resolve [--tool] FILE...`: attempt to re-merge the specified
2948 files, discarding any previous merge attempts. Re-merging is not
2937 2949 performed for files already marked as resolved. Use ``--all/-a``
2938 to selects all unresolved files.
2950 to selects all unresolved files. ``--tool`` can be used to specify
2951 the merge tool used for the given files. It overrides the HGMERGE
2952 environment variable and your configuration files.
2939 2953
2940 2954 - :hg:`resolve -m [FILE]`: mark a file as having been resolved
2941 2955 (e.g. after having manually fixed-up the files). The default is
@@ -2965,6 +2979,12 b' def resolve(ui, repo, *pats, **opts):'
2965 2979 raise util.Abort(_('no files or directories specified; '
2966 2980 'use --all to remerge all files'))
2967 2981
2982 t = opts.get('tool')
2983 if t:
2984 if 'HGMERGE' in os.environ:
2985 os.environ['HGMERGE'] = t
2986 ui.setconfig('ui', 'merge', t)
2987
2968 2988 ms = mergemod.mergestate(repo)
2969 2989 m = cmdutil.match(repo, pats, opts)
2970 2990 ret = 0
@@ -4270,6 +4290,7 b' table = {'
4270 4290 "^merge":
4271 4291 (merge,
4272 4292 [('f', 'force', None, _('force a merge with outstanding changes')),
4293 ('t', 'tool', '', _('specify merge tool')),
4273 4294 ('r', 'rev', '',
4274 4295 _('revision to merge'), _('REV')),
4275 4296 ('P', 'preview', None,
@@ -4338,6 +4359,7 b' table = {'
4338 4359 ('l', 'list', None, _('list state of files needing merge')),
4339 4360 ('m', 'mark', None, _('mark files as resolved')),
4340 4361 ('u', 'unmark', None, _('mark files as unresolved')),
4362 ('t', 'tool', '', _('specify merge tool')),
4341 4363 ('n', 'no-status', None, _('hide status prefix'))]
4342 4364 + walkopts,
4343 4365 _('[OPTION]... [FILE]...')),
@@ -186,7 +186,7 b' Show all commands + options'
186 186 forget: include, exclude
187 187 init: ssh, remotecmd
188 188 log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, branch, prune, patch, git, limit, no-merges, stat, style, template, include, exclude
189 merge: force, rev, preview
189 merge: force, tool, rev, preview
190 190 pull: update, force, rev, branch, ssh, remotecmd
191 191 push: force, rev, branch, new-branch, ssh, remotecmd
192 192 remove: after, force, include, exclude
@@ -236,7 +236,7 b' Show all commands + options'
236 236 paths:
237 237 recover:
238 238 rename: after, force, include, exclude, dry-run
239 resolve: all, list, mark, unmark, no-status, include, exclude
239 resolve: all, list, mark, unmark, tool, no-status, include, exclude
240 240 revert: all, date, rev, no-backup, include, exclude, dry-run
241 241 rollback: dry-run
242 242 root:
General Comments 0
You need to be logged in to leave comments. Login now