# HG changeset patch # User David Schleimer # Date 1378318844 25200 # Node ID b746d455f0e10469f3b7f71e25cba6679ec4daeb # Parent 48379ebd27632a79d5b98bc255c4cdc4ef100f3a stupid: kill some dead and no longer needed code While I was debugging an unrelated issue with stupid, some of the code in branches_in_paths confused me, since it was using an undeclared variable. It looked like an attempt to short-circuit the file/directory detection before talking to subversion that never quite got finished. The code is mostly unreachable, and obviously broken, so I cleaned it up. I also cleaned up some prepatory code that was getting executed but appeared to only be useful for the short-circuintg attempt. diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- a/hgsubversion/stupid.py +++ b/hgsubversion/stupid.py @@ -634,18 +634,10 @@ def branches_in_paths(meta, tbdelta, pat if not paths_need_discovery: return branches - paths_need_discovery = [(len(p), p) for p in paths_need_discovery] - paths_need_discovery.sort() - paths_need_discovery = [p[1] for p in paths_need_discovery] actually_files = [] while paths_need_discovery: p = paths_need_discovery.pop(0) path_could_be_file = True - ind = 0 - while ind < len(paths_need_discovery) and not paths_need_discovery: - if op.startswith(p): - path_could_be_file = False - ind += 1 if path_could_be_file: if checkpath(p, revnum) == 'f': actually_files.append(p)