merge: don't unnecessarily calculate backup path
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 04 Feb 2019 21:21:55 -0800
changeset 41569 ef2295651351
parent 41568 641c8b66a825
child 41570 1f2714052d7e
merge: don't unnecessarily calculate backup path Differential Revision: https://phab.mercurial-scm.org/D5848
mercurial/merge.py
--- a/mercurial/merge.py	Sun Feb 03 22:49:28 2019 -0800
+++ b/mercurial/merge.py	Mon Feb 04 21:21:55 2019 -0800
@@ -1505,8 +1505,8 @@
                         if repo.wvfs.isfileorlink(p):
                             absf = repo.wjoin(p)
                             break
-                orig = scmutil.origpath(ui, repo, absf)
                 if repo.wvfs.lexists(absf):
+                    orig = scmutil.origpath(ui, repo, absf)
                     util.rename(absf, orig)
             wctx[f].clearunknown()
             atomictemp = ui.configbool("experimental", "update.atomic-file")