| 7 | |
| 8 | |
| 9 | class Log(GitSimBaseCommand): |
| 10 | def __init__(self, ctx: typer.Context, n: int, all: bool): |
| 11 | super().__init__() |
| 12 | |
| 13 | n_command = ctx.parent.params.get("n") |
| 14 | self.n_subcommand = n |
| 15 | if self.n_subcommand: |
| 16 | n = self.n_subcommand |
| 17 | else: |
| 18 | n = n_command |
| 19 | self.n = n |
| 20 | self.n_orig = self.n |
| 21 | |
| 22 | all_command = ctx.parent.params.get("all") |
| 23 | self.all_subcommand = all |
| 24 | if self.all_subcommand: |
| 25 | all = self.all_subcommand |
| 26 | else: |
| 27 | all = all_command |
| 28 | self.all = all |
| 29 | |
| 30 | try: |
| 31 | self.selected_branches.append(self.repo.active_branch.name) |
| 32 | except TypeError: |
| 33 | pass |
| 34 | |
| 35 | self.cmd += f"{type(self).__name__.lower()}{' --all' if self.all_subcommand else ''}{' -n ' + str(self.n) if self.n_subcommand else ''}" |
| 36 | |
| 37 | def construct(self): |
| 38 | if not settings.stdout and not settings.output_only_path and not settings.quiet: |
| 39 | print(f"{settings.INFO_STRING} {self.cmd}") |
| 40 | self.show_intro() |
| 41 | self.parse_commits() |
| 42 | self.parse_all() |
| 43 | self.recenter_frame() |
| 44 | self.scale_frame() |
| 45 | self.color_by() |
| 46 | self.show_command_as_title() |
| 47 | self.fadeout() |
| 48 | self.show_outro() |