diff options
author | Ben Keene <seraphire@gmail.com> | 2020-02-14 14:44:44 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-14 08:58:53 -0800 |
commit | cd1e0dc47a5ab1520b823d051d23f60c89072349 (patch) | |
tree | f5fac0298e2c8de716a32f3a17b77a81dcb2352c /t/t5501-fetch-push-alternates.sh | |
parent | git-p4: add --no-verify option (diff) | |
download | tgif-cd1e0dc47a5ab1520b823d051d23f60c89072349.tar.xz |
git-p4: restructure code in submit
In preparation for adding new hooks to the submit method of git-p4,
restructure the applyCommit function in the P4Submit class. Make the
following changes:
* Move all the code after the definition of submitted = False into the
Try-Finally block. This ensures that any error that occurs will
properly recover. This is not necessary with the current code because
none of it should throw an exception, however the next set of changes
will introduce exceptional code.
Existing flow control can remain as defined - the if-block for
prepare-p4-only sets the local variable "submitted" to True and exits
the function. New early exits, leave submitted set to False so the
Finally block will undo changes to the P4 workspace.
* Make the small usability change of adding an empty string to the
print statements displayed to the user when the prepare-p4-only option
is selected. On Windows, the command print() may display a set of
parentheses "()" to the user when the print() function is called with
no parameters. By supplying an empty string, the intended blank line
will print as expected.
* Fix a small bug when the submittedTemplate is edited by the user
and all content in the file is removed. The existing code will throw
an exception if the separateLine is not found in the file. Change this
code to test for the separator line using a find() test first and only
split on the separator if it is found.
* Additionally, add the new behavior that if the changelist file has
been completely emptied that the Submit action for this changelist
will be aborted.
Signed-off-by: Ben Keene <seraphire@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5501-fetch-push-alternates.sh')
0 files changed, 0 insertions, 0 deletions