comparison mercurial/commands.py @ 11837:b9d316bcc013

Merge with stable
author Martin Geisler <mg@aragost.com>
date Fri, 13 Aug 2010 10:28:59 +0200
parents 3cdd6fdc3d9e 53fdc0989047
children 73112cb2a6d7
comparison
equal deleted inserted replaced
11833:7c9beccb0533 11837:b9d316bcc013
2946 return cmdutil.copy(ui, repo, pats, opts, rename=True) 2946 return cmdutil.copy(ui, repo, pats, opts, rename=True)
2947 finally: 2947 finally:
2948 wlock.release() 2948 wlock.release()
2949 2949
2950 def resolve(ui, repo, *pats, **opts): 2950 def resolve(ui, repo, *pats, **opts):
2951 """various operations to help finish a merge 2951 """redo merges or set/view the merge status of files
2952 2952
2953 This command includes several actions that are often useful while 2953 Merges with unresolved conflicts are often the result of
2954 performing a merge, after running ``merge`` but before running 2954 non-interactive merging using the ``internal:merge`` hgrc setting,
2955 ``commit``. (It is only meaningful if your working directory has 2955 or a command-line merge tool like ``diff3``. The resolve command
2956 two parents.) It is most relevant for merges with unresolved 2956 is used to manage the files involved in a merge, after :hg:`merge`
2957 conflicts, which are typically a result of non-interactive merging with 2957 has been run, and before :hg:`commit` is run (i.e. the working
2958 ``internal:merge`` or a command-line merge tool like ``diff3``. 2958 directory must have two parents).
2959 2959
2960 The available actions are: 2960 The resolve command can be used in the following ways:
2961 2961
2962 1) list files that were merged with conflicts (U, for unresolved) 2962 - :hg:`resolve FILE...`: attempt to re-merge the specified files,
2963 and without conflicts (R, for resolved): ``hg resolve -l`` 2963 discarding any previous merge attempts. Re-merging is not
2964 (this is like ``status`` for merges) 2964 performed for files already marked as resolved. Use ``--all/-a``
2965 2) record that you have resolved conflicts in certain files: 2965 to selects all unresolved files.
2966 ``hg resolve -m [file ...]`` (default: mark all unresolved files) 2966
2967 3) forget that you have resolved conflicts in certain files: 2967 - :hg:`resolve -m [FILE]`: mark a file as having been resolved
2968 ``hg resolve -u [file ...]`` (default: unmark all resolved files) 2968 (e.g. after having manually fixed-up the files). The default is
2969 4) discard your current attempt(s) at resolving conflicts and 2969 to mark all unresolved files.
2970 restart the merge from scratch: ``hg resolve file...`` 2970
2971 (or ``-a`` for all unresolved files) 2971 - :hg:`resolve -u [FILE]...`: mark a file as unresolved. The
2972 2972 default is to mark all resolved files.
2973 Note that Mercurial will not let you commit files with unresolved merge 2973
2974 conflicts. You must use ``hg resolve -m ...`` before you can commit 2974 - :hg:`resolve -l`: list files which had or still have conflicts.
2975 after a conflicting merge. 2975 In the printed list, ``U`` = unresolved and ``R`` = resolved.
2976
2977 Note that Mercurial will not let you commit files with unresolved
2978 merge conflicts. You must use :hg:`resolve -m ...` before you can
2979 commit after a conflicting merge.
2976 2980
2977 Returns 0 on success, 1 if any files fail a resolve attempt. 2981 Returns 0 on success, 1 if any files fail a resolve attempt.
2978 """ 2982 """
2979 2983
2980 all, mark, unmark, show, nostatus = \ 2984 all, mark, unmark, show, nostatus = \
4338 "resolve": 4342 "resolve":
4339 (resolve, 4343 (resolve,
4340 [('a', 'all', None, _('select all unresolved files')), 4344 [('a', 'all', None, _('select all unresolved files')),
4341 ('l', 'list', None, _('list state of files needing merge')), 4345 ('l', 'list', None, _('list state of files needing merge')),
4342 ('m', 'mark', None, _('mark files as resolved')), 4346 ('m', 'mark', None, _('mark files as resolved')),
4343 ('u', 'unmark', None, _('unmark files as resolved')), 4347 ('u', 'unmark', None, _('mark files as unresolved')),
4344 ('n', 'no-status', None, _('hide status prefix'))] 4348 ('n', 'no-status', None, _('hide status prefix'))]
4345 + walkopts, 4349 + walkopts,
4346 _('[OPTION]... [FILE]...')), 4350 _('[OPTION]... [FILE]...')),
4347 "revert": 4351 "revert":
4348 (revert, 4352 (revert,