Patchwork [7,of,9] merge: improve documentation of fbid dict used for merge bid

login
register
mail settings
Submitter Pulkit Goyal
Date July 30, 2020, 6:53 a.m.
Message ID <fd4d429e5030115e63be.1596092009@workspace>
Download mbox | patch
Permalink /patch/46945/
State New
Headers show

Comments

Pulkit Goyal - July 30, 2020, 6:53 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1595583920 -19800
#      Fri Jul 24 15:15:20 2020 +0530
# Node ID fd4d429e5030115e63be709471e2ffe6b04a0919
# Parent  90aa9c3e8a0ee8b4ad7e807922f6d6a7d132328b
# EXP-Topic merge-refactor
merge: improve documentation of fbid dict used for merge bid

I improved the comments explaning what the dict contains meanwhile organizing
the comment structure which prevents some confusion.

Due to formatting issues, the empty dict was wrapped in `()` which might decieve
in thinking that it's a tuple of dict until you decide to find a comma.

Differential Revision: https://phab.mercurial-scm.org/D8818

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -989,10 +989,12 @@  def calculateupdates(
             )
         )
 
-        # Call for bids
-        fbids = (
-            {}
-        )  # mapping filename to bids (action method to list af actions)
+        # mapping filename to bids (action method to list af actions)
+        # {FILENAME1 : BID1, FILENAME2 : BID2}
+        # BID is another dictionary which contains
+        # mapping of following form:
+        # {ACTION_X : [info, ..], ACTION_Y : [info, ..]}
+        fbids = {}
         diverge, renamedelete = None, None
         for ancestor in ancestors:
             repo.ui.note(_(b'\ncalculating bids for ancestor %s\n') % ancestor)
@@ -1033,6 +1035,7 @@  def calculateupdates(
                 else:
                     fbids[f] = {m: [a]}
 
+        # Call for bids
         # Pick the best bid for each file
         repo.ui.note(_(b'\nauction for merging merge bids\n'))
         actions = {}