(self)
| 1760 | conflict_behavior_choices = ("ask", "skip", "quit") |
| 1761 | |
| 1762 | def __init__(self): |
| 1763 | Command.__init__(self) |
| 1764 | P4UserMap.__init__(self) |
| 1765 | self.options = [ |
| 1766 | optparse.make_option("--origin", dest="origin"), |
| 1767 | optparse.make_option("-M", dest="detectRenames", action="store_true"), |
| 1768 | # preserve the user, requires relevant p4 permissions |
| 1769 | optparse.make_option("--preserve-user", dest="preserveUser", action="store_true"), |
| 1770 | optparse.make_option("--export-labels", dest="exportLabels", action="store_true"), |
| 1771 | optparse.make_option("--dry-run", "-n", dest="dry_run", action="store_true"), |
| 1772 | optparse.make_option("--prepare-p4-only", dest="prepare_p4_only", action="store_true"), |
| 1773 | optparse.make_option("--conflict", dest="conflict_behavior", |
| 1774 | choices=self.conflict_behavior_choices), |
| 1775 | optparse.make_option("--branch", dest="branch"), |
| 1776 | optparse.make_option("--shelve", dest="shelve", action="store_true", |
| 1777 | help="Shelve instead of submit. Shelved files are reverted, " |
| 1778 | "restoring the workspace to the state before the shelve"), |
| 1779 | optparse.make_option("--update-shelve", dest="update_shelve", action="append", type="int", |
| 1780 | metavar="CHANGELIST", |
| 1781 | help="update an existing shelved changelist, implies --shelve, " |
| 1782 | "repeat in-order for multiple shelved changelists"), |
| 1783 | optparse.make_option("--commit", dest="commit", metavar="COMMIT", |
| 1784 | help="submit only the specified commit(s), one commit or xxx..xxx"), |
| 1785 | optparse.make_option("--disable-rebase", dest="disable_rebase", action="store_true", |
| 1786 | help="Disable rebase after submit is completed. Can be useful if you " |
| 1787 | "work from a local git branch that is not master"), |
| 1788 | optparse.make_option("--disable-p4sync", dest="disable_p4sync", action="store_true", |
| 1789 | help="Skip Perforce sync of p4/master after submit or shelve"), |
| 1790 | optparse.make_option("--no-verify", dest="no_verify", action="store_true", |
| 1791 | help="Bypass p4-pre-submit and p4-changelist hooks"), |
| 1792 | ] |
| 1793 | self.description = """Submit changes from git to the perforce depot.\n |
| 1794 | The `p4-pre-submit` hook is executed if it exists and is executable. It |
| 1795 | can be bypassed with the `--no-verify` command line option. The hook takes |
| 1796 | no parameters and nothing from standard input. Exiting with a non-zero status |
| 1797 | from this script prevents `git-p4 submit` from launching. |
| 1798 | |
| 1799 | One usage scenario is to run unit tests in the hook. |
| 1800 | |
| 1801 | The `p4-prepare-changelist` hook is executed right after preparing the default |
| 1802 | changelist message and before the editor is started. It takes one parameter, |
| 1803 | the name of the file that contains the changelist text. Exiting with a non-zero |
| 1804 | status from the script will abort the process. |
| 1805 | |
| 1806 | The purpose of the hook is to edit the message file in place, and it is not |
| 1807 | suppressed by the `--no-verify` option. This hook is called even if |
| 1808 | `--prepare-p4-only` is set. |
| 1809 | |
| 1810 | The `p4-changelist` hook is executed after the changelist message has been |
| 1811 | edited by the user. It can be bypassed with the `--no-verify` option. It |
| 1812 | takes a single parameter, the name of the file that holds the proposed |
| 1813 | changelist text. Exiting with a non-zero status causes the command to abort. |
| 1814 | |
| 1815 | The hook is allowed to edit the changelist file and can be used to normalize |
| 1816 | the text into some project standard format. It can also be used to refuse the |
| 1817 | Submit after inspect the message file. |
| 1818 | |
| 1819 | The `p4-post-changelist` hook is invoked after the submit has successfully |
nothing calls this directly
no test coverage detected