Mercurial > hg
comparison mercurial/merge.py @ 45280:98218c83242f
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
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 24 Jul 2020 15:15:20 +0530 |
parents | f4a2b329717b |
children | fe2040abb183 |
comparison
equal
deleted
inserted
replaced
45279:f4a2b329717b | 45280:98218c83242f |
---|---|
987 mctx, | 987 mctx, |
988 _(b' and ').join(pycompat.bytestr(anc) for anc in ancestors), | 988 _(b' and ').join(pycompat.bytestr(anc) for anc in ancestors), |
989 ) | 989 ) |
990 ) | 990 ) |
991 | 991 |
992 # Call for bids | 992 # mapping filename to bids (action method to list af actions) |
993 fbids = ( | 993 # {FILENAME1 : BID1, FILENAME2 : BID2} |
994 {} | 994 # BID is another dictionary which contains |
995 ) # mapping filename to bids (action method to list af actions) | 995 # mapping of following form: |
996 # {ACTION_X : [info, ..], ACTION_Y : [info, ..]} | |
997 fbids = {} | |
996 diverge, renamedelete = None, None | 998 diverge, renamedelete = None, None |
997 for ancestor in ancestors: | 999 for ancestor in ancestors: |
998 repo.ui.note(_(b'\ncalculating bids for ancestor %s\n') % ancestor) | 1000 repo.ui.note(_(b'\ncalculating bids for ancestor %s\n') % ancestor) |
999 mresult1 = manifestmerge( | 1001 mresult1 = manifestmerge( |
1000 repo, | 1002 repo, |
1031 else: | 1033 else: |
1032 d[m] = [a] | 1034 d[m] = [a] |
1033 else: | 1035 else: |
1034 fbids[f] = {m: [a]} | 1036 fbids[f] = {m: [a]} |
1035 | 1037 |
1038 # Call for bids | |
1036 # Pick the best bid for each file | 1039 # Pick the best bid for each file |
1037 repo.ui.note(_(b'\nauction for merging merge bids\n')) | 1040 repo.ui.note(_(b'\nauction for merging merge bids\n')) |
1038 actions = {} | 1041 actions = {} |
1039 for f, bids in sorted(fbids.items()): | 1042 for f, bids in sorted(fbids.items()): |
1040 # bids is a mapping from action method to list af actions | 1043 # bids is a mapping from action method to list af actions |