Mercurial > hg
changeset 18862:6de8cd5c719a
scmutil.addremove: remove redundant directory and symlink checks
dirstate.walk only does lstats and never returns stat objects for directories.
On a large repository with 170,000 files, this speeds perfaddremove up from
2.40 seconds to 2.34.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 02 Apr 2013 14:49:34 -0700 |
parents | ec91b66e8965 |
children | 1b70e5941ad7 |
files | mercurial/scmutil.py |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/scmutil.py Tue Apr 02 14:46:55 2013 -0700 +++ b/mercurial/scmutil.py Tue Apr 02 14:49:34 2013 -0700 @@ -686,8 +686,7 @@ if repo.ui.verbose or not m.exact(abs): rel = m.rel(abs) repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) - elif (dstate != 'r' and (not st or - (stat.S_ISDIR(st.st_mode) and not stat.S_ISLNK(st.st_mode)))): + elif dstate != 'r' and not st: deleted.append(abs) if repo.ui.verbose or not m.exact(abs): rel = m.rel(abs)