Commits

David Schleimer  committed ed3cae9

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.

  • Participants
  • Parent commits b746d45

Comments (0)

Files changed (1)

File hgsubversion/stupid.py

     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