diff mercurial/merge.py @ 23524:a1a7c94def6d

merge: don't report progress for dr/rd actions It is easier to reason about certain algorithms in terms of a file->action mapping than the current action->list-of-files. Bid merge is already written this way (but with a list of actions per file), and largefiles' overridecalculateupdates() will also benefit. However, that requires us to have at most one action per file. That requirement is currently violated by 'dr' (divergent rename) and 'rd' (rename and delete) actions, which can exist for the same file as some other action. These actions are only used for displaying warnings to the user; they don't change anything in the working copy or the dirstate. In this way, they are similar to the 'k' (keep) action. However, they are even less action-like than 'k' is: 'k' at least describes what to do with the file ("do nothing"), while 'dr' and 'rd' or only annotations for files for which there may exist other, "real" actions. As a first step towards separating these acitons out, stop including them in the progress output, just like we already exclude the 'k' action.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 05 Dec 2014 16:13:26 -0800
parents 208ec8ca7c79
children 5126d7718d7c
line wrap: on
line diff
--- a/mercurial/merge.py	Wed Dec 10 10:32:51 2014 +0100
+++ b/mercurial/merge.py	Fri Dec 05 16:13:26 2014 -0800
@@ -742,7 +742,8 @@
             audit(f)
             util.unlinkpath(repo.wjoin(f))
 
-    numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
+    numupdates = sum(len(l) for m, l in actions.items()
+                     if m not in ('k', 'dr', 'rd'))
 
     if [a for a in actions['r'] if a[0] == '.hgsubstate']:
         subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
@@ -825,9 +826,6 @@
 
     # divergent renames
     for f, args, msg in actions['dr']:
-        repo.ui.debug(" %s: %s -> dr\n" % (f, msg))
-        z += 1
-        progress(_updating, z, item=f, total=numupdates, unit=_files)
         fl, = args
         repo.ui.warn(_("note: possible conflict - %s was renamed "
                        "multiple times to:\n") % f)
@@ -836,9 +834,6 @@
 
     # rename and delete
     for f, args, msg in actions['rd']:
-        repo.ui.debug(" %s: %s -> rd\n" % (f, msg))
-        z += 1
-        progress(_updating, z, item=f, total=numupdates, unit=_files)
         fl, = args
         repo.ui.warn(_("note: possible conflict - %s was deleted "
                        "and renamed to:\n") % f)