comparison mercurial/copies.py @ 43784:995066c41bb2

copies: expand `_chain` variable name to make the function easier to read This came up while explaining what the function is about. I find the function easier to follow that way.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 13 Nov 2019 20:42:08 +0100
parents bbd7172bc3df
children 3b039e43a1e6
comparison
equal deleted inserted replaced
43783:bbd7172bc3df 43784:995066c41bb2
61 # remove copies to files that were then removed 61 # remove copies to files that were then removed
62 elif k not in dst: 62 elif k not in dst:
63 del t[k] 63 del t[k]
64 64
65 65
66 def _chain(a, b): 66 def _chain(prefix, suffix):
67 """chain two sets of copies 'a' and 'b'""" 67 """chain two sets of copies 'prefix' and 'suffix'"""
68 t = a.copy() 68 result = prefix.copy()
69 for k, v in pycompat.iteritems(b): 69 for key, value in pycompat.iteritems(suffix):
70 t[k] = a.get(v, v) 70 result[key] = prefix.get(value, value)
71 return t 71 return result
72 72
73 73
74 def _tracefile(fctx, am, basemf): 74 def _tracefile(fctx, am, basemf):
75 """return file context that is the ancestor of fctx present in ancestor 75 """return file context that is the ancestor of fctx present in ancestor
76 manifest am 76 manifest am