diff mercurial/merge.py @ 28088:19424f960bf5

checkunknown: audit path before checking if it's a file or link Previously we would lstat the file to see if it was a file or a link before attempting to process it. If the file happened to exist across a symlink, and if that symlink was pointing to a network file system, that check could be very expensive. The new logic audit's the path to avoid symlinks before performing the lstat on the file itself. In our situation, this shaved 10 minutes off of certain hg updates. 300 files * (2 seconds - the network filesystem lookup time)
author Durham Goode <durham@fb.com>
date Thu, 11 Feb 2016 17:23:10 -0800
parents e397b58c0563
children d49793aac1ac
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Feb 11 17:04:33 2016 -0800
+++ b/mercurial/merge.py	Thu Feb 11 17:23:10 2016 -0800
@@ -598,8 +598,8 @@
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
     if f2 is None:
         f2 = f
-    return (repo.wvfs.isfileorlink(f)
-        and repo.wvfs.audit.check(f)
+    return (repo.wvfs.audit.check(f)
+        and repo.wvfs.isfileorlink(f)
         and repo.dirstate.normalize(f) not in repo.dirstate
         and mctx[f2].cmp(wctx[f]))