Show More
@@ -499,7 +499,7 b' class histeditaction(object):' | |||||
499 | hg.update(repo, self.state.parentctxnode, quietempty=True) |
|
499 | hg.update(repo, self.state.parentctxnode, quietempty=True) | |
500 | stats = applychanges(repo.ui, repo, rulectx, {}) |
|
500 | stats = applychanges(repo.ui, repo, rulectx, {}) | |
501 | repo.dirstate.setbranch(rulectx.branch()) |
|
501 | repo.dirstate.setbranch(rulectx.branch()) | |
502 | if stats and stats[3] > 0: |
|
502 | if stats.unresolvedcount: | |
503 | buf = repo.ui.popbuffer() |
|
503 | buf = repo.ui.popbuffer() | |
504 | repo.ui.write(buf) |
|
504 | repo.ui.write(buf) | |
505 | raise error.InterventionRequired( |
|
505 | raise error.InterventionRequired( |
@@ -525,7 +525,7 b' class rebaseruntime(object):' | |||||
525 | with ui.configoverride(overrides, 'rebase'): |
|
525 | with ui.configoverride(overrides, 'rebase'): | |
526 | stats = rebasenode(repo, rev, p1, base, self.collapsef, |
|
526 | stats = rebasenode(repo, rev, p1, base, self.collapsef, | |
527 | dest, wctx=self.wctx) |
|
527 | dest, wctx=self.wctx) | |
528 |
if stats |
|
528 | if stats.unresolvedcount > 0: | |
529 | if self.inmemory: |
|
529 | if self.inmemory: | |
530 | raise error.InMemoryMergeConflictsError() |
|
530 | raise error.InMemoryMergeConflictsError() | |
531 | else: |
|
531 | else: |
@@ -629,7 +629,7 b' def _dobackout(ui, repo, node=None, rev=' | |||||
629 | repo.setparents(op1, op2) |
|
629 | repo.setparents(op1, op2) | |
630 | dsguard.close() |
|
630 | dsguard.close() | |
631 | hg._showstats(repo, stats) |
|
631 | hg._showstats(repo, stats) | |
632 |
if stats |
|
632 | if stats.unresolvedcount: | |
633 | repo.ui.status(_("use 'hg resolve' to retry unresolved " |
|
633 | repo.ui.status(_("use 'hg resolve' to retry unresolved " | |
634 | "file merges\n")) |
|
634 | "file merges\n")) | |
635 | return 1 |
|
635 | return 1 | |
@@ -2311,7 +2311,7 b' def _dograft(ui, repo, *revs, **opts):' | |||||
2311 | finally: |
|
2311 | finally: | |
2312 | repo.ui.setconfig('ui', 'forcemerge', '', 'graft') |
|
2312 | repo.ui.setconfig('ui', 'forcemerge', '', 'graft') | |
2313 | # report any conflicts |
|
2313 | # report any conflicts | |
2314 |
if stats |
|
2314 | if stats.unresolvedcount > 0: | |
2315 | # write out state for --continue |
|
2315 | # write out state for --continue | |
2316 | nodelines = [repo[rev].hex() + "\n" for rev in revs[pos:]] |
|
2316 | nodelines = [repo[rev].hex() + "\n" for rev in revs[pos:]] | |
2317 | repo.vfs.write('graftstate', ''.join(nodelines)) |
|
2317 | repo.vfs.write('graftstate', ''.join(nodelines)) |
@@ -749,7 +749,7 b' def clone(ui, peeropts, source, dest=Non' | |||||
749 | return srcpeer, destpeer |
|
749 | return srcpeer, destpeer | |
750 |
|
750 | |||
751 | def _showstats(repo, stats, quietempty=False): |
|
751 | def _showstats(repo, stats, quietempty=False): | |
752 |
if quietempty and |
|
752 | if quietempty and stats.isempty(): | |
753 | return |
|
753 | return | |
754 | repo.ui.status(_("%d files updated, %d files merged, " |
|
754 | repo.ui.status(_("%d files updated, %d files merged, " | |
755 | "%d files removed, %d files unresolved\n") % ( |
|
755 | "%d files removed, %d files unresolved\n") % ( | |
@@ -770,9 +770,9 b' def update(repo, node, quietempty=False,' | |||||
770 | """update the working directory to node""" |
|
770 | """update the working directory to node""" | |
771 | stats = updaterepo(repo, node, False, updatecheck=updatecheck) |
|
771 | stats = updaterepo(repo, node, False, updatecheck=updatecheck) | |
772 | _showstats(repo, stats, quietempty) |
|
772 | _showstats(repo, stats, quietempty) | |
773 | if stats[3]: |
|
773 | if stats.unresolvedcount: | |
774 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) |
|
774 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) | |
775 |
return stats |
|
775 | return stats.unresolvedcount > 0 | |
776 |
|
776 | |||
777 | # naming conflict in clone() |
|
777 | # naming conflict in clone() | |
778 | _update = update |
|
778 | _update = update | |
@@ -783,7 +783,7 b' def clean(repo, node, show_stats=True, q' | |||||
783 | repo.vfs.unlinkpath('graftstate', ignoremissing=True) |
|
783 | repo.vfs.unlinkpath('graftstate', ignoremissing=True) | |
784 | if show_stats: |
|
784 | if show_stats: | |
785 | _showstats(repo, stats, quietempty) |
|
785 | _showstats(repo, stats, quietempty) | |
786 |
return stats |
|
786 | return stats.unresolvedcount > 0 | |
787 |
|
787 | |||
788 | # naming conflict in updatetotally() |
|
788 | # naming conflict in updatetotally() | |
789 | _clean = clean |
|
789 | _clean = clean | |
@@ -882,12 +882,12 b' def merge(repo, node, force=None, remind' | |||||
882 | labels=labels) |
|
882 | labels=labels) | |
883 |
|
883 | |||
884 | _showstats(repo, stats) |
|
884 | _showstats(repo, stats) | |
885 | if stats[3]: |
|
885 | if stats.unresolvedcount: | |
886 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges " |
|
886 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges " | |
887 | "or 'hg merge --abort' to abandon\n")) |
|
887 | "or 'hg merge --abort' to abandon\n")) | |
888 | elif remind and not abort: |
|
888 | elif remind and not abort: | |
889 | repo.ui.status(_("(branch merge, don't forget to commit)\n")) |
|
889 | repo.ui.status(_("(branch merge, don't forget to commit)\n")) | |
890 |
return stats |
|
890 | return stats.unresolvedcount > 0 | |
891 |
|
891 | |||
892 | def _incoming(displaychlist, subreporecurse, ui, repo, source, |
|
892 | def _incoming(displaychlist, subreporecurse, ui, repo, source, | |
893 | opts, buffered=False): |
|
893 | opts, buffered=False): |
@@ -1483,9 +1483,15 b' class updateresult(object):' | |||||
1483 | removedcount = attr.ib() |
|
1483 | removedcount = attr.ib() | |
1484 | unresolvedcount = attr.ib() |
|
1484 | unresolvedcount = attr.ib() | |
1485 |
|
1485 | |||
|
1486 | def isempty(self): | |||
|
1487 | return (not self.updatedcount and not self.mergedcount | |||
|
1488 | and not self.removedcount and not self.unresolvedcount) | |||
|
1489 | ||||
1486 | # TODO remove container emulation once consumers switch to new API. |
|
1490 | # TODO remove container emulation once consumers switch to new API. | |
1487 |
|
1491 | |||
1488 | def __getitem__(self, x): |
|
1492 | def __getitem__(self, x): | |
|
1493 | util.nouideprecwarn('access merge.update() results by name instead of ' | |||
|
1494 | 'index', '4.6', 2) | |||
1489 | if x == 0: |
|
1495 | if x == 0: | |
1490 | return self.updatedcount |
|
1496 | return self.updatedcount | |
1491 | elif x == 1: |
|
1497 | elif x == 1: | |
@@ -1498,6 +1504,8 b' class updateresult(object):' | |||||
1498 | raise IndexError('can only access items 0-3') |
|
1504 | raise IndexError('can only access items 0-3') | |
1499 |
|
1505 | |||
1500 | def __len__(self): |
|
1506 | def __len__(self): | |
|
1507 | util.nouideprecwarn('access merge.update() results by name instead of ' | |||
|
1508 | 'index', '4.6', 2) | |||
1501 | return 4 |
|
1509 | return 4 | |
1502 |
|
1510 | |||
1503 | def applyupdates(repo, actions, wctx, mctx, overwrite, labels=None): |
|
1511 | def applyupdates(repo, actions, wctx, mctx, overwrite, labels=None): | |
@@ -2164,7 +2172,8 b' def update(repo, node, branchmerge, forc' | |||||
2164 | sparse.prunetemporaryincludes(repo) |
|
2172 | sparse.prunetemporaryincludes(repo) | |
2165 |
|
2173 | |||
2166 | if not partial: |
|
2174 | if not partial: | |
2167 |
repo.hook('update', parent1=xp1, parent2=xp2, |
|
2175 | repo.hook('update', parent1=xp1, parent2=xp2, | |
|
2176 | error=stats.unresolvedcount) | |||
2168 | return stats |
|
2177 | return stats | |
2169 |
|
2178 | |||
2170 | def graft(repo, ctx, pctx, labels, keepparent=False): |
|
2179 | def graft(repo, ctx, pctx, labels, keepparent=False): |
General Comments 0
You need to be logged in to leave comments.
Login now