# HG changeset patch # User David Schleimer # Date 1378320477 25200 # Node ID 31917a6be09cf26ada48485b245a1cb840909dd8 # Parent ed3cae9a0930b2ecb797e3d3e8a458130b8cb06d stupid: only check branch mappings for discovered files once For whatever reason, we were processing the list of discovered files for new branches every time we discovered a new file. This pulls the process-discovered-files loop out of the discover-files loop, and should reduce the running time from O(num_paths_discovered * num_files_discovered) to O(num_paths_discovered + num_files_discovered) diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- a/hgsubversion/stupid.py +++ b/hgsubversion/stupid.py @@ -647,16 +647,13 @@ def branches_in_paths(meta, tbdelta, pat for x in listdir(p, revnum) if x[1] == 'f']) - if not actually_files: + for path in actually_files: + if meta.get_path_tag(path): continue - - for path in actually_files: - if meta.get_path_tag(path): - continue - fpath, branch, bpath = meta.split_branch_path(path, existing=False) - if bpath is None: - continue - branches[branch] = bpath + fpath, branch, bpath = meta.split_branch_path(path, existing=False) + if bpath is None: + continue + branches[branch] = bpath return branches