[PATCH 3 of 4] copies: calculate 'bothnew' from manifestdict.filesnotin()

Martin von Zweigbergk martinvonz at google.com
Fri Feb 27 16:46:51 CST 2015


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1425074581 28800
#      Fri Feb 27 14:03:01 2015 -0800
# Node ID b3bcf58446fdebf3672edbbc55c24509e549eb22
# Parent  89f810fb00184d3a1dd49412d0c3256a596ddca8
copies: calculate 'bothnew' from manifestdict.filesnotin()

In the same spirit as the previous change, let's now calculate the
'bothnew' variable using manifestdict.filesnotin().5D

diff -r 89f810fb0018 -r b3bcf58446fd mercurial/copies.py
--- a/mercurial/copies.py	Fri Feb 27 14:02:30 2015 -0800
+++ b/mercurial/copies.py	Fri Feb 27 14:03:01 2015 -0800
@@ -302,7 +302,9 @@
         else:
             diverge2.update(fl) # reverse map for below
 
-    bothnew = sorted([d for d in m1 if d in m2 and d not in ma])
+    addedinm1 = m1.filesnotin(ma)
+    addedinm2 = m2.filesnotin(ma)
+    bothnew = sorted(addedinm1 & addedinm2)
     if bothnew:
         repo.ui.debug("  unmatched files new in both:\n   %s\n"
                       % "\n   ".join(bothnew))


More information about the Mercurial-devel mailing list