~sircmpwn/lists.sr.ht#155: 
Problem with mercurial patches recognition when removing or adding files

Hello there,

I tried to send mercurial patches to a test list but patches are not recognized.

I read the doc and configured my hgrc to use git diff but it still does not work.

Here my test list with some of my tentatives : https://lists.sr.ht/~reedwade/test_nul

Did I missed something ? Is the doc out of date ?

Thanks a lot.

Status
REPORTED
Submitter
~reedwade
Assigned to
No-one
Submitted
1 year, 1 month ago
Updated
1 year, 1 month ago
Labels
No labels applied.

~reedwade 1 year, 1 month ago

It seems that my patch content is not git formated but my hg diff is.

~reedwade 1 year, 1 month ago

I had to add --plain in my hg email. We should update the doc about that

~reedwade 1 year, 1 month ago

I think something worse is wrong. This last email got no mercurial header (--plain) and is not recognized as patch.

~reedwade 1 year, 1 month ago

My issues come from the fact I'm adding or removing completely files with the patch which generate

diff --git a/toto b/toto
new file mode 100644
--- /dev/null
+++ b/toto
@@ -0,0 +1,1 @@
+foo bar

on mercurial and not

diff --git a/toto b/toto
new file mode 100644
index 0000000..d675fa4
--- /dev/null
+++ b/toto
@@ -0,0 +1 @@
+foo bar

on git

The missing part is the

index 0000000..d675fa4

If I take my mercurial patch, then add to it the missing line, then pygit2.Diff.parse_diff(body) witch is done by lists.sr.ht stop throwing "invalid patch header at line XX".

~reedwade 1 year, 1 month ago

I suggest that we stop using pygit2 to recognize and handle mercurial patches as they diverge in behavior and could diverge more in the future.

It will make the configuration of mercurial easier as we could disable git = true and maybe more restraining configuration.

Register here or Log in to comment, or comment via email.