| Index: git_map_branches.py
|
| diff --git a/git_map_branches.py b/git_map_branches.py
|
| index e18202b56349c9a406b10fe87c02a441911617b0..29a3cee2c32fa1fcff1ae2c7d14389fd86106ea4 100755
|
| --- a/git_map_branches.py
|
| +++ b/git_map_branches.py
|
| @@ -110,12 +110,19 @@ class BranchMapper(object):
|
| def __init__(self):
|
| self.verbosity = 0
|
| self.output = OutputManager()
|
| - self.__tracking_info = get_all_tracking_info()
|
| self.__gone_branches = set()
|
| - self.__roots = set()
|
| + self.__tracking_info = None
|
| + self.__parent_map = collections.defaultdict(list)
|
| + self.__current_branch = None
|
| + self.__current_hash = None
|
| + self.__tag_set = None
|
| +
|
| + def start(self):
|
| + self.__tracking_info = get_all_tracking_info(
|
| + include_tracking_status=self.verbosity >= 1)
|
| + roots = set()
|
|
|
| # A map of parents to a list of their children.
|
| - self.parent_map = collections.defaultdict(list)
|
| for branch, branch_info in self.__tracking_info.iteritems():
|
| if not branch_info:
|
| continue
|
| @@ -129,16 +136,15 @@ class BranchMapper(object):
|
| else:
|
| self.__gone_branches.add(parent)
|
| # A parent that isn't in the tracking info is a root.
|
| - self.__roots.add(parent)
|
| + roots.add(parent)
|
|
|
| - self.parent_map[parent].append(branch)
|
| + self.__parent_map[parent].append(branch)
|
|
|
| self.__current_branch = current_branch()
|
| self.__current_hash = self.__tracking_info[self.__current_branch].hash
|
| self.__tag_set = tags()
|
|
|
| - def start(self):
|
| - for root in sorted(self.__roots):
|
| + for root in sorted(roots):
|
| self.__append_branch(root)
|
|
|
| def __is_invalid_parent(self, parent):
|
| @@ -225,7 +231,7 @@ class BranchMapper(object):
|
|
|
| self.output.append(line)
|
|
|
| - for child in sorted(self.parent_map.pop(branch, ())):
|
| + for child in sorted(self.__parent_map.pop(branch, ())):
|
| self.__append_branch(child, depth=depth + 1)
|
|
|
|
|
|
|