| 447 | self.Die(msg) |
| 448 | |
| 449 | def InitialEnvironmentChecks(self, cwd): |
| 450 | # Cancel if this is not a git checkout. |
| 451 | if not os.path.exists(os.path.join(cwd, ".git")): # pragma: no cover |
| 452 | self.Die("%s is not a git checkout. If you know what you're doing, try " |
| 453 | "deleting it and rerunning this script." % cwd) |
| 454 | |
| 455 | # Cancel if EDITOR is unset or not executable. |
| 456 | if (self._options.requires_editor and (not os.environ.get("EDITOR") or |
| 457 | self.Command( |
| 458 | "which", os.environ["EDITOR"]) is None)): # pragma: no cover |
| 459 | self.Die("Please set your EDITOR environment variable, you'll need it.") |
| 460 | |
| 461 | def CommonPrepare(self): |
| 462 | # Check for a clean workdir. |