comparison hgsubversion/stupid.py @ 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
comparison
equal deleted inserted replaced
1086:b746d455f0e1 1087:ed3cae9a0930
635 return branches 635 return branches
636 636
637 actually_files = [] 637 actually_files = []
638 while paths_need_discovery: 638 while paths_need_discovery:
639 p = paths_need_discovery.pop(0) 639 p = paths_need_discovery.pop(0)
640 path_could_be_file = True 640 if checkpath(p, revnum) == 'f':
641 if path_could_be_file: 641 actually_files.append(p)
642 if checkpath(p, revnum) == 'f': 642 # if there's a copyfrom_path and there were files inside that copyfrom,
643 actually_files.append(p) 643 # we need to detect those branches. It's a little thorny and slow, but
644 # if there's a copyfrom_path and there were files inside that copyfrom, 644 # seems to be the best option.
645 # we need to detect those branches. It's a little thorny and slow, but 645 elif paths[p].copyfrom_path and not meta.get_path_tag(p):
646 # seems to be the best option. 646 paths_need_discovery.extend(['%s/%s' % (p, x[0])
647 elif paths[p].copyfrom_path and not meta.get_path_tag(p): 647 for x in listdir(p, revnum)
648 paths_need_discovery.extend(['%s/%s' % (p, x[0]) 648 if x[1] == 'f'])
649 for x in listdir(p, revnum)
650 if x[1] == 'f'])
651 649
652 if not actually_files: 650 if not actually_files:
653 continue 651 continue
654 652
655 for path in actually_files: 653 for path in actually_files: