# HG changeset patch # User Martin von Zweigbergk # Date 1425074550 28800 # Node ID 3a3806fe3ddfd6180998504c5990cb362ce35ae6 # Parent cd66080ef6d4889d513ea0571defa8dd69ae71ab copies: replace _nonoverlap() by calls to manifestdict.filesnotin() Now that we have manifestdict.filesnotin(), we can write _nonoverlap() in terms of that method instead, enabling future speedups when filesnotin() gets optimized, and perhaps making the code a little clearer at the same time. diff -r cd66080ef6d4 -r 3a3806fe3ddf mercurial/copies.py --- a/mercurial/copies.py Fri Feb 27 13:57:37 2015 -0800 +++ b/mercurial/copies.py Fri Feb 27 14:02:30 2015 -0800 @@ -8,10 +8,6 @@ import util import heapq -def _nonoverlap(d1, d2, d3): - "Return list of elements in d1 not in d2 or d3" - return sorted([d for d in d1 if d not in d3 and d not in d2]) - def _dirname(f): s = f.rfind("/") if s == -1: @@ -218,8 +214,10 @@ This is its own function so extensions can easily wrap this call to see what files mergecopies is about to process. """ - u1 = _nonoverlap(m1, m2, ma) - u2 = _nonoverlap(m2, m1, ma) + addedinm1 = m1.filesnotin(ma) + addedinm2 = m2.filesnotin(ma) + u1 = sorted(addedinm1 - addedinm2) + u2 = sorted(addedinm2 - addedinm1) if u1: repo.ui.debug(" unmatched files in local:\n %s\n"