<div dir="auto">Wow, Phabricator decides to send the email almost two full days after the review was created. Anyone knows what's going on?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 4, 2019, 09:13 martinvonz (Martin von Zweigbergk) <<a href="mailto:phabricator@mercurial-scm.org">phabricator@mercurial-scm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">martinvonz created this revision.<br>
Herald added a subscriber: mercurial-devel.<br>
Herald added a reviewer: hg-reviewers.<br>
<br>
REPOSITORY<br>
  rHG Mercurial<br>
<br>
REVISION DETAIL<br>
  <a href="https://phab.mercurial-scm.org/D6602" rel="noreferrer noreferrer" target="_blank">https://phab.mercurial-scm.org/D6602</a><br>
<br>
AFFECTED FILES<br>
  mercurial/copies.py<br>
<br>
CHANGE DETAILS<br>
<br>
diff --git a/mercurial/copies.py b/mercurial/copies.py<br>
--- a/mercurial/copies.py<br>
+++ b/mercurial/copies.py<br>
@@ -107,13 +107,13 @@<br>
     # This only occurs when a is a descendent of b or visa-versa.<br>
     return min(limit, a, b)<br>
<br>
-def _chainandfilter(src, dst, a, b):<br>
-    """chain two sets of copies 'a' and 'b' and filter result"""<br>
+def _filter(src, dst, t):<br>
+    """filters out invalid copies after chaining"""<br>
<br>
-    # When chaining copies in 'a' (from 'src' via some other commit 'mid') with<br>
-    # copies in 'b' (from 'mid' to 'dst'), we can get the different cases in the<br>
-    # following table (not including trivial cases). For example, case 2 is<br>
-    # where a file existed in 'src' and remained under that name in 'mid' and<br>
+    # When _chain()'ing copies in 'a' (from 'src' via some other commit 'mid')<br>
+    # with copies in 'b' (from 'mid' to 'dst'), we can get the different cases<br>
+    # in the following table (not including trivial cases). For example, case 2<br>
+    # is where a file existed in 'src' and remained under that name in 'mid' and<br>
     # then was renamed between 'mid' and 'dst'.<br>
     #<br>
     # case src mid dst result<br>
@@ -129,12 +129,6 @@<br>
     # between 5 and 6, so it includes all cases in its result.<br>
     # Cases 1, 3, and 5 are then removed by _filter().<br>
<br>
-    t = _chain(a, b)<br>
-    _filter(src, dst, t)<br>
-    return t<br>
-<br>
-def _filter(src, dst, t):<br>
-    """filters out invalid copies after chaining"""<br>
     for k, v in list(t.items()):<br>
         # remove copies from files that didn't exist<br>
         if v not in src:<br>
@@ -326,7 +320,8 @@<br>
     if b.rev() is None:<br>
         cm = _committedforwardcopies(a, b.p1(), match)<br>
         # combine copies from dirstate if necessary<br>
-        copies = _chainandfilter(a, b, cm, _dirstatecopies(b._repo, match))<br>
+        copies = _chain(cm, _dirstatecopies(b._repo, match))<br>
+        _filter(a, b, copies)<br>
     else:<br>
         copies  = _committedforwardcopies(a, b, match)<br>
     return copies<br>
@@ -376,8 +371,9 @@<br>
     else:<br>
         if debug:<br>
             repo.ui.debug('debug.copies: search mode: combined\n')<br>
-        copies = _chainandfilter(x, y, _backwardrenames(x, a, match=match),<br>
-                                 _forwardcopies(a, y, match=match))<br>
+        copies = _chain(_backwardrenames(x, a, match=match),<br>
+                        _forwardcopies(a, y, match=match))<br>
+        _filter(x, y, copies)<br>
     return copies<br>
<br>
 def mergecopies(repo, c1, c2, base):<br>
<br>
<br>
<br>
To: martinvonz, #hg-reviewers<br>
Cc: mercurial-devel<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank" rel="noreferrer">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div>