comparison mercurial/copies.py @ 43020:f3bcae1e9e23

copies: expand the logic of usechangesetcentricalgo Using intermediate variable is clearer and will make is simple to expand the logic. Differential Revision: https://phab.mercurial-scm.org/D6930
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 26 Sep 2019 23:43:32 +0200
parents 3cffc7bbec26
children 2372284d9457
comparison
equal deleted inserted replaced
43019:2cc453284d5c 43020:f3bcae1e9e23
180 mb = b.manifest() 180 mb = b.manifest()
181 return mb.filesnotin(ma, match=match) 181 return mb.filesnotin(ma, match=match)
182 182
183 def usechangesetcentricalgo(repo): 183 def usechangesetcentricalgo(repo):
184 """Checks if we should use changeset-centric copy algorithms""" 184 """Checks if we should use changeset-centric copy algorithms"""
185 return (repo.ui.config('experimental', 'copies.read-from') in 185 readfrom = repo.ui.config('experimental', 'copies.read-from')
186 ('changeset-only', 'compatibility')) 186 changesetsource = ('changeset-only', 'compatibility')
187 return readfrom in changesetsource
187 188
188 def _committedforwardcopies(a, b, base, match): 189 def _committedforwardcopies(a, b, base, match):
189 """Like _forwardcopies(), but b.rev() cannot be None (working copy)""" 190 """Like _forwardcopies(), but b.rev() cannot be None (working copy)"""
190 # files might have to be traced back to the fctx parent of the last 191 # files might have to be traced back to the fctx parent of the last
191 # one-side-only changeset, but not further back than that 192 # one-side-only changeset, but not further back than that