update: clarify calculateupdate() call sites by specifying argument names
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 25 Sep 2019 14:35:08 -0700
changeset 42981 b4093d1d3b18
parent 42980 e3bb2a58af1e
child 42982 0d1272783f24
update: clarify calculateupdate() call sites by specifying argument names merge.calculateupdate() takes a lot of parameters and I get confused all the time which is which. See also b14fdf1fb615 (update: clarify update() call sites by specifying argument names, 2017-02-09). Differential Revision: https://phab.mercurial-scm.org/D6883
contrib/perf.py
hgext/convert/hg.py
hgext/histedit.py
--- a/contrib/perf.py	Wed Sep 25 17:57:16 2019 -0400
+++ b/contrib/perf.py	Wed Sep 25 14:35:08 2019 -0700
@@ -1030,8 +1030,9 @@
     def d():
         # acceptremote is True because we don't want prompts in the middle of
         # our benchmark
-        merge.calculateupdates(repo, wctx, rctx, [ancestor], False, False,
-                               acceptremote=True, followcopies=True)
+        merge.calculateupdates(repo, wctx, rctx, [ancestor], branchmerge=False,
+                               force=False, acceptremote=True,
+                               followcopies=True)
     timer(d)
     fm.end()
 
--- a/hgext/convert/hg.py	Wed Sep 25 17:57:16 2019 -0400
+++ b/hgext/convert/hg.py	Wed Sep 25 14:35:08 2019 -0700
@@ -204,12 +204,8 @@
         anc = [p1ctx.ancestor(p2ctx)]
         # Calculate what files are coming from p2
         actions, diverge, rename = mergemod.calculateupdates(
-            self.repo, p1ctx, p2ctx, anc,
-            True,  # branchmerge
-            True,  # force
-            False, # acceptremote
-            False, # followcopies
-        )
+            self.repo, p1ctx, p2ctx, anc, branchmerge=True,
+            force=True, acceptremote=False, followcopies=False)
 
         for file, (action, info, msg) in actions.iteritems():
             if source.targetfilebelongstosource(file):
--- a/hgext/histedit.py	Wed Sep 25 17:57:16 2019 -0400
+++ b/hgext/histedit.py	Wed Sep 25 14:35:08 2019 -0700
@@ -1986,11 +1986,8 @@
                 repo, wctx, c, ancs,
                 # These parameters were determined by print-debugging
                 # what happens later on inside histedit.
-                False, # branchmerge
-                False, # force
-                False, # acceptremote
-                False, # followcopies
-            )
+                branchmerge=False, force=False, acceptremote=False,
+                followcopies=False)
         except error.Abort:
             raise error.Abort(
        _("untracked files in working directory conflict with files in %s") % (