merge with stable

This commit is contained in:
Dirkjan Ochtman 2008-12-20 13:09:05 +01:00
commit 934178e495
8 changed files with 35 additions and 21 deletions

View File

@ -156,7 +156,7 @@ def archive(ui, repo, dest, **opts):
ctx = repo[opts.get('rev')] ctx = repo[opts.get('rev')]
if not ctx: if not ctx:
raise util.Abort(_('repository has no revisions')) raise util.Abort(_('no working directory: please specify a revision'))
node = ctx.node() node = ctx.node()
dest = cmdutil.make_filename(repo, dest, node) dest = cmdutil.make_filename(repo, dest, node)
if os.path.realpath(dest) == repo.root: if os.path.realpath(dest) == repo.root:
@ -2330,32 +2330,40 @@ def rename(ui, repo, *pats, **opts):
del wlock del wlock
def resolve(ui, repo, *pats, **opts): def resolve(ui, repo, *pats, **opts):
"""resolve file merges from a branch merge or update """retry file merges from a merge or update
This command will attempt to resolve unresolved merges from the This command will cleanly retry unresolved file merges using file
last update or merge command. This will use the local file revisions preserved from the last update or merge. To attempt to
revision preserved at the last update or merge to cleanly retry resolve all unresolved files, use the -a switch.
the file merge attempt. With no file or options specified, this
command will attempt to resolve all unresolved files. This command will also allow listing resolved files and manually
marking and unmarking files as resolved.
The codes used to show the status of files are: The codes used to show the status of files are:
U = unresolved U = unresolved
R = resolved R = resolved
""" """
if len([x for x in opts if opts[x]]) > 1: all, mark, unmark, show = [opts.get(o) for o in 'all mark unmark list'.split()]
if (show and (mark or unmark)) or (mark and unmark):
raise util.Abort(_("too many options specified")) raise util.Abort(_("too many options specified"))
if pats and all:
raise util.Abort(_("can't specify --all and patterns"))
if not (all or pats or show or mark or unmark):
raise util.Abort(_('no files or directories specified; '
'use --all to remerge all files'))
ms = merge_.mergestate(repo) ms = merge_.mergestate(repo)
m = cmdutil.match(repo, pats, opts) m = cmdutil.match(repo, pats, opts)
for f in ms: for f in ms:
if m(f): if m(f):
if opts.get("list"): if show:
ui.write("%s %s\n" % (ms[f].upper(), f)) ui.write("%s %s\n" % (ms[f].upper(), f))
elif opts.get("mark"): elif mark:
ms.mark(f, "r") ms.mark(f, "r")
elif opts.get("unmark"): elif unmark:
ms.mark(f, "u") ms.mark(f, "u")
else: else:
wctx = repo[None] wctx = repo[None]
@ -3315,7 +3323,8 @@ table = {
_('[OPTION]... SOURCE... DEST')), _('[OPTION]... SOURCE... DEST')),
"resolve": "resolve":
(resolve, (resolve,
[('l', 'list', None, _('list state of files needing merge')), [('a', 'all', None, _('remerge all unresolved files')),
('l', 'list', None, _('list state of files needing merge')),
('m', 'mark', None, _('mark files as resolved')), ('m', 'mark', None, _('mark files as resolved')),
('u', 'unmark', None, _('unmark files as resolved'))], ('u', 'unmark', None, _('unmark files as resolved'))],
_('[OPTION]... [FILE]...')), _('[OPTION]... [FILE]...')),

View File

@ -400,8 +400,8 @@ def run_one(test, skips, fails):
fail("output changed and returned error code %d" % ret) fail("output changed and returned error code %d" % ret)
else: else:
fail("output changed") fail("output changed")
if not nodiff: if not nodiff:
show_diff(ref_out, out) show_diff(ref_out, out)
ret = 1 ret = 1
elif ret: elif ret:
mark = '!' mark = '!'

View File

@ -60,4 +60,4 @@ rev-0.tar created
abort: unknown archive type 'bogus' abort: unknown archive type 'bogus'
% server errors % server errors
% empty repo % empty repo
abort: repository has no revisions abort: no working directory: please specify a revision

View File

@ -183,7 +183,7 @@ list of commands:
recover roll back an interrupted transaction recover roll back an interrupted transaction
remove remove the specified files on the next commit remove remove the specified files on the next commit
rename rename files; equivalent of copy + remove rename rename files; equivalent of copy + remove
resolve resolve file merges from a branch merge or update resolve retry file merges from a merge or update
revert restore individual files or dirs to an earlier state revert restore individual files or dirs to an earlier state
rollback roll back the last transaction rollback roll back the last transaction
root print the root (top) of the current working dir root print the root (top) of the current working dir
@ -246,7 +246,7 @@ list of commands:
recover roll back an interrupted transaction recover roll back an interrupted transaction
remove remove the specified files on the next commit remove remove the specified files on the next commit
rename rename files; equivalent of copy + remove rename rename files; equivalent of copy + remove
resolve resolve file merges from a branch merge or update resolve retry file merges from a merge or update
revert restore individual files or dirs to an earlier state revert restore individual files or dirs to an earlier state
rollback roll back the last transaction rollback roll back the last transaction
root print the root (top) of the current working dir root print the root (top) of the current working dir

View File

@ -74,7 +74,7 @@ list of commands:
recover roll back an interrupted transaction recover roll back an interrupted transaction
remove remove the specified files on the next commit remove remove the specified files on the next commit
rename rename files; equivalent of copy + remove rename rename files; equivalent of copy + remove
resolve resolve file merges from a branch merge or update resolve retry file merges from a merge or update
revert restore individual files or dirs to an earlier state revert restore individual files or dirs to an earlier state
rollback roll back the last transaction rollback roll back the last transaction
root print the root (top) of the current working dir root print the root (top) of the current working dir
@ -133,7 +133,7 @@ use "hg -v help" to show aliases and global options
recover roll back an interrupted transaction recover roll back an interrupted transaction
remove remove the specified files on the next commit remove remove the specified files on the next commit
rename rename files; equivalent of copy + remove rename rename files; equivalent of copy + remove
resolve resolve file merges from a branch merge or update resolve retry file merges from a merge or update
revert restore individual files or dirs to an earlier state revert restore individual files or dirs to an earlier state
rollback roll back the last transaction rollback roll back the last transaction
root print the root (top) of the current working dir root print the root (top) of the current working dir

View File

@ -322,7 +322,7 @@ hg merge
echo % keyword stays outside conflict zone echo % keyword stays outside conflict zone
cat m cat m
echo % resolve to local echo % resolve to local
HGMERGE=internal:local hg resolve HGMERGE=internal:local hg resolve -a
hg commit -m localresolve hg commit -m localresolve
cat m cat m

View File

@ -44,9 +44,12 @@ hg resolve baz
echo % after echo % after
hg resolve -l hg resolve -l
echo % resolve all echo % resolve all warning
hg resolve hg resolve
echo % resolve all
hg resolve -a
echo % after echo % after
hg resolve -l hg resolve -l

View File

@ -28,6 +28,8 @@ merging baz and foo to baz
% after % after
U bar U bar
R baz R baz
% resolve all warning
abort: no files or directories specified; use --all to remerge all files
% resolve all % resolve all
merging bar merging bar
warning: conflicts during merge. warning: conflicts during merge.