Patchwork D8818: merge: improve documentation of fbid dict used for merge bid

login
register
mail settings
Submitter phabricator
Date July 25, 2020, 9:59 a.m.
Message ID <differential-rev-PHID-DREV-gwzairvcjpnlmrmqr6n6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46889/
State Superseded
Headers show

Comments

phabricator - July 25, 2020, 9:59 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8818

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -989,10 +989,12 @@ 
             )
         )
 
-        # 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 @@ 
                 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 = {}