Patchwork D5849: merge: don't unnecessarily calculate absolute path

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2019, 6:13 p.m.
Message ID <2ae56d8a8ae6247c386b5854c45d3445@localhost.localdomain>
Download mbox | patch
Permalink /patch/38450/
State Not Applicable
Headers show

Comments

phabricator - Feb. 5, 2019, 6:13 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1f2714052d7e: merge: don&#039;t unnecessarily calculate absolute path (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5849?vs=13810&id=13827

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1499,13 +1499,14 @@ 
                 # If a file or directory exists with the same name, back that
                 # up.  Otherwise, look to see if there is a file that conflicts
                 # with a directory this file is in, and if so, back that up.
-                absf = repo.wjoin(f)
+                conflicting = f
                 if not repo.wvfs.lexists(f):
                     for p in util.finddirs(f):
                         if repo.wvfs.isfileorlink(p):
-                            absf = repo.wjoin(p)
+                            conflicting = p
                             break
-                if repo.wvfs.lexists(absf):
+                if repo.wvfs.lexists(conflicting):
+                    absf = repo.wjoin(conflicting)
                     orig = scmutil.origpath(ui, repo, absf)
                     util.rename(absf, orig)
             wctx[f].clearunknown()