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