Patchwork [4,of,4,STABLE] contrib: check reference to old selenic.com domain

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Nov. 1, 2016, 11:47 a.m.
Message ID <34ced7fcfa8529ce0c80.1478000854@feefifofum>
Download mbox | patch
Permalink /patch/17240/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Nov. 1, 2016, 11:47 a.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1478000377 -32400
#      Tue Nov 01 20:39:37 2016 +0900
# Branch stable
# Node ID 34ced7fcfa8529ce0c804088c79bb51dbeb6c1be
# Parent  a870b49662d84c4c532e4c1fde2987b782b4ed88
contrib: check reference to old selenic.com domain

Now, all URL in Mercurial source tree should refer mercurial-scm.org
domain instead of selenic.com.

*.po files are ignored in this patch, because they might contain
msgid/msgstr coming from old source files.

This ignorance seems safe enough, because such msgstr should be
ignored at runtime, because:

  - msgid corresponded to it should be invalid, or
  - msgstr itself should be marked as fuzzy at synchronized to recent hg.pot

If any additional examination for *.po files is needed in the future,
let i18n/check-translation.py achieve such examination.

BTW, some binary files (e.g. *.png) are meaningless for checking
reference to old domain in this patch, but aren't ignored like as *.po
files, because excluding multiple suffixes is difficult for regexp
matching.
Jun Wu - Nov. 1, 2016, 3:48 p.m.
These look good to me if we decide to use "mercurial-scm.org".

I slightly prefer the shorter domain name for typing efficiency.
"git-scm.org" does not have "www".

Excerpts from FUJIWARA Katsunori's message of 2016-11-01 20:47:34 +0900:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1478000377 -32400
> #      Tue Nov 01 20:39:37 2016 +0900
> # Branch stable
> # Node ID 34ced7fcfa8529ce0c804088c79bb51dbeb6c1be
> # Parent  a870b49662d84c4c532e4c1fde2987b782b4ed88
> contrib: check reference to old selenic.com domain
> 
> Now, all URL in Mercurial source tree should refer mercurial-scm.org
> domain instead of selenic.com.
> 
> *.po files are ignored in this patch, because they might contain
> msgid/msgstr coming from old source files.
> 
> This ignorance seems safe enough, because such msgstr should be
> ignored at runtime, because:
> 
>   - msgid corresponded to it should be invalid, or
>   - msgstr itself should be marked as fuzzy at synchronized to recent hg.pot
> 
> If any additional examination for *.po files is needed in the future,
> let i18n/check-translation.py achieve such examination.
> 
> BTW, some binary files (e.g. *.png) are meaningless for checking
> reference to old domain in this patch, but aren't ignored like as *.po
> files, because excluding multiple suffixes is difficult for regexp
> matching.
> 
> diff --git a/contrib/check-code.py b/contrib/check-code.py
> --- a/contrib/check-code.py
> +++ b/contrib/check-code.py
> @@ -444,6 +444,17 @@ webtemplatepats = [
>    ]
>  ]
>  
> +allfilesfilters = []
> +
> +allfilespats = [
> +  [
> +    (r'(http|https)://[a-zA-Z0-9./]*selenic.com/',
> +     'use mercurial-scm.org domain URL'),
> +  ],
> +  # warnings
> +  [],
> +]
> +
>  checks = [
>      ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats),
>      ('test script', r'(.*/)?test-[^.~]*$', '', testfilters, testpats),
> @@ -456,6 +467,8 @@ checks = [
>      ('txt', r'.*\.txt$', '', txtfilters, txtpats),
>      ('web template', r'mercurial/templates/.*\.tmpl', '',
>       webtemplatefilters, webtemplatepats),
> +    ('all except for .po', r'.*(?<!\.po)$', '',
> +     allfilesfilters, allfilespats),
>  ]
>  
>  def _preparepats():
Pierre-Yves David - Nov. 1, 2016, 3:51 p.m.
On 11/01/2016 04:48 PM, Jun Wu wrote:
> These look good to me if we decide to use "mercurial-scm.org".
>
> I slightly prefer the shorter domain name for typing efficiency.
> "git-scm.org" does not have "www".\

I've taken them as is. I think I also like the shorter version better 
but it is easy enough to update this later and 4.0 release is at the gate.

Cheers

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -444,6 +444,17 @@  webtemplatepats = [
   ]
 ]
 
+allfilesfilters = []
+
+allfilespats = [
+  [
+    (r'(http|https)://[a-zA-Z0-9./]*selenic.com/',
+     'use mercurial-scm.org domain URL'),
+  ],
+  # warnings
+  [],
+]
+
 checks = [
     ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats),
     ('test script', r'(.*/)?test-[^.~]*$', '', testfilters, testpats),
@@ -456,6 +467,8 @@  checks = [
     ('txt', r'.*\.txt$', '', txtfilters, txtpats),
     ('web template', r'mercurial/templates/.*\.tmpl', '',
      webtemplatefilters, webtemplatepats),
+    ('all except for .po', r'.*(?<!\.po)$', '',
+     allfilesfilters, allfilespats),
 ]
 
 def _preparepats():