(self, push_result)
| 119 | shutil.rmtree(new_dir2, onerror=self.del_rw) |
| 120 | |
| 121 | def failed_push(self, push_result): |
| 122 | texts = [] |
| 123 | if push_result == 1: |
| 124 | text1 = m.Text( |
| 125 | f"'git push' failed since the remote repo has commits that don't exist locally.", |
| 126 | font=self.font, |
| 127 | font_size=20, |
| 128 | color=self.fontColor, |
| 129 | weight=m.BOLD, |
| 130 | ) |
| 131 | text1.move_to([self.camera.frame.get_center()[0], 5, 0]) |
| 132 | |
| 133 | text2 = m.Text( |
| 134 | f"Run 'git pull' (or 'git-sim pull' to simulate first) and then try again.", |
| 135 | font=self.font, |
| 136 | font_size=20, |
| 137 | color=self.fontColor, |
| 138 | weight=m.BOLD, |
| 139 | ) |
| 140 | text2.move_to(text1.get_center()).shift(m.DOWN / 2) |
| 141 | |
| 142 | text3 = m.Text( |
| 143 | f"Gold commits exist in remote repo, but not locally (need to be pulled).", |
| 144 | font=self.font, |
| 145 | font_size=20, |
| 146 | color=m.GOLD, |
| 147 | weight=m.BOLD, |
| 148 | ) |
| 149 | text3.move_to(text2.get_center()).shift(m.DOWN / 2) |
| 150 | |
| 151 | text4 = m.Text( |
| 152 | f"Red commits exist in both local and remote repos.", |
| 153 | font=self.font, |
| 154 | font_size=20, |
| 155 | color=m.RED, |
| 156 | weight=m.BOLD, |
| 157 | ) |
| 158 | text4.move_to(text3.get_center()).shift(m.DOWN / 2) |
| 159 | texts = [text1, text2, text3, text4] |
| 160 | |
| 161 | elif push_result == 2: |
| 162 | text1 = m.Text( |
| 163 | f"'git push' failed since the tip of your current branch is behind the remote.", |
| 164 | font=self.font, |
| 165 | font_size=20, |
| 166 | color=self.fontColor, |
| 167 | weight=m.BOLD, |
| 168 | ) |
| 169 | text1.move_to([self.camera.frame.get_center()[0], 5, 0]) |
| 170 | |
| 171 | text2 = m.Text( |
| 172 | f"Run 'git pull' (or 'git-sim pull' to simulate first) and then try again.", |
| 173 | font=self.font, |
| 174 | font_size=20, |
| 175 | color=self.fontColor, |
| 176 | weight=m.BOLD, |
| 177 | ) |
| 178 | text2.move_to(text1.get_center()).shift(m.DOWN / 2) |
no test coverage detected