Alexandre Julliard : patches: Add "merge request" patch status.

Alexandre Julliard julliard at winehq.org
Tue Apr 26 15:31:16 CDT 2022


Module: tools
Branch: master
Commit: e18f0667f9a7507e9315c0a54d907ae851448cb0
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=e18f0667f9a7507e9315c0a54d907ae851448cb0

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Apr 26 22:07:38 2022 +0200

patches: Add "merge request" patch status.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 patches/expire      |  7 +++++++
 patches/patches.css |  1 +
 patches/update      | 12 ++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/patches/expire b/patches/expire
index 53e3f27..4f506a0 100755
--- a/patches/expire
+++ b/patches/expire
@@ -33,6 +33,7 @@ my %status_expiry =
  "authorship" => 7,
  "formatting" => 7,
  "other"      => 7,
+ "mergereq"   => 3,
  "nopatch"    => 3,
  "reply"      => 1,
  "rejected"   => 7,
@@ -50,6 +51,7 @@ my %status_descr =
  "assigned"   => "Assigned",
  "applied"    => "Applied",
  "committed"  => "Committed",
+ "mergereq"   => "Merge request",
  "applyfail"  => "Apply failure",
  "buildfail"  => "Build failure",
  "deferred"   => "Deferred",
@@ -133,6 +135,7 @@ the patch is correct.",
 # No notifications are sent for the following:
 # "nil"
 # "reply"
+# "mergereq"
 # "superseded"
 # "testfail"
 );
@@ -199,6 +202,10 @@ sub get_patch_state($)
         $patch{mtime} = (stat STATUS)[9] unless $patch{status} eq "nil";
         close STATUS;
     }
+    elsif (defined $patch{msgid} && $patch{msgid} =~ /<wine-wine-mr\d+-v\d+.*\@gitlab-mail-bridge>/)
+    {
+        $patch{status} = "mergereq";
+    }
     $patch{file} = $file;
     $patch{status} ||= "nil";
     $patch{mtime} ||= (stat "$dir/$file")[9];
diff --git a/patches/patches.css b/patches/patches.css
index f2240d9..cc8e908 100644
--- a/patches/patches.css
+++ b/patches/patches.css
@@ -147,6 +147,7 @@ tr.odd { background-color: #f8e8e8; }
 .deferred,   .deferred :link,   .deferred :visited   { color: #e08000; }
 .testcase,   .testcase :link,   .testcase :visited   { color: #e08000; }
 .reply,      .reply :link,      .reply :visited      { color: #e08000; }
+.mergereq,   .mergereq :link,   .mergereq :visited   { color: #e08000; }
 .other,      .other :link,      .other :visited      { color: #e08000; }
 .applyfail,  .applyfail :link,  .applyfail :visited  { color: red; }
 .buildfail,  .buildfail :link,  .buildfail :visited  { color: red; }
diff --git a/patches/update b/patches/update
index e45bad9..5d20f2a 100755
--- a/patches/update
+++ b/patches/update
@@ -27,6 +27,7 @@ my %status_descr =
  "assigned"   => "Assigned",
  "applied"    => "Applied",
  "committed"  => "Committed",
+ "mergereq"   => "Merge request",
  "applyfail"  => "Apply failure",
  "buildfail"  => "Build failure",
  "deferred"   => "Deferred",
@@ -56,6 +57,7 @@ my @legend =
                  "<li>Someone else fixed the problem already.</li></ul>" ],
  [ "testcase",   "<ul><li>You need to write some test cases demonstrating that the patch is correct.</li></ul>" ],
  [ "deferred",   "<ul><li>The patch is deferred because of code freeze for an upcoming release. Either resend after the release, make the patch less intrusive, or make a convincing argument that it needs to be included in the release.</li></ul>" ],
+ [ "mergereq",   "<ul><li>The patch was submitted through a Gitlab merge request. The actual status of the patch can be viewed on Gitlab.</li></ul>" ],
  [ "other",      "<ul><li>The patch belongs to another WineHQ project (website, appdb, etc.) and will be applied by the respective maintainer.</li></ul>" ],
  [ "applyfail",  "<ul><li>The patch got mangled in transit.</li>" .
                  "<li>It's not relative to the latest git.</li>" .
@@ -84,6 +86,7 @@ my @legend =
 
 my $dir = $ARGV[0] || "$ENV{HOME}/patches";
 my $dest = "/home/winehq/opt/source/patches";
+my $gitlab = "https://gitlab.winehq.org/wine/wine";
 my %patches;
 my %messages;
 my %subdirs;
@@ -216,6 +219,11 @@ foreach my $file (readdir DIR)
     if (defined $patch{"msgid"})
     {
         $messages{$patch{"msgid"}} = \%patch;
+        if ($patch{msgid} =~ /<wine-wine-mr(\d+)-v\d+.*\@gitlab-mail-bridge>/)
+        {
+            $patch{mr} = "$gitlab/-/merge_requests/$1";
+            $patch{status} = "mergereq" if $patch{status} eq "nil";
+        }
     }
     $patches{$file} = \%patch;
     if ($file =~ /^([0-9]+)[0-9]{4}$/) { $subdirs{$1} = 1; }
@@ -277,6 +285,10 @@ foreach my $file (sort { $patches{$b}->{"order"} <=> $patches{$a}->{"order"} } k
     {
         printf INDEX "<td class=\"status\"><a href=\"%s\">%s</a></td>", $patch->{commit}, $status_descr{$patch->{status}};
     }
+    elsif (defined($patch->{mr}))
+    {
+        printf INDEX "<td class=\"status\"><a href=\"%s\">%s</a></td>", $patch->{mr}, $status_descr{$patch->{status}};
+    }
     else
     {
         printf INDEX "<td class=\"status\"><a href=\"#legend\">%s</a></td>", $status_descr{$patch->{status}} || $patch->{status};




More information about the wine-cvs mailing list