D7542: mail: don't complain about a multi-word email.method

2022-04-12 Thread jcristau (Julien Cristau)
Closed by commit rHG1d6c6ad645e1: mail: don't complain about a multi-word 
email.method (authored by jcristau).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7542?vs=33000&id=33015

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7542/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7542

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -260,9 +260,11 @@
 )
 )
 else:
-if not procutil.findexe(method):
+command = procutil.shellsplit(method)
+command = command[0] if command else b''
+if not (command and procutil.findexe(command)):
 raise error.Abort(
-_(b'%r specified as email transport, but not in PATH') % method
+_(b'%r specified as email transport, but not in PATH') % 
command
 )
 
 



To: jcristau, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches, yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7542: mail: don't complain about a multi-word email.method

2022-04-11 Thread jcristau (Julien Cristau)
Herald added a subscriber: mercurial-patches.
jcristau updated this revision to Diff 33000.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7542?vs=18420&id=33000

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7542/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7542

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -260,9 +260,11 @@
 )
 )
 else:
-if not procutil.findexe(method):
+command = procutil.shellsplit(method)
+command = command[0] if command else b''
+if not (command and procutil.findexe(command)):
 raise error.Abort(
-_(b'%r specified as email transport, but not in PATH') % method
+_(b'%r specified as email transport, but not in PATH') % 
command
 )
 
 



To: jcristau, #hg-reviewers
Cc: mercurial-patches, yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12493: test: deal with changed error message on python 3.10

2022-04-11 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12493

AFFECTED FILES
  tests/test-parseindex.t

CHANGE DETAILS

diff --git a/tests/test-parseindex.t b/tests/test-parseindex.t
--- a/tests/test-parseindex.t
+++ b/tests/test-parseindex.t
@@ -111,7 +111,7 @@
   1: head out of range
   -2: head out of range
   -1: head out of range
-  None: an integer is required( .got type NoneType.)? (re)
+  None: (an integer is required( .got type NoneType.)?|'NoneType' object 
cannot be interpreted as an integer) (re)
   good roots:
   0: [0]
   1: [1]
@@ -122,7 +122,7 @@
   -2: []
   -1: []
   bad roots:
-  None: an integer is required( .got type NoneType.)? (re)
+  None: (an integer is required( .got type NoneType.)?|'NoneType' object 
cannot be interpreted as an integer) (re)
 
   $ cd ..
 



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12492: test: accept another error message on lack of TLS client certificate

2022-04-09 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12492

AFFECTED FILES
  tests/test-https.t

CHANGE DETAILS

diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -518,7 +518,7 @@
 without client certificate:
 
   $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
-  abort: error: .*(\$ECONNRESET\$|certificate required|handshake failure).* 
(re)
+  abort: error: .*(\$ECONNRESET\$|certificate required|handshake failure|EOF 
occurred).* (re)
   [100]
 
 with client certificate:



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12491: sslutil: treat TLSV1_ALERT_PROTOCOL_VERSION error the same as UNSUPPORTED_PROTOCOL

2022-04-09 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It looks like python 3.10 returns a different reason code on protocol
  version mismatch.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12491

AFFECTED FILES
  mercurial/sslutil.py
  tests/test-https.t

CHANGE DETAILS

diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -374,26 +374,26 @@
   (could not negotiate a common security protocol (tls1.1+) with localhost; 
the likely cause is Mercurial is configured to be more secure than the server 
can support)
   (consider contacting the operator of this server and ask them to support 
modern TLS protocol versions; or, set 
hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less 
secure protocols when communicating with this server)
   (see https://mercurial-scm.org/wiki/SecureConnections for more info)
-  abort: error: .*(unsupported protocol|wrong ssl version).* (re)
+  abort: error: .*(unsupported protocol|wrong ssl version|alert protocol 
version).* (re)
   [100]
 
   $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id 
https://localhost:$HGPORT/
   (could not negotiate a common security protocol (tls1.1+) with localhost; 
the likely cause is Mercurial is configured to be more secure than the server 
can support)
   (consider contacting the operator of this server and ask them to support 
modern TLS protocol versions; or, set 
hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less 
secure protocols when communicating with this server)
   (see https://mercurial-scm.org/wiki/SecureConnections for more info)
-  abort: error: .*(unsupported protocol|wrong ssl version).* (re)
+  abort: error: .*(unsupported protocol|wrong ssl version|alert protocol 
version).* (re)
   [100]
   $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id 
https://localhost:$HGPORT/
   (could not negotiate a common security protocol (tls1.2+) with localhost; 
the likely cause is Mercurial is configured to be more secure than the server 
can support)
   (consider contacting the operator of this server and ask them to support 
modern TLS protocol versions; or, set 
hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less 
secure protocols when communicating with this server)
   (see https://mercurial-scm.org/wiki/SecureConnections for more info)
-  abort: error: .*(unsupported protocol|wrong ssl version).* (re)
+  abort: error: .*(unsupported protocol|wrong ssl version|alert protocol 
version).* (re)
   [100]
   $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id 
https://localhost:$HGPORT1/
   (could not negotiate a common security protocol (tls1.2+) with localhost; 
the likely cause is Mercurial is configured to be more secure than the server 
can support)
   (consider contacting the operator of this server and ask them to support 
modern TLS protocol versions; or, set 
hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less 
secure protocols when communicating with this server)
   (see https://mercurial-scm.org/wiki/SecureConnections for more info)
-  abort: error: .*(unsupported protocol|wrong ssl version).* (re)
+  abort: error: .*(unsupported protocol|wrong ssl version|alert protocol 
version).* (re)
   [100]
 
 --insecure will allow TLS 1.0 connections and override configs
@@ -417,7 +417,7 @@
   (could not negotiate a common security protocol (tls1.2+) with localhost; 
the likely cause is Mercurial is configured to be more secure than the server 
can support)
   (consider contacting the operator of this server and ask them to support 
modern TLS protocol versions; or, set 
hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less 
secure protocols when communicating with this server)
   (see https://mercurial-scm.org/wiki/SecureConnections for more info)
-  abort: error: .*(unsupported protocol|wrong ssl version).* (re)
+  abort: error: .*(unsupported protocol|wrong ssl version|alert protocol 
version).* (re)
   [100]
 
 .hg/hgrc file [hostsecurity] settings are applied to remote ui instances 
(issue5305)
@@ -430,7 +430,7 @@
   (could not negotiate a common security protocol (tls1.2+) with localhost; 
the likely cause is Mercurial is configured to be more secure than the server 
can support)
   (consider contacting the operator of this server and ask them to support 
modern TLS protocol versions; or, set 
hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less 
secure protocols when communicating with this server)
   (see https://mercurial-scm.org/wiki/SecureConnections for more info)
-  abort: error: .*(unsupported protocol|wrong ssl version).* (re)
+  abort: error: .*(unsupported protocol|wrong ssl version|alert protocol 
version).* (re)
   [100]
 
   $ killdaemons.py hg0.pid
diff --git a/me

D12490: test: override default cipher selection when connecting to TLS 1.0/1.1 servers

2022-04-09 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The default set of ciphers on python 3.10 is incompatible with old TLS
  versions.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12490

AFFECTED FILES
  tests/test-https.t

CHANGE DETAILS

diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -361,9 +361,9 @@
 
 Clients talking same TLS versions work
 
-  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 id 
https://localhost:$HGPORT/
+  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 --config 
hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT/
   5fed3813f7f5
-  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id 
https://localhost:$HGPORT1/
+  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 --config 
hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT1/
   5fed3813f7f5
   $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id 
https://localhost:$HGPORT2/
   5fed3813f7f5
@@ -405,6 +405,7 @@
 The per-host config option overrides the default
 
   $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
+  > --config hostsecurity.ciphers=DEFAULT \
   > --config hostsecurity.minimumprotocol=tls1.2 \
   > --config hostsecurity.localhost:minimumprotocol=tls1.0
   5fed3813f7f5



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12489: sslutil: be less strict about which ciphers are allowed when using --insecure

2022-04-09 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Python 3.10 restricted which ciphers are enabled by default, leading to
  no available ciphers for TLS < 1.2.  When using the --insecure flag we
  allow old TLS, so also adjust the cipher list to give connections a
  chance to work.
  
  On the server side, also loosen the cipher selection in tests (when
  using the devel.serverexactprotocol option).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12489

AFFECTED FILES
  mercurial/sslutil.py

CHANGE DETAILS

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -113,16 +113,18 @@
 minimumprotocol = ui.config(b'hostsecurity', key, minimumprotocol)
 validateprotocol(minimumprotocol, key)
 
+ciphers = ui.config(b'hostsecurity', b'ciphers')
+ciphers = ui.config(b'hostsecurity', b'%s:ciphers' % bhostname, ciphers)
+
 # If --insecure is used, we allow the use of TLS 1.0 despite config 
options.
 # We always print a "connection security to %s is disabled..." message when
 # --insecure is used. So no need to print anything more here.
 if ui.insecureconnections:
 minimumprotocol = b'tls1.0'
+if not ciphers:
+ciphers = b'DEFAULT'
 
 s[b'minimumprotocol'] = minimumprotocol
-
-ciphers = ui.config(b'hostsecurity', b'ciphers')
-ciphers = ui.config(b'hostsecurity', b'%s:ciphers' % bhostname, ciphers)
 s[b'ciphers'] = ciphers
 
 # Look for fingerprints in [hostsecurity] section. Value is a list
@@ -602,8 +604,11 @@
 sslcontext.options |= getattr(ssl, 'OP_SINGLE_DH_USE', 0)
 sslcontext.options |= getattr(ssl, 'OP_SINGLE_ECDH_USE', 0)
 
-# Use the list of more secure ciphers if found in the ssl module.
-if util.safehasattr(ssl, b'_RESTRICTED_SERVER_CIPHERS'):
+# In tests, allow insecure ciphers
+# Otherwise, use the list of more secure ciphers if found in the ssl 
module.
+if exactprotocol:
+sslcontext.set_ciphers('DEFAULT')
+elif util.safehasattr(ssl, b'_RESTRICTED_SERVER_CIPHERS'):
 sslcontext.options |= getattr(ssl, 'OP_CIPHER_SERVER_PREFERENCE', 0)
 # pytype: disable=module-attr
 sslcontext.set_ciphers(ssl._RESTRICTED_SERVER_CIPHERS)



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12488: sslutil: avoid deprecation warnings from python 3.10's ssl module

2022-04-09 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Use ssl.PROTOCOL_TLS_{CLIENT,SERVER} and
  SSLContext.{min,max}imum_version when supported (3.7+).
  
  And, catch deprecation warnings when the user asks for deprecated TLS
  versions (1.0 and 1.1).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12488

AFFECTED FILES
  mercurial/sslutil.py

CHANGE DETAILS

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -12,6 +12,7 @@
 import os
 import re
 import ssl
+import warnings
 
 from .i18n import _
 from .pycompat import getattr
@@ -308,14 +309,38 @@
 # bundle with a specific CA cert removed. If the system/default CA bundle
 # is loaded and contains that removed CA, you've just undone the user's
 # choice.
-#
-# Despite its name, PROTOCOL_SSLv23 selects the highest protocol that both
-# ends support, including TLS protocols. commonssloptions() restricts the
-# set of allowed protocols.
-sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-sslcontext.options |= commonssloptions(settings[b'minimumprotocol'])
+
+if util.safehasattr(ssl, 'PROTOCOL_TLS_CLIENT'):
+# python 3.7+
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
+minimumprotocol = settings[b'minimumprotocol']
+if minimumprotocol == b'tls1.0':
+with warnings.catch_warnings():
+warnings.filterwarnings('ignore', 'ssl.TLSVersion.TLSv1 is 
deprecated', DeprecationWarning)
+sslcontext.minimum_version = ssl.TLSVersion.TLSv1
+elif minimumprotocol == b'tls1.1':
+with warnings.catch_warnings():
+warnings.filterwarnings('ignore', 'ssl.TLSVersion.TLSv1_1 is 
deprecated', DeprecationWarning)
+sslcontext.minimum_version = ssl.TLSVersion.TLSv1_1
+elif minimumprotocol == b'tls1.2':
+sslcontext.minimum_version = ssl.TLSVersion.TLSv1_2
+else:
+raise error.Abort(_(b'this should not happen'))
+# Prevent CRIME.
+# There is no guarantee this attribute is defined on the module.
+sslcontext.options |= getattr(ssl, 'OP_NO_COMPRESSION', 0)
+else:
+# Despite its name, PROTOCOL_SSLv23 selects the highest protocol that 
both
+# ends support, including TLS protocols. commonssloptions() restricts 
the
+# set of allowed protocols.
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+sslcontext.options |= commonssloptions(settings[b'minimumprotocol'])
+
+# We check the hostname ourselves in _verifycert
+sslcontext.check_hostname = False
 sslcontext.verify_mode = settings[b'verifymode']
 
+
 if settings[b'ciphers']:
 try:
 sslcontext.set_ciphers(pycompat.sysstr(settings[b'ciphers']))
@@ -509,37 +534,69 @@
 _(b'referenced certificate file (%s) does not exist') % f
 )
 
-# Despite its name, PROTOCOL_SSLv23 selects the highest protocol that both
-# ends support, including TLS protocols. commonssloptions() restricts the
-# set of allowed protocols.
-protocol = ssl.PROTOCOL_SSLv23
-options = commonssloptions(b'tls1.0')
+if util.safehasattr(ssl, 'PROTOCOL_TLS_SERVER'):
+# python 3.7+
+sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
+sslcontext.options |= getattr(ssl, 'OP_NO_COMPRESSION', 0)
 
-# This config option is intended for use in tests only. It is a giant
-# footgun to kill security. Don't define it.
-exactprotocol = ui.config(b'devel', b'serverexactprotocol')
-if exactprotocol == b'tls1.0':
-if b'tls1.0' not in supportedprotocols:
-raise error.Abort(_(b'TLS 1.0 not supported by this Python'))
-protocol = ssl.PROTOCOL_TLSv1
-elif exactprotocol == b'tls1.1':
-if b'tls1.1' not in supportedprotocols:
-raise error.Abort(_(b'TLS 1.1 not supported by this Python'))
-protocol = ssl.PROTOCOL_TLSv1_1
-elif exactprotocol == b'tls1.2':
-if b'tls1.2' not in supportedprotocols:
-raise error.Abort(_(b'TLS 1.2 not supported by this Python'))
-protocol = ssl.PROTOCOL_TLSv1_2
-elif exactprotocol:
-raise error.Abort(
-_(b'invalid value for serverexactprotocol: %s') % exactprotocol
-)
+# This config option is intended for use in tests only. It is a giant
+# footgun to kill security. Don't define it.
+exactprotocol = ui.config(b'devel', b'serverexactprotocol')
+if exactprotocol == b'tls1.0':
+if b'tls1.0' not in supportedprotocols:
+raise error.Abort(_(b'TLS 1.0 not supported by this Python'))
+with warnings.catch_warnings():
+warnings.filterwarnings('ignore', 'ssl.TLSVersion.TLSv1 is 
deprecated', D

D12487: zeroconf: fix deprecation warning with python 3.10

2022-04-09 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  threading.condition.notifyAll → threading.condition.notify_all

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12487

AFFECTED FILES
  hgext/zeroconf/Zeroconf.py

CHANGE DETAILS

diff --git a/hgext/zeroconf/Zeroconf.py b/hgext/zeroconf/Zeroconf.py
--- a/hgext/zeroconf/Zeroconf.py
+++ b/hgext/zeroconf/Zeroconf.py
@@ -1459,7 +1459,7 @@
 def notifyAll(self):
 """Notifies all waiting threads"""
 self.condition.acquire()
-self.condition.notifyAll()
+self.condition.notify_all()
 self.condition.release()
 
 def getServiceInfo(self, type, name, timeout=3000):



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12377: test: update test-clone-stream.t to pass on bigendian

2022-03-15 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Fixes: a3cf460a6b1b 
 
("stream-clone: also filter the requirement we put in the bundle 2")

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D12377

AFFECTED FILES
  tests/test-clone-stream.t

CHANGE DETAILS

diff --git a/tests/test-clone-stream.t b/tests/test-clone-stream.t
--- a/tests/test-clone-stream.t
+++ b/tests/test-clone-stream.t
@@ -317,7 +317,7 @@
 #if zstd no-rust
   $ f --size --hex --bytes 256 body
   body: size=116310
-  body: size=116335 (bigendian !)
+  body: size=116305 (bigendian !)
   : 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20...|
   0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2...|
   0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |@bytecount10|



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12376: revlog: fix index_fast_rank (wip)

2022-03-15 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  As far as I can tell, rank is stored as a 32-bit big endian value, I'm
  not sure how grabbing the first byte can possibly work.  I assume
  there's no test coverage here?
  
  cc @pacien
  
  Fixes: https://www.mercurial-scm.org/repo/hg/rev/e633e660158f

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12376

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -588,7 +588,7 @@
return 0; /* convention */
}
 
-   return *(index_deref(self, pos) + entry_cl2_offset_rank);
+   return getbe32(index_deref(self, pos) + entry_cl2_offset_rank);
 }
 
 /*



To: jcristau, #hg-reviewers
Cc: pacien, mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D12374: revlog: fix wrong type of rank_unknown variable

2022-03-14 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We treat "rank" as an int everywhere, but declare rank_unknown as a
  char.  On architectures where char is signed, that works out ok, but
  when char is unsigned, rank_unknown is 255 instead of -1.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D12374

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -179,7 +179,7 @@
 /* next free offset: 73 */
 
 static const char comp_mode_inline = 2;
-static const char rank_unknown = -1;
+static const int rank_unknown = -1;
 
 static void raise_revlog_error(void)
 {



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D11335: revlog: fix more type confusion in index_replace_sidedata_info (issue6580)

2021-08-24 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We were telling python that "rev" was a Py_ssize_t (via the "n" format),
  but it was actually an int.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D11335

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -535,7 +535,8 @@
 static PyObject *index_replace_sidedata_info(indexObject *self, PyObject *args)
 {
uint64_t offset_flags, sidedata_offset;
-   int rev, sidedata_comp_len;
+   Py_ssize_t rev;
+   int sidedata_comp_len;
char comp_mode;
char *data;
 #if LONG_MAX == 0x7fffL



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D11334: revlog: fix type confusion with sidedata_comp_len (issue 6580)

2021-08-24 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The format string uses "i" (int) for sidedata_comp_len, so we shouldn't
  be passing a pointer to Py_ssize_t to PyArg_ParseTuple.  On 64-bit
  big-endian, this would result in python only writing to the upper 32
  bits, and things go downhill from there.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D11334

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -452,9 +452,9 @@
 static PyObject *index_append(indexObject *self, PyObject *obj)
 {
uint64_t offset_flags, sidedata_offset;
-   int rev, comp_len, uncomp_len, base_rev, link_rev, parent_1, parent_2;
+   int rev, comp_len, uncomp_len, base_rev, link_rev, parent_1, parent_2, 
sidedata_comp_len;
char data_comp_mode, sidedata_comp_mode;
-   Py_ssize_t c_node_id_len, sidedata_comp_len;
+   Py_ssize_t c_node_id_len;
const char *c_node_id;
char comp_field;
char *data;
@@ -534,9 +534,8 @@
 static PyObject *index_replace_sidedata_info(indexObject *self, PyObject *args)
 {
uint64_t offset_flags, sidedata_offset;
-   int rev;
+   int rev, sidedata_comp_len;
char comp_mode;
-   Py_ssize_t sidedata_comp_len;
char *data;
 #if LONG_MAX == 0x7fffL
const char *const sidedata_format = PY23("nKiKB", "nKiKB");



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8664: test: redirect stderr so warning messages don't cause changed output (issue6237)

2020-06-25 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  clone and commit race for the lock, and if commit has to wait more than
  a second it prints a warning to stderr.  Since this is somewhat expected
  here, silence it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8664

AFFECTED FILES
  tests/test-clone-uncompressed.t

CHANGE DETAILS

diff --git a/tests/test-clone-uncompressed.t b/tests/test-clone-uncompressed.t
--- a/tests/test-clone-uncompressed.t
+++ b/tests/test-clone-uncompressed.t
@@ -407,7 +407,7 @@
   $ sleep 1
   $ echo >> repo/f1
   $ echo >> repo/f2
-  $ hg -R repo ci -m "1"
+  $ hg -R repo ci -m "1" 2>/dev/null
   $ wait
   $ hg -R clone id
   



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8571: test: make test-doctest.py not assume it's run from a mercurial repo

2020-05-19 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This assumption fails when building and running tests from a source
  tarball, e.g.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8571

AFFECTED FILES
  tests/test-doctest.py

CHANGE DETAILS

diff --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -6,7 +6,6 @@
 import doctest
 import os
 import re
-import subprocess
 import sys
 
 ispy3 = sys.version_info[0] >= 3
@@ -70,11 +69,18 @@
 
 fileset = 'set:(**.py)'
 
-cwd = os.path.dirname(os.environ["TESTDIR"])
+if ispy3:
+cwd = os.path.dirname(os.environb[b"TESTDIR"])
+else:
+cwd = os.path.dirname(os.environ["TESTDIR"])
 
-files = subprocess.check_output(
-"hg files --print0 \"%s\"" % fileset, shell=True, cwd=cwd,
-).split(b'\0')
+files = []
+for dirpath, dirnames, filenames in os.walk(cwd):
+dotdirindexes = reversed([i for i, dir in enumerate(dirnames) if 
dir.startswith(b'.')])
+for i in dotdirindexes:
+del dirnames[i]
+# include all .py files, removing the cwd + dirsep prefix
+files.extend(os.path.join(dirpath, f)[len(cwd) + 1:] for f in filenames if 
f.endswith(b'.py'))
 
 if sys.version_info[0] >= 3:
 cwd = os.fsencode(cwd)



To: jcristau, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8092: hghave: cache the result of gethgversion

2020-02-07 Thread jcristau (Julien Cristau)
Closed by commit rHG8607dc2aa686: hghave: cache the result of gethgversion 
(authored by jcristau).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8092?vs=19985&id=19998

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8092/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8092

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -307,13 +307,21 @@
 return False
 
 
-def gethgversion():
+def _gethgversion():
 m = matchoutput('hg --version --quiet 2>&1', br'(\d+)\.(\d+)')
 if not m:
 return (0, 0)
 return (int(m.group(1)), int(m.group(2)))
 
 
+_hgversion = None
+def gethgversion():
+global _hgversion
+if _hgversion is None:
+_hgversion = _gethgversion()
+return _hgversion
+
+
 @checkvers(
 "hg", "Mercurial >= %s", list([(1.0 * x) / 10 for x in range(9, 99)])
 )



To: jcristau, #hg-reviewers, marmoute, pulkit
Cc: pulkit, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8092: hghave: cache the result of gethgversion

2020-02-07 Thread jcristau (Julien Cristau)
jcristau added a comment.


  It fixes a longstanding issue in tests, it's not particularly urgent IMO.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8092/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8092

To: jcristau, #hg-reviewers, marmoute
Cc: pulkit, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8092: hghave: cache the result of gethgversion

2020-02-07 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  hghave --test-features calls it 90 times, each one calling hg --version
  which takes a tenth of a second on my workstation, adding up to about
  10s win on test-hghave.t.
  
  Fixes https://bugs.debian.org/939756

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8092

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -307,13 +307,21 @@
 return False
 
 
-def gethgversion():
+def _gethgversion():
 m = matchoutput('hg --version --quiet 2>&1', br'(\d+)\.(\d+)')
 if not m:
 return (0, 0)
 return (int(m.group(1)), int(m.group(2)))
 
 
+_hgversion = None
+def gethgversion():
+global _hgversion
+if _hgversion is None:
+_hgversion = _gethgversion()
+return _hgversion
+
+
 @checkvers(
 "hg", "Mercurial >= %s", list([(1.0 * x) / 10 for x in range(9, 99)])
 )



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7541: mail: use procutil.shellsplit instead of bytes.split to parse command

2019-12-10 Thread jcristau (Julien Cristau)
Closed by commit rHG8f26dd09aa78: mail: use procutil.shellsplit instead of 
bytes.split to parse command (authored by jcristau).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7541?vs=18419&id=18576

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7541/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7541

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -197,7 +197,7 @@
 raise error.Abort(
 b'%s %s'
 % (
-os.path.basename(program.split(None, 1)[0]),
+os.path.basename(procutil.shellsplit(program)[0]),
 procutil.explainexit(ret),
 )
 )



To: jcristau, #hg-reviewers, pulkit
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7556: tests: remove hardcoded errno values

2019-12-06 Thread jcristau (Julien Cristau)
jcristau added a comment.


  I think default is good enough.

REPOSITORY
  rHG Mercurial

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7556/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7556

To: jcristau, #hg-reviewers, pulkit
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7556: tests: remove hardcoded errno values

2019-12-06 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Fixes test failures on hurd-i386
  
  Ref: https://bugs.debian.org/946178

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7556

AFFECTED FILES
  tests/test-largefiles-misc.t
  tests/test-lfs-serve-access.t
  tests/test-lfs.t
  tests/test-repair-strip.t

CHANGE DETAILS

diff --git a/tests/test-repair-strip.t b/tests/test-repair-strip.t
--- a/tests/test-repair-strip.t
+++ b/tests/test-repair-strip.t
@@ -51,7 +51,7 @@
   transaction abort!
   failed to truncate data/b.i
   rollback failed - please run hg recover
-  (failure reason: [Errno 13] Permission denied .hg/store/data/b.i')
+  (failure reason: [Errno *] Permission denied .hg/store/data/b.i') (glob)
   strip failed, backup bundle
   abort: Permission denied .hg/store/data/b.i'
   % after update 0, strip 2
@@ -105,7 +105,7 @@
   transaction abort!
   failed to truncate 00manifest.i
   rollback failed - please run hg recover
-  (failure reason: [Errno 13] Permission denied .hg/store/00manifest.i')
+  (failure reason: [Errno *] Permission denied .hg/store/00manifest.i') (glob)
   strip failed, backup bundle
   abort: Permission denied .hg/store/00manifest.i'
   % after update 0, strip 2
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -40,7 +40,7 @@
   > EOF
 
   $ hg config extensions
-  *** failed to import extension lfs from missing.py: [Errno 2] $ENOENT$: 
'missing.py'
+  \*\*\* failed to import extension lfs from missing.py: [Errno *] $ENOENT$: 
'missing.py' (glob)
   abort: repository requires features unknown to this Mercurial: lfs!
   (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
   [255]
diff --git a/tests/test-lfs-serve-access.t b/tests/test-lfs-serve-access.t
--- a/tests/test-lfs-serve-access.t
+++ b/tests/test-lfs-serve-access.t
@@ -341,13 +341,13 @@
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  verifies = store.verify(oid) (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  raise IOError(errno.EIO, r'%s: I/O 
error' % oid.decode("utf-8")) (glob)
-  $LOCALIP - - [$ERRDATE$] HG error:  *Error: [Errno 5] 
f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error 
(glob)
+  $LOCALIP - - [$ERRDATE$] HG error:  *Error: [Errno *] 
f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error 
(glob)
   $LOCALIP - - [$ERRDATE$] HG error:   (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Exception happened while processing 
request '/.git/info/lfs/objects/batch': (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  verifies = store.verify(oid) (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  raise IOError(errno.EIO, r'%s: I/O 
error' % oid.decode("utf-8")) (glob)
-  $LOCALIP - - [$ERRDATE$] HG error:  *Error: [Errno 5] 
b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error 
(glob)
+  $LOCALIP - - [$ERRDATE$] HG error:  *Error: [Errno *] 
b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error 
(glob)
   $LOCALIP - - [$ERRDATE$] HG error:   (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Exception happened while processing 
request 
'/.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c':
 (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)
@@ -369,7 +369,7 @@
   res.setbodybytes(localstore.read(oid))
   blob = self._read(self.vfs, oid, verify)
   raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
-  *Error: [Errno 5] 
276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error 
(glob)
+  *Error: [Errno *] 
276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error 
(glob)
   
   $LOCALIP - - [$ERRDATE$] HG error:  Exception happened while processing 
request 
'/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d':
 (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)
diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t
--- a/tests/test-largefiles-misc.t
+++ b/tests/test-largefiles-misc.t
@@ -41,7 +41,7 @@
   > EOF
 
   $ hg config extensions
-  *** failed to import extension largefiles from missing.py: [Errno 2] 
$ENOENT$: 'missing.py'
+  \*\*\* failed to import extension largefiles from missing.py: [Errno *] 
$ENOENT$: 'missing.py' (glob)
   abort: repository requires features unknown to this Mercurial: largefiles!
   (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
   [255]



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https:/

D7542: mail: don't complain about a multi-word email.method

2019-12-03 Thread jcristau (Julien Cristau)
jcristau added a comment.
jcristau planned changes to this revision.


  doh.  Right you are.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7542/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7542

To: jcristau, #hg-reviewers
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7542: mail: don't complain about a multi-word email.method

2019-12-02 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I want to be able to set email.method to "ssh relay /usr/sbin/sendmail"
  without needing an extra trivial shell script.
  This works fine since we pass the full command to a shell, except for
  validateconfig trying to find it in $PATH.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7542

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -246,9 +246,10 @@
 )
 )
 else:
-if not procutil.findexe(method):
+command = procutil.shellsplit(method)
+if not (command and procutil.findexe(command[0])):
 raise error.Abort(
-_(b'%r specified as email transport, but not in PATH') % method
+_(b'%r specified as email transport, but not in PATH') % 
command[0]
 )
 
 



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7541: mail: use procutil.shellsplit instead of bytes.split to parse command

2019-12-02 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7541

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -197,7 +197,7 @@
 raise error.Abort(
 b'%s %s'
 % (
-os.path.basename(program.split(None, 1)[0]),
+os.path.basename(procutil.shellsplit(program)[0]),
 procutil.explainexit(ret),
 )
 )



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7302: zeroconf: improve the extension's documentation

2019-11-07 Thread jcristau (Julien Cristau)
jcristau added a comment.


  FWIW Debian's been carrying this patch for 10 years.  Submitting it now as 
suggested by Augie, so I can drop it downstream whether it's accepted or not. :)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7302/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7302

To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7302: zeroconf: improve the extension's documentation

2019-11-07 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7302

AFFECTED FILES
  hgext/zeroconf/__init__.py

CHANGE DETAILS

diff --git a/hgext/zeroconf/__init__.py b/hgext/zeroconf/__init__.py
--- a/hgext/zeroconf/__init__.py
+++ b/hgext/zeroconf/__init__.py
@@ -6,9 +6,9 @@
 # GNU General Public License version 2 or any later version.
 '''discover and advertise repositories on the local network
 
-Zeroconf-enabled repositories will be announced in a network without
-the need to configure a server or a service. They can be discovered
-without knowing their actual IP address.
+The zeroconf extension will advertise :hg:`serve` instances over
+DNS-SD so that they can be discovered using the :hg:`paths` command
+without knowing the server's IP address.
 
 To allow other people to discover your repository using run
 :hg:`serve` in your repository::



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6787: test: allow different result for zstd compression (issue6188)

2019-09-07 Thread jcristau (Julien Cristau)
Closed by commit rHGda2c360899c9: test: allow different result for zstd 
compression (issue6188) (authored by jcristau).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6787?vs=16390&id=16432

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6787/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6787

AFFECTED FILES
  tests/test-repo-compengines.t

CHANGE DETAILS

diff --git a/tests/test-repo-compengines.t b/tests/test-repo-compengines.t
--- a/tests/test-repo-compengines.t
+++ b/tests/test-repo-compengines.t
@@ -171,7 +171,7 @@
   $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/*
   zstd-level-1/.hg/store/data/a.i: size=4097
   zstd-level-22/.hg/store/data/a.i: size=4091
-  zstd-level-default/.hg/store/data/a.i: size=4094
+  zstd-level-default/\.hg/store/data/a\.i: size=(4094|4102) (re)
 
 Test error cases
 



To: jcristau, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6787: test: allow different result for zstd compression (issue6188)

2019-09-06 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  test-repo-compengines fails on big-endian due to different file size,
  but the repo doesn't seem broken, so allow both sizes.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6787

AFFECTED FILES
  tests/test-repo-compengines.t

CHANGE DETAILS

diff --git a/tests/test-repo-compengines.t b/tests/test-repo-compengines.t
--- a/tests/test-repo-compengines.t
+++ b/tests/test-repo-compengines.t
@@ -171,7 +171,7 @@
   $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/*
   zstd-level-1/.hg/store/data/a.i: size=4097
   zstd-level-22/.hg/store/data/a.i: size=4091
-  zstd-level-default/.hg/store/data/a.i: size=4094
+  zstd-level-default/\.hg/store/data/a\.i: size=(4094|4102) (re)
 
 Test error cases
 



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5934: phabricator: make user searches case-insensitive

2019-02-15 Thread jcristau (Julien Cristau)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG570e62f1dcf2: phabricator: make user searches 
case-insensitive (authored by jcristau, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5934?vs=14030&id=14110

REVISION DETAIL
  https://phab.mercurial-scm.org/D5934

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -450,12 +450,13 @@
 
 def userphids(repo, names):
 """convert user names to PHIDs"""
+names = [name.lower() for name in names]
 query = {b'constraints': {b'usernames': names}}
 result = callconduit(repo, b'user.search', query)
 # username not found is not an error of the API. So check if we have missed
 # some names here.
 data = result[r'data']
-resolved = set(entry[r'fields'][r'username'] for entry in data)
+resolved = set(entry[r'fields'][r'username'].lower() for entry in data)
 unresolved = set(names) - resolved
 if unresolved:
 raise error.Abort(_(b'unknown username: %s')



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5934: phabricator: make user searches case-insensitive

2019-02-11 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  User names in conduit are case insensitive, but when looking for "FOO"
  it would return "foo" instead and we'd think the user didn't exist.  So
  lower case both the query and the response when comparing them.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5934

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -450,12 +450,13 @@
 
 def userphids(repo, names):
 """convert user names to PHIDs"""
+names = [name.lower() for name in names]
 query = {b'constraints': {b'usernames': names}}
 result = callconduit(repo, b'user.search', query)
 # username not found is not an error of the API. So check if we have missed
 # some names here.
 data = result[r'data']
-resolved = set(entry[r'fields'][r'username'] for entry in data)
+resolved = set(entry[r'fields'][r'username'].lower() for entry in data)
 unresolved = set(names) - resolved
 if unresolved:
 raise error.Abort(_(b'unknown username: %s')



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5412: test: fix test-http-bad-server with current python 2.7

2018-12-12 Thread jcristau (Julien Cristau)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG21f5810df848: test: fix test-http-bad-server with current 
python 2.7 (authored by jcristau, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5412?vs=12824&id=12825

REVISION DETAIL
  https://phab.mercurial-scm.org/D5412

AFFECTED FILES
  tests/test-http-bad-server.t

CHANGE DETAILS

diff --git a/tests/test-http-bad-server.t b/tests/test-http-bad-server.t
--- a/tests/test-http-bad-server.t
+++ b/tests/test-http-bad-server.t
@@ -69,7 +69,7 @@
   $ cat hg.pid > $DAEMON_PIDS
 
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -85,7 +85,7 @@
   $ hg serve --config badserver.closeafterrecvbytes=40 -p $HGPORT -d 
--pid-file=hg.pid -E error.log
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -102,7 +102,7 @@
   $ hg serve --config badserver.closeafterrecvbytes=210,223 -p $HGPORT -d 
--pid-file=hg.pid -E error.log
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -141,7 +141,7 @@
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
   requesting all changes
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -200,7 +200,7 @@
   $ cat hg.pid > $DAEMON_PIDS
 
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS



To: jcristau, #hg-reviewers
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5412: test: fix test-http-bad-server with current python 2.7

2018-12-11 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  https://github.com/python/cpython/pull/2825 changed the exception
  message for empty http status line.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5412

AFFECTED FILES
  tests/test-http-bad-server.t

CHANGE DETAILS

diff --git a/tests/test-http-bad-server.t b/tests/test-http-bad-server.t
--- a/tests/test-http-bad-server.t
+++ b/tests/test-http-bad-server.t
@@ -69,7 +69,7 @@
   $ cat hg.pid > $DAEMON_PIDS
 
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -85,7 +85,7 @@
   $ hg serve --config badserver.closeafterrecvbytes=40 -p $HGPORT -d 
--pid-file=hg.pid -E error.log
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -102,7 +102,7 @@
   $ hg serve --config badserver.closeafterrecvbytes=210,223 -p $HGPORT -d 
--pid-file=hg.pid -E error.log
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -141,7 +141,7 @@
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
   requesting all changes
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -200,7 +200,7 @@
   $ cat hg.pid > $DAEMON_PIDS
 
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: bad HTTP status line: ''
+  abort: error: bad HTTP status line: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3538: bdiff: fix yet more fallout from xdiff long/int64 conversion (issue5885)

2018-05-13 Thread jcristau (Julien Cristau)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG273ea09f6550: bdiff: fix yet more fallout from xdiff 
long/int64 conversion (issue5885) (authored by jcristau, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3538?vs=8658&id=8679

REVISION DETAIL
  https://phab.mercurial-scm.org/D3538

AFFECTED FILES
  mercurial/cext/bdiff.c

CHANGE DETAILS

diff --git a/mercurial/cext/bdiff.c b/mercurial/cext/bdiff.c
--- a/mercurial/cext/bdiff.c
+++ b/mercurial/cext/bdiff.c
@@ -261,7 +261,7 @@
  void *priv)
 {
PyObject *rl = (PyObject *)priv;
-   PyObject *m = Py_BuildValue("", a1, a2, b1, b2);
+   PyObject *m = Py_BuildValue("", a1, a2, b1, b2);
if (!m)
return -1;
if (PyList_Append(rl, m) != 0) {



To: jcristau, #hg-reviewers, quark, durin42
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3538: bdiff: fix yet more fallout from xdiff long/int64 conversion (issue5885)

2018-05-12 Thread jcristau (Julien Cristau)
jcristau created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  "l" in Py_BuildValue's format string means long, so passing int64_t
  instead results in fireworks on 32bit architectures.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3538

AFFECTED FILES
  mercurial/cext/bdiff.c

CHANGE DETAILS

diff --git a/mercurial/cext/bdiff.c b/mercurial/cext/bdiff.c
--- a/mercurial/cext/bdiff.c
+++ b/mercurial/cext/bdiff.c
@@ -261,7 +261,7 @@
  void *priv)
 {
PyObject *rl = (PyObject *)priv;
-   PyObject *m = Py_BuildValue("", a1, a2, b1, b2);
+   PyObject *m = Py_BuildValue("", a1, a2, b1, b2);
if (!m)
return -1;
if (PyList_Append(rl, m) != 0) {



To: jcristau, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel