(self)
| 82 | self.cmd += f"{type(self).__name__.lower()}{' -c' if self.c else ''}{' --detach' if self.detach else ''} {self.branch}" |
| 83 | |
| 84 | def construct(self): |
| 85 | if not settings.stdout and not settings.output_only_path and not settings.quiet: |
| 86 | print(f"{settings.INFO_STRING} {self.cmd}") |
| 87 | |
| 88 | self.show_intro() |
| 89 | head_commit = self.get_commit() |
| 90 | |
| 91 | # using -c flag, create new branch label and exit |
| 92 | if self.c: |
| 93 | self.parse_commits(head_commit) |
| 94 | self.recenter_frame() |
| 95 | self.scale_frame() |
| 96 | self.draw_ref(head_commit, self.topref, text=self.branch, color=m.GREEN) |
| 97 | else: |
| 98 | branch_commit = self.get_commit(self.branch) |
| 99 | |
| 100 | if self.is_ancestor: |
| 101 | commits_in_range = list(self.repo.iter_commits(self.branch + "..HEAD")) |
| 102 | |
| 103 | # branch is reached from HEAD, so draw everything |
| 104 | if len(commits_in_range) <= self.n: |
| 105 | self.parse_commits(head_commit) |
| 106 | reset_head_to = branch_commit.hexsha |
| 107 | self.recenter_frame() |
| 108 | self.scale_frame() |
| 109 | self.reset_head(reset_head_to) |
| 110 | self.reset_branch(head_commit.hexsha) |
| 111 | |
| 112 | # branch is not reached, so start from branch |
| 113 | else: |
| 114 | self.parse_commits(branch_commit) |
| 115 | self.draw_ref(branch_commit, self.topref) |
| 116 | self.recenter_frame() |
| 117 | self.scale_frame() |
| 118 | |
| 119 | elif self.is_descendant: |
| 120 | self.parse_commits(branch_commit) |
| 121 | reset_head_to = branch_commit.hexsha |
| 122 | self.recenter_frame() |
| 123 | self.scale_frame() |
| 124 | if "HEAD" in self.drawnRefs: |
| 125 | self.reset_head(reset_head_to) |
| 126 | if not self.repo.head.is_detached: |
| 127 | self.reset_branch(head_commit.hexsha) |
| 128 | else: |
| 129 | self.draw_ref(branch_commit, self.topref) |
| 130 | else: |
| 131 | self.parse_commits(head_commit) |
| 132 | self.parse_commits(branch_commit, shift=4 * m.DOWN) |
| 133 | self.center_frame_on_commit(branch_commit) |
| 134 | self.recenter_frame() |
| 135 | self.scale_frame() |
| 136 | self.reset_head(branch_commit.hexsha) |
| 137 | self.reset_branch(head_commit.hexsha) |
| 138 | |
| 139 | self.color_by() |
| 140 | self.show_command_as_title() |
| 141 | self.fadeout() |
nothing calls this directly
no test coverage detected