copies: return only path from _tracefile() since that's all caller needs
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 28 Jun 2019 16:40:36 -0700
changeset 42548 4ebbd7c4a3c5
parent 42547 6a3872e34503
child 42549 fa2071753dc2
copies: return only path from _tracefile() since that's all caller needs Differential Revision: https://phab.mercurial-scm.org/D6587
mercurial/copies.py
--- a/mercurial/copies.py	Sun Jun 30 13:04:26 2019 +0530
+++ b/mercurial/copies.py	Fri Jun 28 16:40:36 2019 -0700
@@ -161,8 +161,9 @@
     manifest am, stopping after the first ancestor lower than limit"""
 
     for f in fctx.ancestors():
-        if am.get(f.path(), None) == f.filenode():
-            return f
+        path = f.path()
+        if am.get(path, None) == f.filenode():
+            return path
         if not f.isintroducedafter(limit):
             return None
 
@@ -237,11 +238,11 @@
 
         if debug:
             start = util.timer()
-        ofctx = _tracefile(fctx, am, limit)
-        if ofctx:
+        opath = _tracefile(fctx, am, limit)
+        if opath:
             if debug:
-                dbg('debug.copies:          rename of: %s\n' % ofctx._path)
-            cm[f] = ofctx.path()
+                dbg('debug.copies:          rename of: %s\n' % opath)
+            cm[f] = opath
         if debug:
             dbg('debug.copies:          time: %f seconds\n'
                 % (util.timer() - start))