Mercurial > hgsubversion
changeset 1088:31917a6be09c
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)
author | David Schleimer <dschleimer@fb.com> |
---|---|
date | Wed, 04 Sep 2013 11:47:57 -0700 |
parents | ed3cae9a0930 |
children | 91d061989acc |
files | hgsubversion/stupid.py |
diffstat | 1 files changed, 6 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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