D5848: merge: don't unnecessarily calculate backup path

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Feb 5 17:27:05 UTC 2019


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/D5848

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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")



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


More information about the Mercurial-devel mailing list