Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force unix line endings when writing patch files #71


Copy link

JornVernee commented Aug 22, 2019

Mercurial needs its patch files to end with unix line endings, so we need to use those explicitly when writing patch files (I've also been told on the hg irc that this is according to patch file spec).


  • Change must not contain extraneous whitespace
  • Change must be properly reviewed


  • Erik Helin (ehelin - Reviewer)
Copy link

bridgekeeper bot commented Aug 22, 2019

👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request (refresh this page to view it).

@openjdk openjdk bot added the rfr label Aug 22, 2019
Copy link

mlbridge bot commented Aug 22, 2019


Copy link

edvbld commented Aug 22, 2019

Hi Jorn,

thanks for fixing this! If this patch fixes some tests to pass on Windows, which tests are now passing that didn't before this patch?

Copy link
Member Author

JornVernee commented Aug 22, 2019

@edvbld Particularly; GitToHgConverterTests::convertMergeCommitWithP0Diff and GitToHgConverterTests::convertMergeCommit, which both failed while applying the patch.

e.g. Unexpected exit code
'hg import --no-commit --force C:\Users\Jorn\AppData\Local\Temp\import335532356040991524.patch' exited with status: 255
> applying C:\Users\Jorn\AppData\Local\Temp\import335532356040991524.patch
> abort: bad hunk #1 @@ -2,1 +2,1 @@
>  (2 1 1 1)

GitToHgConverterTests::convertMergeCommitWithP1Diff also failed because the \r line endings made it into the file (patching didn't fail there), and then the comparison failed.

Those 3 should be passing after this patch.

edvbld approved these changes Aug 23, 2019
Copy link

edvbld left a comment

Looks good, thanks for fixing this @JornVernee!

@openjdk openjdk bot removed the rfr label Aug 23, 2019
Copy link

openjdk bot commented Aug 23, 2019

@JornVernee This change can now be integrated. The commit message will be:

Force unix line endings when writing patch files

Reviewed-by: ehelin
  • If you would like to add a summary, use the /summary command.
  • To list additional contributors, use the /contributor command.

Since the source branch of this PR was last updated there have been 2 commits pushed to the master branch:

  • 24f3dde: Improve health check for git repositories
  • c582fb5: Do not catch NoSuchElementException in HgOpenJDKImport

Since there are no conflicts, your changes will automatically be rebased on top of the above commits when integrating. If you prefer to do this manually, please merge master into your branch first.

  • To integrate this PR with the above commit message, type /integrate in a new comment.
@openjdk openjdk bot added the ready label Aug 23, 2019
Copy link
Member Author

JornVernee commented Aug 23, 2019


@openjdk openjdk bot closed this Aug 23, 2019
@openjdk openjdk bot added the integrated label Aug 23, 2019
Copy link

openjdk bot commented Aug 23, 2019

@JornVernee The following commits have been pushed to master since your change was applied:

Your commit was automatically rebased without conflicts.
Pushed as commit 2a98c8a.

@JornVernee JornVernee deleted the JornVernee:force_unix_line_endings_in_patch_file branch Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.