Improve the editing experience when patching or landing commits.
Review Request #10672 — Created Sept. 1, 2019 and submitted — Latest diff uploaded
This change reworks the code that handles creating a commit when
rbt patch -c) or landing (using
rbt land -e) to
improve the editing experience and error handling.
Both Git and Mercurial provide a custom filename for the editor,
mirroring the format of the filenames normally used by those tools. This
gives editors a change to perform syntax highlighting, line length
If the user deletes the entire contents of the commit message, the
commit won't be created. Instead, a message will be shown explaining the
situation and next steps.
There are also some fixes for command line arguments for specifying
author information for Git and Mercurial, improved error handling all
throughout, and better file tracking in Mercurial.
In addition, we now have extensive test coverage for commit creation for
both Git and Mercurial.
Unit tests pass for Git and Mercurial.
Manually tested locally patching changes from both Git and Mercurial
in the commit editor mode. Verified that the correct message was used
when editing the commit, and that a suitable set of instructions was
provided when canceling the commit.
Also verified tracking of edited and new files in Mercurial.