mercurial/manifest.py
branchstable
changeset 42376 89c0c8edc9d4
parent 41965 e4ac7e63c213
child 42377 0546ead39a7e
--- a/mercurial/manifest.py	Mon May 20 10:08:28 2019 +0200
+++ b/mercurial/manifest.py	Thu May 23 21:39:19 2019 -0400
@@ -35,6 +35,9 @@
 parsers = policy.importmod(r'parsers')
 propertycache = util.propertycache
 
+# Allow tests to more easily test the alternate path in manifestdict.fastdelta()
+FASTDELTA_TEXTDIFF_THRESHOLD = 1000
+
 def _parse(data):
     # This method does a little bit of excessive-looking
     # precondition checking. This is so that the behavior of this
@@ -558,7 +561,7 @@
         addbuf = util.buffer(base)
 
         changes = list(changes)
-        if len(changes) < 1000:
+        if len(changes) < FASTDELTA_TEXTDIFF_THRESHOLD:
             # start with a readonly loop that finds the offset of
             # each line and creates the deltas
             for f, todelete in changes: