Patchwork D7977: copies: extract function for finding directory renames

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2020, 10:02 p.m.
Message ID <ad53a50f25f49cadab35ba0d1dcc991c@localhost.localdomain>
Download mbox | patch
Permalink /patch/44618/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2020, 10:02 p.m.
martinvonz updated this revision to Diff 19562.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7977?vs=19529&id=19562

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7977/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7977

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -657,6 +657,12 @@ 
 
     repo.ui.debug(b"  checking for directory renames\n")
 
+    dirmove, movewithdir = _dir_renames(repo, c1, c2, copy, fullcopy, u1, u2)
+
+    return copy, movewithdir, diverge, renamedelete, dirmove
+
+
+def _dir_renames(repo, c1, c2, copy, fullcopy, u1, u2):
     # generate a directory move map
     d1, d2 = c1.dirs(), c2.dirs()
     invalid = set()
@@ -688,7 +694,7 @@ 
     del d1, d2, invalid
 
     if not dirmove:
-        return copy, {}, diverge, renamedelete, {}
+        return {}, {}
 
     dirmove = {k + b"/": v + b"/" for k, v in pycompat.iteritems(dirmove)}
 
@@ -713,7 +719,7 @@ 
                         )
                     break
 
-    return copy, movewithdir, diverge, renamedelete, dirmove
+    return dirmove, movewithdir
 
 
 def _heuristicscopytracing(repo, c1, c2, base):