Patchwork D6587: copies: return only path from _tracefile() since that's all caller needs

login
register
mail settings
Submitter phabricator
Date June 28, 2019, 11:52 p.m.
Message ID <differential-rev-PHID-DREV-v5gxpc4nmoyto3hwfyeb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40723/
State Superseded
Headers show

Comments

phabricator - June 28, 2019, 11:52 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

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
@@ -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))