Mercurial > hg-stable
changeset 2980:54d85098fb82
merge: make unresolved a counter
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 22 Aug 2006 19:39:54 -0500 |
parents | 92a0c2200e41 |
children | 1b738357bba9 |
files | mercurial/merge.py |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/merge.py Tue Aug 22 19:32:16 2006 -0500 +++ b/mercurial/merge.py Tue Aug 22 19:39:54 2006 -0500 @@ -233,8 +233,7 @@ repo.hook('preupdate', throw=True, parent1=xp1, parent2=xxp2) # update files - unresolved = [] - updated, merged, removed = 0, 0, 0 + updated, merged, removed, unresolved = 0, 0, 0, 0 files = action.keys() files.sort() for f in files: @@ -254,7 +253,7 @@ elif other: repo.ui.status(_("merging %s\n") % f) if merge3(repo, f, my, other, xp1, xp2): - unresolved.append(f) + unresolved += 1 util.set_exec(repo.wjoin(f), flag) merged += 1 else: @@ -299,9 +298,9 @@ if show_stats: stats = ((updated, _("updated")), - (merged - len(unresolved), _("merged")), + (merged - unresolved, _("merged")), (removed, _("removed")), - (len(unresolved), _("unresolved"))) + (unresolved, _("unresolved"))) note = ", ".join([_("%d files %s") % s for s in stats]) repo.ui.status("%s\n" % note) if not partial: @@ -319,6 +318,6 @@ repo.ui.status(_("There are unresolved merges with" " locally modified files.\n")) - repo.hook('update', parent1=xp1, parent2=xxp2, error=len(unresolved)) - return len(unresolved) + repo.hook('update', parent1=xp1, parent2=xxp2, error=unresolved) + return unresolved