mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
resolve: port to generic templater
Test output changes because color labels are applied separately.
This commit is contained in:
parent
c9de8bb4f9
commit
34b5e5774a
@ -5225,7 +5225,7 @@ def rename(ui, repo, *pats, **opts):
|
||||
('m', 'mark', None, _('mark files as resolved')),
|
||||
('u', 'unmark', None, _('mark files as unresolved')),
|
||||
('n', 'no-status', None, _('hide status prefix'))]
|
||||
+ mergetoolopts + walkopts,
|
||||
+ mergetoolopts + walkopts + formatteropts,
|
||||
_('[OPTION]... [FILE]...'),
|
||||
inferrepo=True)
|
||||
def resolve(ui, repo, *pats, **opts):
|
||||
@ -5278,17 +5278,17 @@ def resolve(ui, repo, *pats, **opts):
|
||||
hint=('use --all to remerge all files'))
|
||||
|
||||
if show:
|
||||
fm = ui.formatter('resolve', opts)
|
||||
ms = mergemod.mergestate(repo)
|
||||
m = scmutil.match(repo[None], pats, opts)
|
||||
for f in ms:
|
||||
if not m(f):
|
||||
continue
|
||||
if nostatus:
|
||||
ui.write("%s\n" % f)
|
||||
else:
|
||||
ui.write("%s %s\n" % (ms[f].upper(), f),
|
||||
label='resolve.' +
|
||||
{'u': 'unresolved', 'r': 'resolved'}[ms[f]])
|
||||
l = 'resolve.' + {'u': 'unresolved', 'r': 'resolved'}[ms[f]]
|
||||
fm.startitem()
|
||||
fm.condwrite(not nostatus, 'status', '%s ', ms[f].upper(), label=l)
|
||||
fm.write('path', '%s\n', f, label=l)
|
||||
fm.end()
|
||||
return 0
|
||||
|
||||
wlock = repo.wlock()
|
||||
|
@ -278,7 +278,7 @@ Show all commands + options
|
||||
phase: public, draft, secret, force, rev
|
||||
recover:
|
||||
rename: after, force, include, exclude, dry-run
|
||||
resolve: all, list, mark, unmark, no-status, tool, include, exclude
|
||||
resolve: all, list, mark, unmark, no-status, tool, include, exclude, template
|
||||
revert: all, date, rev, no-backup, include, exclude, dry-run
|
||||
rollback: dry-run, force
|
||||
root:
|
||||
|
@ -43,6 +43,10 @@ resolve -l should contain unresolved entries
|
||||
U file1
|
||||
U file2
|
||||
|
||||
$ hg resolve -l --no-status
|
||||
file1
|
||||
file2
|
||||
|
||||
resolving an unknown path should emit a warning, but not for -l
|
||||
|
||||
$ hg resolve -m does-not-exist
|
||||
@ -60,6 +64,18 @@ resolve -l should show resolved file as resolved
|
||||
R file1
|
||||
U file2
|
||||
|
||||
$ hg resolve -l -Tjson
|
||||
[
|
||||
{
|
||||
"path": "file1",
|
||||
"status": "R"
|
||||
},
|
||||
{
|
||||
"path": "file2",
|
||||
"status": "U"
|
||||
}
|
||||
]
|
||||
|
||||
resolve -m without paths should mark all resolved
|
||||
|
||||
$ hg resolve -m
|
||||
@ -70,6 +86,10 @@ resolve -l should be empty after commit
|
||||
|
||||
$ hg resolve -l
|
||||
|
||||
$ hg resolve -l -Tjson
|
||||
[
|
||||
]
|
||||
|
||||
resolve --all should abort when no merge in progress
|
||||
|
||||
$ hg resolve --all
|
||||
|
@ -338,8 +338,8 @@ test 'resolve -l'
|
||||
hg resolve with one unresolved, one resolved:
|
||||
|
||||
$ hg resolve --color=always -l
|
||||
\x1b[0;31;1mU a\x1b[0m (esc)
|
||||
\x1b[0;32;1mR b\x1b[0m (esc)
|
||||
\x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc)
|
||||
\x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc)
|
||||
|
||||
color coding of error message with current availability of curses
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user