MCPcopy Index your code
hub / github.com/initialcommit-com/git-sim / construct

Method construct

src/git_sim/cherrypick.py:38–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

36 )
37
38 def construct(self):
39 if not settings.stdout and not settings.output_only_path and not settings.quiet:
40 print(f"{settings.INFO_STRING} {self.cmd}")
41
42 if self.repo.active_branch.name in self.repo.git.branch(
43 "--contains", self.commit
44 ):
45 print(
46 "git-sim error: Commit '"
47 + self.commit
48 + "' is already included in the history of active branch '"
49 + self.repo.active_branch.name
50 + "'."
51 )
52 sys.exit(1)
53
54 self.show_intro()
55 head_commit = self.get_commit()
56 self.parse_commits(head_commit)
57 cherry_picked_commit = self.get_commit(self.commit)
58 self.parse_commits(cherry_picked_commit, shift=4 * m.DOWN)
59 self.parse_all()
60 self.center_frame_on_commit(head_commit)
61 self.setup_and_draw_parent(
62 head_commit,
63 self.edit if self.edit else cherry_picked_commit.message,
64 )
65 self.draw_arrow_between_commits(cherry_picked_commit.hexsha, "abcdef")
66 self.recenter_frame()
67 self.scale_frame()
68 self.reset_head_branch("abcdef")
69 self.color_by(offset=2)
70 self.show_command_as_title()
71 self.fadeout()
72 self.show_outro()

Callers

nothing calls this directly

Calls 14

show_introMethod · 0.80
get_commitMethod · 0.80
parse_commitsMethod · 0.80
parse_allMethod · 0.80
recenter_frameMethod · 0.80
scale_frameMethod · 0.80
reset_head_branchMethod · 0.80
color_byMethod · 0.80
show_command_as_titleMethod · 0.80
fadeoutMethod · 0.80

Tested by

no test coverage detected