changeset 43022: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 2cc453284d5c
children 008e74b34fb7
files mercurial/copies.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Mon Sep 30 00:01:58 2019 +0200
+++ b/mercurial/copies.py	Thu Sep 26 23:43:32 2019 +0200
@@ -182,8 +182,9 @@
 
 def usechangesetcentricalgo(repo):
     """Checks if we should use changeset-centric copy algorithms"""
-    return (repo.ui.config('experimental', 'copies.read-from') in
-            ('changeset-only', 'compatibility'))
+    readfrom = repo.ui.config('experimental', 'copies.read-from')
+    changesetsource = ('changeset-only', 'compatibility')
+    return readfrom in changesetsource
 
 def _committedforwardcopies(a, b, base, match):
     """Like _forwardcopies(), but b.rev() cannot be None (working copy)"""