# HG changeset patch # User David Schleimer # Date 1378319998 25200 # Node ID ed3cae9a0930b2ecb797e3d3e8a458130b8cb06d # Parent b746d455f0e10469f3b7f71e25cba6679ec4daeb stupid: cleanup unnecessary, always-true if statement We had an unnecessary if statement in setupid.branches_in_paths() that was checking a variable that was unconditionally set to True on the previous line. This was a remnant of a never-completed, and now mostly-cleaned up attempt to short-circuit path type detection before talking to subversion for some directories. This removes the variable assignment and if statement, and moves the body of the if up one level. diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- a/hgsubversion/stupid.py +++ b/hgsubversion/stupid.py @@ -637,17 +637,15 @@ def branches_in_paths(meta, tbdelta, pat actually_files = [] while paths_need_discovery: p = paths_need_discovery.pop(0) - path_could_be_file = True - if path_could_be_file: - if checkpath(p, revnum) == 'f': - actually_files.append(p) - # if there's a copyfrom_path and there were files inside that copyfrom, - # we need to detect those branches. It's a little thorny and slow, but - # seems to be the best option. - elif paths[p].copyfrom_path and not meta.get_path_tag(p): - paths_need_discovery.extend(['%s/%s' % (p, x[0]) - for x in listdir(p, revnum) - if x[1] == 'f']) + if checkpath(p, revnum) == 'f': + actually_files.append(p) + # if there's a copyfrom_path and there were files inside that copyfrom, + # we need to detect those branches. It's a little thorny and slow, but + # seems to be the best option. + elif paths[p].copyfrom_path and not meta.get_path_tag(p): + paths_need_discovery.extend(['%s/%s' % (p, x[0]) + for x in listdir(p, revnum) + if x[1] == 'f']) if not actually_files: continue