[PATCH 4 of 4 chg-tests-fix] commandserver: handle IOError related to flushing of streams

2020-12-07 Thread Pulkit Goyal
# HG changeset patch
# User Pulkit Goyal <7895pul...@gmail.com>
# Date 1606996129 -19800
#  Thu Dec 03 17:18:49 2020 +0530
# Node ID acdb053888ab7564b6b7fc702f94334ef854861c
# Parent  263a5b17b4cad2e793817bd30944dcfcebc88a69
# EXP-Topic chg-test
commandserver: handle IOError related to flushing of streams

After dispatch, without chg we have handling of flushing of streams and
exception handling related to it. The exception handling part is important
because there can be exceptions when flushing fout or ferr.

One such case is in `test-basic.t` which was failing on python3+chg without this
patch as this handling was missing from chg.

Failure can be seen at
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/128399

Honestly I am not sure which one of `chgserver.py` or `commandserver.py` the
change should go in.

Differential Revision: https://phab.mercurial-scm.org/D9517

diff -r 263a5b17b4ca -r acdb053888ab mercurial/commandserver.py
--- a/mercurial/commandserver.pyWed Dec 02 14:27:45 2020 +0530
+++ b/mercurial/commandserver.pyThu Dec 03 17:18:49 2020 +0530
@@ -355,7 +355,18 @@
 )
 
 try:
-ret = self._dispatchcommand(req) & 255
+err = None
+try:
+status = self._dispatchcommand(req)
+except error.StdioError as e:
+status = -1
+err = e
+
+retval = dispatch.closestdio(req.ui, err)
+if retval:
+status = retval
+
+ret = status & 255
 # If shutdown-on-interrupt is off, it's important to write the
 # result code *after* SIGINT handler removed. If the result code
 # were lost, the client wouldn't be able to continue processing.
diff -r 263a5b17b4ca -r acdb053888ab mercurial/dispatch.py
--- a/mercurial/dispatch.py Wed Dec 02 14:27:45 2020 +0530
+++ b/mercurial/dispatch.py Thu Dec 03 17:18:49 2020 +0530
@@ -104,6 +104,35 @@
 raise exc
 
 
+def closestdio(ui, err):
+status = None
+# In all cases we try to flush stdio streams.
+if util.safehasattr(ui, b'fout'):
+assert ui is not None  # help pytype
+assert ui.fout is not None  # help pytype
+try:
+ui.fout.flush()
+except IOError as e:
+err = e
+status = -1
+
+if util.safehasattr(ui, b'ferr'):
+assert ui is not None  # help pytype
+assert ui.ferr is not None  # help pytype
+try:
+if err is not None and err.errno != errno.EPIPE:
+ui.ferr.write(
+b'abort: %s\n' % encoding.strtolocal(err.strerror)
+)
+ui.ferr.flush()
+# There's not much we can do about an I/O error here. So (possibly)
+# change the status code and move on.
+except IOError:
+status = -1
+
+return status
+
+
 def run():
 """run the command in sys.argv"""
 try:
@@ -117,30 +146,9 @@
 err = e
 status = -1
 
-# In all cases we try to flush stdio streams.
-if util.safehasattr(req.ui, b'fout'):
-assert req.ui is not None  # help pytype
-assert req.ui.fout is not None  # help pytype
-try:
-req.ui.fout.flush()
-except IOError as e:
-err = e
-status = -1
-
-if util.safehasattr(req.ui, b'ferr'):
-assert req.ui is not None  # help pytype
-assert req.ui.ferr is not None  # help pytype
-try:
-if err is not None and err.errno != errno.EPIPE:
-req.ui.ferr.write(
-b'abort: %s\n' % encoding.strtolocal(err.strerror)
-)
-req.ui.ferr.flush()
-# There's not much we can do about an I/O error here. So (possibly)
-# change the status code and move on.
-except IOError:
-status = -1
-
+ret = closestdio(req.ui, err)
+if ret:
+status = ret
 _silencestdio()
 except KeyboardInterrupt:
 # Catch early/late KeyboardInterrupt as last ditch. Here nothing will
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 4 chg-tests-fix] tests: conditionalize output in test-ssh.t with chg+py3

2020-12-07 Thread Pulkit Goyal
# HG changeset patch
# User Pulkit Goyal <7895pul...@gmail.com>
# Date 1606899465 -19800
#  Wed Dec 02 14:27:45 2020 +0530
# Node ID 263a5b17b4cad2e793817bd30944dcfcebc88a69
# Parent  0285e852fcf28d9a44d725fd737cbf031d308fe0
# EXP-Topic chg-test
tests: conditionalize output in test-ssh.t with chg+py3

Because of our wrapping around sys.std* and python3 internal buffering, the
output order changes. The change in order seems like harmless because just few
lines above the same command is run which results in same output.

This makes `test-ssh.t` works with --chg on python 3.

Differential Revision: https://phab.mercurial-scm.org/D9502

diff -r 0285e852fcf2 -r 263a5b17b4ca tests/test-ssh.t
--- a/tests/test-ssh.t  Wed Dec 02 14:19:09 2020 +0530
+++ b/tests/test-ssh.t  Wed Dec 02 14:27:45 2020 +0530
@@ -331,9 +331,10 @@
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files (py3 !)
   remote: KABOOM
   remote: KABOOM IN PROCESS
-  remote: added 1 changesets with 1 changes to 1 files
+  remote: added 1 changesets with 1 changes to 1 files (no-py3 !)
 
 #endif
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 4 chg-tests-fix] dispatch: disable line ending normalization on sys.stdin if its None

2020-12-07 Thread Pulkit Goyal
# HG changeset patch
# User Pulkit Goyal <7895pul...@gmail.com>
# Date 1606898949 -19800
#  Wed Dec 02 14:19:09 2020 +0530
# Node ID 0285e852fcf28d9a44d725fd737cbf031d308fe0
# Parent  6bab1270ddc9b7097a58de39afacb305f3364ea7
# EXP-Topic chg-test
dispatch: disable line ending normalization on sys.stdin if its None

Fixes test-chg.t on python 3 with chg.

Differential Revision: https://phab.mercurial-scm.org/D9501

diff -r 6bab1270ddc9 -r 0285e852fcf2 mercurial/dispatch.py
--- a/mercurial/dispatch.py Wed Dec 02 13:55:17 2020 +0530
+++ b/mercurial/dispatch.py Wed Dec 02 14:19:09 2020 +0530
@@ -187,15 +187,16 @@
 sys.stderr.buffer, sys.stderr.encoding, sys.stderr.errors, **kwargs
 )
 
-# No write_through on read-only stream.
-sys.stdin = io.TextIOWrapper(
-sys.stdin.buffer,
-sys.stdin.encoding,
-sys.stdin.errors,
-# None is universal newlines mode.
-newline=None,
-line_buffering=sys.stdin.line_buffering,
-)
+if sys.stdin is not None:
+# No write_through on read-only stream.
+sys.stdin = io.TextIOWrapper(
+sys.stdin.buffer,
+sys.stdin.encoding,
+sys.stdin.errors,
+# None is universal newlines mode.
+newline=None,
+line_buffering=sys.stdin.line_buffering,
+)
 
 def _silencestdio():
 for fp in (sys.stdout, sys.stderr):
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 4 chg-tests-fix] procutils: don't try to get `.buffer` if sys.stdin is None

2020-12-07 Thread Pulkit Goyal
# HG changeset patch
# User Pulkit Goyal <7895pul...@gmail.com>
# Date 1606897517 -19800
#  Wed Dec 02 13:55:17 2020 +0530
# Node ID 6bab1270ddc9b7097a58de39afacb305f3364ea7
# Parent  8b20d469a0c819c2ade8635c25e9fcf0af553796
# EXP-Topic chg-test
procutils: don't try to get `.buffer` if sys.stdin is None

While hunting down following test failure of test-chg.t on Python 3, I stumbled
the case when `.buffer` is not available as sys.stdin is None.

--- /home/pulkit/repo/hg-committed/tests/test-chg.t
+++ /home/pulkit/repo/hg-committed/tests/test-chg.t.err
@@ -203,7 +203,31 @@
   $ CHGDEBUG=1 chg version -q 0<&-
 chg: debug: * stdio fds are missing (glob)
 chg: debug: * execute original hg (glob)
 -  Mercurial Distributed SCM * (glob)
 +  Traceback (most recent call last):
 +File "/tmp/hgtests.avspvsq4/install/bin/hg", line 43, in 

 +  dispatch.run()
 +File "/usr/lib/python3.6/importlib/util.py", line 233, in
 __getattribute__
 +  self.__spec__.loader.exec_module(self)
 +File "", line 678, 
in
 exec_module
 +File "", line 219, in
 _call_with_frames_removed
 +File
 
"/tmp/hgtests.avspvsq4/install/lib/python/mercurial/dispatch.py", line
 726, in 
 +  class lazyaliasentry(object):
 +File
 
"/tmp/hgtests.avspvsq4/install/lib/python/mercurial/dispatch.py", line
 737, in lazyaliasentry
 +  @util.propertycache
 +File "/usr/lib/python3.6/importlib/util.py", line 233, in
 __getattribute__
 +  self.__spec__.loader.exec_module(self)
 +File "", line 678, 
in
 exec_module
 +File "", line 219, in
 _call_with_frames_removed
 +File 
"/tmp/hgtests.avspvsq4/install/lib/python/mercurial/util.py",
 line 3473, in 
 +  f=procutil.stderr,
 +File "/usr/lib/python3.6/importlib/util.py", line 233, in
 __getattribute__
 +  self.__spec__.loader.exec_module(self)
 +File "", line 678, 
in
 exec_module
 +File "", line 219, in
 _call_with_frames_removed
 +File
 
"/tmp/hgtests.avspvsq4/install/lib/python/mercurial/utils/procutil.py",
 line 127, in 
 +  stdin = sys.stdin.buffer
 +  AttributeError: 'NoneType' object has no attribute 'buffer'
 +  [1]

  server lifecycle
   

Differential Revision: https://phab.mercurial-scm.org/D9500

diff -r 8b20d469a0c8 -r 6bab1270ddc9 mercurial/utils/procutil.py
--- a/mercurial/utils/procutil.py   Fri Apr 03 20:30:36 2020 +0530
+++ b/mercurial/utils/procutil.py   Wed Dec 02 13:55:17 2020 +0530
@@ -124,7 +124,9 @@
 # Python 3 implements its own I/O streams.
 # TODO: .buffer might not exist if std streams were replaced; we'll need
 # a silly wrapper to make a bytes stream backed by a unicode one.
-stdin = sys.stdin.buffer
+
+# sys.stdin can be None
+stdin = sys.stdin.buffer if sys.stdin else sys.stdin
 stdout = _make_write_all(sys.stdout.buffer)
 stderr = _make_write_all(sys.stderr.buffer)
 if pycompat.iswindows:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] test-extension: flush diagnostic message to stabilize chg output

2020-12-07 Thread Pulkit Goyal
On Mon, Dec 7, 2020 at 5:26 PM Yuya Nishihara  wrote:
>
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1607339556 -32400
> #  Mon Dec 07 20:12:36 2020 +0900
> # Node ID e19bab808d0b3491121113509601f990fe5988f1
> # Parent  1bf2b44c40078c4e17479a1625c57370dc7750ec
> test-extension: flush diagnostic message to stabilize chg output
>
> Since chg server may create new file object for the attached stdout,
> procutil.stdout is not ui.fout and the buffered procutil.stdout data wouldn't
> be flushed at all. That's why test-extension.t passes without modification
> on Python 2.

Queued this, many thanks Yuya!
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D9543: run-tests: stuff a `python3.exe` into the test bin directory on Windows

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Windows doesn't have `python3.exe` as part of the python.org distribution, and
  that broke every script with a shebang after c102b704edb5 
.  
Windows itself
  provides a `python3.exe` app execution alias[1], but it is some sort of 
reparse
  point that MSYS is incapable of handling[2].  When run by MSYS, it simply 
prints
  
$ python3 -V
 - Cannot open
  
  That in turn caused every `hghave` check, and test that invokes shebang 
scripts
  directly, to fail.  Rather than try to patch up every script call to be 
invoked
  with `$PYTHON` (and regress when non Windows developers forget), copying the
  executable into the test binary directory with the new name just works.  Since
  this directory is prepended to the system PATH value, it also overrides the
  broken execution alias.  (The `_tmpbindir` is used instead of `_bindir` 
because
  the latter causes python3.exe to be copied into the repo next to hg.exe when
  `test-run-tests.t` runs.  Something runs with this version of the executable 
and
  subsequent runs of `run-tests.py` inside `test-run-tests.t` try to copy over 
it
  while it is in use, and fail.  This avoids the failures and the clutter.)
  
  I didn't conditionalize this on py3 because `python3.exe` needs to be present
  (for the shebangs) even when running py2 tests.  It shouldn't matter to these
  simple scripts, and I think the intention is to make the test runner use py3
  always, even if testing a py2 build.  For now, still supporting py2 is helping
  to clean up the mess that is py3 tests.
  
  [1] https://stackoverflow.com/a/57168165
  [2] 
https://stackoverflow.com/questions/59148628/solved-unable-to-run-python-3-7-on-windows-10-permission-denied#comment104524397_59148666

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -3466,6 +3466,16 @@
 if err.errno != errno.EEXIST:
 raise
 else:
+# Windows doesn't have `python3.exe`, and MSYS cannot understand 
the
+# reparse point with that name provided by Microsoft.  Copy the
+# current interpreter to PATH with that name so the shebang lines
+# work.
+if os.getenv('MSYSTEM'):
+shutil.copy(
+sys.executable,
+_bytes2sys(self._tmpbindir + b'/python3.exe'),
+)
+
 exedir, exename = os.path.split(sysexecutable)
 vlog(
 "# Modifying search path to find %s as %s in '%s'"



To: mharbison72, #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


D9542: run-tests: fix a typo in an attribute name

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  At least, I assume it's a typo.  Nothing else uses it, but `_tmpbindir` is 
used.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2948,7 +2948,7 @@
 self._hgtmp = None
 self._installdir = None
 self._bindir = None
-self._tmpbinddir = None
+self._tmpbindir = None
 self._pythondir = None
 self._coveragefile = None
 self._createdfiles = []



To: mharbison72, #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


D9539: tests: correct the output order about starting a background thread for Windows

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I didn't track down where this change occurred.  I assume it's related to some
  buffering changes, and/or an explicit flush somewhere.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-copy-move-merge.t
  tests/test-double-merge.t
  tests/test-graft.t
  tests/test-issue672.t
  tests/test-merge-commit.t
  tests/test-merge7.t
  tests/test-rename-merge1.t
  tests/test-rename-merge2.t
  tests/test-subrepo.t
  tests/test-up-local-change.t

CHANGE DETAILS

diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -70,8 +70,8 @@
ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
b: other deleted -> r
   removing b
+  starting 4 threads for background file closing (?)
preserving a for resolve of a
-  starting 4 threads for background file closing (?)
a: versions differ -> m (premerge)
   picked tool 'true' for a (binary False symlink False changedelete False)
   merging a
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -315,8 +315,8 @@
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
+  starting 4 threads for background file closing (?)
preserving t for resolve of t
-  starting 4 threads for background file closing (?)
t: versions differ -> m (premerge)
   picked tool ':merge' for t (binary False symlink False changedelete False)
   merging t
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -85,11 +85,10 @@
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
+  starting 4 threads for background file closing (?)
preserving a for resolve of b
preserving rev for resolve of rev
-  starting 4 threads for background file closing (?)
b: remote copied from a -> m (premerge)
-  starting 4 threads for background file closing (?)
   picked tool '* ../merge' for b (binary False symlink False changedelete 
False) (glob)
   merging a and b to b
   my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
@@ -165,10 +164,10 @@
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
+  starting 4 threads for background file closing (?)
preserving a for resolve of b
preserving rev for resolve of rev
   removing a
-  starting 4 threads for background file closing (?)
b: remote moved from a -> m (premerge)
   picked tool '* ../merge' for b (binary False symlink False changedelete 
False) (glob)
   merging a and b to b
@@ -204,9 +203,9 @@
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
+  starting 4 threads for background file closing (?)
preserving b for resolve of b
preserving rev for resolve of rev
-  starting 4 threads for background file closing (?)
b: local copied/moved from a -> m (premerge)
   picked tool '* ../merge' for b (binary False symlink False changedelete 
False) (glob)
   merging b and a to b
@@ -275,8 +274,8 @@
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
+  starting 4 threads for background file closing (?)
preserving rev for resolve of rev
-  starting 4 threads for background file closing (?)
rev: versions differ -> m (premerge)
   picked tool '* ../merge' for rev (binary False symlink False changedelete 
False) (glob)
   merging rev
@@ -341,8 +340,8 @@
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
+  starting 4 threads for background file closing (?)
preserving rev for resolve of rev
-  starting 4 threads for background file closing (?)
rev: versions differ -> m (premerge)
   picked tool '* ../merge' for rev (binary False symlink False changedelete 
False) (glob)
   merging rev
@@ -372,9 +371,9 @@
   resolving manifests
branchmerge: True, force: False, partial: False
ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
+  starting 4 threads for background file closing (?)
preserving b for resolve of b
preserving rev for resolve of rev
-  starting 4 threads for background file closing (?)
b: both renamed from a -> m (premerge)
   picked tool '* ../merge' for b (binary False symlink False changedelete 
False) (glob)
   merging b
@@ -454,9 +453,9 @@
   

D9541: tests: conditionalize the progress timestamp for Windows

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It looks like for py2 on Windows, the start date is 1970.  It matches the 
other
  platforms for py3, so I'm just going to match the tests and move on, given 
that
  py2 is on the way out.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-progress.t

CHANGE DETAILS

diff --git a/tests/test-progress.t b/tests/test-progress.t
--- a/tests/test-progress.t
+++ b/tests/test-progress.t
@@ -203,17 +203,23 @@
 
 test interaction with ui.timestamp-output
 
+XXX: The timestamp on Windows with py2 hg is in 1970, and py3 hg is now.  But
+the py2/py3 checks here test the test runner, not the binary.  The Windows 
lines
+can be dropped when switching to py3-only.
+
   $ hg loop --warn --config ui.timestamp-output=true 6
   \r (no-eol) (esc)
   loop [] 0/6\r (no-eol) (esc)
   \r (no-eol) (esc)
-  
\[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\]
 reached step 0 (re)
+  [*T*] reached step 0 (glob) (windows !)
+  
\[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\]
 reached step 0 (re) (no-windows !)
   \r (no-eol) (esc)
   loop [===>] 1/6\r (no-eol) (esc)
   loop [===>] 2/6\r (no-eol) (esc)
   loop [===>] 3/6\r (no-eol) (esc)
   \r (no-eol) (esc)
-  
\[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\]
 reached step 3 (re)
+  [*T*] reached step 3 (glob) (windows !)
+  
\[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\]
 reached step 3 (re) (no-windows !)
   \r (no-eol) (esc)
   loop [===>] 4/6\r (no-eol) (esc)
   loop [===>] 5/6\r (no-eol) (esc)



To: mharbison72, #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


D9538: tests: update the exit status codes for Windows specific tests

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This corresponds to 527ce85c2e60 
, 
ebee234d952a 
, 
and 568c05d8f3d2 
.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-casecollision-merge.t
  tests/test-clone.t
  tests/test-split.t

CHANGE DETAILS

diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -787,7 +787,7 @@
 
   $ printf 'y\ny\ny\n' | hg split
   abort: cannot split an empty revision
-  [255]
+  [10]
 #endif
 
 Test that splitting moves works properly (issue5723)
diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -625,7 +625,7 @@
 #if windows
   $ hg clone http://$LOCALIP:3121/a b
   abort: error: * (glob)
-  [255]
+  [100]
 #else
   $ hg clone http://$LOCALIP:3121/a b
   abort: error: *refused* (glob)
diff --git a/tests/test-casecollision-merge.t b/tests/test-casecollision-merge.t
--- a/tests/test-casecollision-merge.t
+++ b/tests/test-casecollision-merge.t
@@ -332,7 +332,7 @@
 
   $ hg update --check
   abort: uncommitted changes
-  [255]
+  [20]
 
   $ hg update --clean
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved



To: mharbison72, #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


D9540: tests: conditionalize a few Windows specific error messages

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 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/D9540

AFFECTED FILES
  tests/test-template-map.t

CHANGE DETAILS

diff --git a/tests/test-template-map.t b/tests/test-template-map.t
--- a/tests/test-template-map.t
+++ b/tests/test-template-map.t
@@ -139,7 +139,8 @@
   $ mkdir somedir
   $ echo "__base__ = somedir" > map-base-dir
   $ hg log -l1 -T./map-base-dir
-  abort: Is a directory: '$TESTTMP/a/somedir'
+  abort: Is a directory: '$TESTTMP/a/somedir' (no-windows !)
+  abort: $TESTTMP/a/somedir: Access is denied (windows !)
   [255]
 
 Test including a built-in template map
@@ -1279,7 +1280,8 @@
 Error if style is a directory:
 
   $ hg log --style somedir
-  abort: Is a directory: 'somedir'
+  abort: Is a directory: 'somedir' (no-windows !)
+  abort: somedir: Access is denied (windows !)
   [255]
 
 Error if style is a directory whose name is a built-in style:



To: mharbison72, #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


D9535: run-tests: extend PATH on Windows to include user installed scripts

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This allows the test environment to see pylint.exe when installed with
  `pip install --user`, since it isn't normally on PATH.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -3474,7 +3474,29 @@
 path = os.environ['PATH'].split(os.pathsep)
 while exedir in path:
 path.remove(exedir)
-os.environ['PATH'] = os.pathsep.join([exedir] + path)
+
+# Binaries installed by pip into the user area like pylint.exe may
+# not be in PATH by default.
+extra_paths = [exedir]
+vi = sys.version_info
+if 'APPDATA' in os.environ:
+scripts_dir = os.path.join(
+os.environ['APPDATA'],
+'Python',
+'Python%d%d' % (vi[0], vi[1]),
+'Scripts',
+)
+
+if vi.major == 2:
+scripts_dir = os.path.join(
+os.environ['APPDATA'],
+'Python',
+'Scripts',
+)
+
+extra_paths.append(scripts_dir)
+
+os.environ['PATH'] = os.pathsep.join(extra_paths + path)
 if not self._findprogram(pyexename):
 print("WARNING: Cannot find %s in search path" % pyexename)
 



To: mharbison72, #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


D9537: tests: drop the trailing exclamation point from some Windows abort messages

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This likely goes with 95c4cca641f6 
.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-clone.t

CHANGE DETAILS

diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -1192,14 +1192,14 @@
   sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !)
   sending hello command
   sending between command
-  abort: no suitable response from remote hg!
+  abort: no suitable response from remote hg
   [255]
   $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
   running sh -c "read l; read l; read l" -p " owned " example.com "hg -R 
. serve --stdio"
   sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !)
   sending hello command
   sending between command
-  abort: no suitable response from remote hg!
+  abort: no suitable response from remote hg
   [255]
 #else
   $ hg clone "ssh://%3btouch%20owned%20/" --debug



To: mharbison72, #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


D9536: tests: update output for test-check-pylint.t

2020-12-07 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The py3 version on Windows appends "(previous run: 10.00/10, +0.00)" with 
py39.
  I didn't see that for the exact same version on Linux (with py3.6.9).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-check-pylint.t

CHANGE DETAILS

diff --git a/tests/test-check-pylint.t b/tests/test-check-pylint.t
--- a/tests/test-check-pylint.t
+++ b/tests/test-check-pylint.t
@@ -17,6 +17,6 @@
   >   mercurial hgdemandimport hgext hgext3rd | sed 's/\r$//'
   Using config file *fakerc (glob) (?)
(?)
-   (?)
-  Your code has been rated at 10.00/10 (?)
+  * (glob) (?)
+  Your code has been rated at 10.00/10* (glob) (?)
(?)



To: mharbison72, #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


[Bug 6454] New: Rebase w/ dirty wdir + in-memory merge can lead to data loss

2020-12-07 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6454

Bug ID: 6454
   Summary: Rebase w/ dirty wdir + in-memory merge can lead to
data loss
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Mac OS
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: rebase
  Assignee: bugzi...@mercurial-scm.org
  Reporter: h...@pewpew.net
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

With in-memory merge turned on, and a dirty working directory, attempt to
rebase a commit that does not involve the wdir. This doesn't require a clean
wdir due to in-memory merge. However, if there's merge conflicts, you can get a
message like:

```
≻ hg rebase -r 42917 -d dest
rebasing 42917 26ec666f "callcatch: log error.Abort()s to ui.log"
merging mercurial/dispatch.py
merging mercurial/scmutil.py
hit merge conflicts; rebasing that commit again in the working copy
abort: uncommitted changes
```

At this point, rebase has already serialized the "Rebase in progress" state. If
I `hg diff`, I see the changes I had before I ran `hg rebase`. If I run `hg
commit`, it refuses (rebase in progress). If I run `hg rebase --abort`, it
doesn't realize that it must *not* clean the wdir, so it happily does so,
losing my data.

Luckily I didn't care about those changes, *and* I'd just run `hg diff` if I
had.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@46038: 7 new changesets

2020-12-07 Thread Mercurial Commits
7 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/8d6164098782
changeset:   46032:8d6164098782
user:Simon Sapin 
date:Mon Nov 30 19:34:49 2020 +0100
summary: rhg: allow specifying a changeset ID prefix

https://www.mercurial-scm.org/repo/hg/rev/88e741bf2d93
changeset:   46033:88e741bf2d93
user:Simon Sapin 
date:Wed Dec 02 15:00:49 2020 +0100
summary: rust: use NodePrefix::from_hex instead of hex::decode directly

https://www.mercurial-scm.org/repo/hg/rev/0c02c2a0badb
changeset:   46034:0c02c2a0badb
user:Simon Sapin 
date:Wed Dec 02 08:23:31 2020 +0100
summary: rhg: add a test with persistent-nodemap

https://www.mercurial-scm.org/repo/hg/rev/6c960b708ac4
changeset:   46035:6c960b708ac4
user:Pierre-Yves David 
date:Mon Nov 30 14:07:23 2020 +0100
summary: upgrade: display the list of processed revlog before proceeding

https://www.mercurial-scm.org/repo/hg/rev/8d54944eaeb0
changeset:   46036:8d54944eaeb0
user:Pierre-Yves David 
date:Fri Nov 20 10:51:07 2020 +0100
summary: copies: properly copies parent dictionary before updating it

https://www.mercurial-scm.org/repo/hg/rev/9624bf057c2a
changeset:   46037:9624bf057c2a
user:Matt Harbison 
date:Sat Nov 21 00:10:36 2020 -0500
summary: phabricator: allow local revisions to be specified with 
`phabupdate`

https://www.mercurial-scm.org/repo/hg/rev/8dca9051a859
changeset:   46038:8dca9051a859
bookmark:@
tag: tip
user:Gregory Szorc 
date:Sat Nov 07 16:28:30 2020 -0800
summary: cext: add .pyi files for C extensions

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D9534: debugsetparents: add various warning in the help message

2020-12-07 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I am tired to see people shooting themself in the foot with this. So lets add
  more warning. At that point we should probably rename it or add extra
  confirmation flag. This is a debug command anyway we can break BC on it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/debugcommands.py
  tests/test-help.t

CHANGE DETAILS

diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1063,6 +1063,7 @@
debugserverun a server with advanced settings
debugsetparents
  manually set the parents of the current working directory
+ (DANGEROUS)
debugsidedata
  dump the side data for a cl/manifest/file revision
debugssl  test a secure connection to a server
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -3412,12 +3412,22 @@
 
 @command(b'debugsetparents', [], _(b'REV1 [REV2]'))
 def debugsetparents(ui, repo, rev1, rev2=None):
-"""manually set the parents of the current working directory
-
-This is useful for writing repository conversion tools, but should
-be used with care. For example, neither the working directory nor the
-dirstate is updated, so file status may be incorrect after running this
-command.
+"""manually set the parents of the current working directory (DANGEROUS)
+
+This command is not what you are looking for and should not be used. Using
+this command will most certainly results in slight corruption of the file
+level histories withing your repository. DO NOT USE THIS COMMAND.
+
+The command update the p1 and p2 field in the dirstate, and not touching
+anything else. This useful for writing repository conversion tools, but
+should be used with extreme care. For example, neither the working
+directory nor the dirstate is updated, so file status may be incorrect
+after running this command. Only used if you are one of the few people that
+deeply unstand both conversion tools and file level histories. If you are
+reading this help, you are not one of this people (most of them sailed west
+from Mithlond anyway.
+
+So one last time DO NOT USE THIS COMMAND.
 
 Returns 0 on success.
 """



To: marmoute, #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


Re: [PATCH 1 of 2] bugzilla: fix reporting of exceptions with py3

2020-12-07 Thread Mads Kiilerich
These patches could be considered for stable. They could qualify, as 
they fix some obvious blockers and make the bugzilla extension work 
better with py3.


But there seems to be many other problems with bugzilla extension on 
py3. The extension is messing with internals of xmlrpclib, and the py3 
xmlrpm.client changed a lot. Porting will be a non-trivial development 
effort ... and that require someone who actually use the extension and 
have a test setup.


These changes are a spin-off from 
https://bugzilla.redhat.com/show_bug.cgi?id=1859043 .


/Mads

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2] bugzilla: pass the url to xmlrpclib.ServerProxy as str

2020-12-07 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1607032141 -3600
#  Thu Dec 03 22:49:01 2020 +0100
# Branch stable
# Node ID 6473ac822f918193dd39f43f054695d5d6321736
# Parent  a141d1da33433998590be226b6788fb53e8c90e0
bugzilla: pass the url to xmlrpclib.ServerProxy as str

diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -759,7 +759,9 @@ class bzxmlrpc(bzaccess):
 self.fixstatus = self.ui.config(b'bugzilla', b'fixstatus')
 self.fixresolution = self.ui.config(b'bugzilla', b'fixresolution')
 
-self.bzproxy = xmlrpclib.ServerProxy(bzweb, self.transport(bzweb))
+self.bzproxy = xmlrpclib.ServerProxy(
+pycompat.strurl(bzweb), self.transport(bzweb)
+)
 ver = self.bzproxy.Bugzilla.version()[b'version'].split(b'.')
 self.bzvermajor = int(ver[0])
 self.bzverminor = int(ver[1])

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 2] bugzilla: fix reporting of exceptions with py3

2020-12-07 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1607032141 -3600
#  Thu Dec 03 22:49:01 2020 +0100
# Branch stable
# Node ID a141d1da33433998590be226b6788fb53e8c90e0
# Parent  dadbd01f939379a2eea76eab313868fcde48138a
bugzilla: fix reporting of exceptions with py3

diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -1211,4 +1211,4 @@ def hook(ui, repo, hooktype, node=None, 
 bz.update(bug, bugs[bug], ctx)
 bz.notify(bugs, stringutil.email(ctx.user()))
 except Exception as e:
-raise error.Abort(_(b'Bugzilla error: %s') % e)
+raise error.Abort(_(b'Bugzilla error: %s') % 
stringutil.forcebytestr(e))

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial-devel | Pipeline #14086 has failed for branch/default | 321fdadc

2020-12-07 Thread Heptapod


Your pipeline has failed.

Project: mercurial-devel ( https://foss.heptapod.net/octobus/mercurial-devel )
Branch: branch/default ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commits/branch/default )

Commit: 321fdadc ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/commit/321fdadcf0e806ee2050e420b653c29b414e2c03
 )
Commit Message: formatting: re-blacken match.py

Differential R...
Commit Author: Matt Harbison

Pipeline #14086 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/14086 ) triggered 
by Pierre-Yves David ( https://foss.heptapod.net/marmoute )
had 13 failed builds.

Job #129575 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129575/raw )

Stage: tests
Name: test-py3-rust-dirstate-tree
Job #129576 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129576/raw )

Stage: tests
Name: test-py2-chg
Job #129574 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129574/raw )

Stage: tests
Name: test-py3-rust
Job #129571 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129571/raw )

Stage: tests
Name: test-py2-pure
Job #129566 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129566/raw )

Stage: tests
Name: rust-cargo-test-py2
Job #129568 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129568/raw )

Stage: tests
Name: rust-cargo-test-py3-dirstate-tree
Job #129572 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129572/raw )

Stage: tests
Name: test-py3-pure
Job #129565 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129565/raw )

Stage: tests
Name: checks-py3
Job #129569 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129569/raw )

Stage: tests
Name: test-py2
Job #129573 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129573/raw )

Stage: tests
Name: test-py2-rust
Job #129570 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129570/raw )

Stage: tests
Name: test-py3
Job #129567 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129567/raw )

Stage: tests
Name: rust-cargo-test-py3
Job #129564 ( 
https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/129564/raw )

Stage: tests
Name: checks-py2

-- 
You're receiving this email because of your account on foss.heptapod.net.



___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D9445: sidedata: send the correct revision data for wireproto v2

2020-12-07 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger added a comment.


  I don't think they are. The main motivation for pushing this one is to ensure 
that later changes to result in more sidedata doesn't create spurious failures 
with wireproto v2. As discussed on IRC around the sprint, it is dead at this 
point, but I'd still want to avoid introducing extra breakage.

REPOSITORY
  rHG Mercurial

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

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

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


Re: D9445: sidedata: send the correct revision data for wireproto v2

2020-12-07 Thread Pierre-Yves David
I think this will behave badly if any other processing flag is involved 
(something like `lfs`, which thankfully is not used on changelog 
revision). What happens to the associated flags ? where they preserved 
by wireprotov2 in the first place ?


On 11/28/20 3:05 PM, joerg.sonnenberger (Joerg Sonnenberger) wrote:

joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
   When no sidedata is present, rawdata() and revision() are the same. But
   as soon as sidedata is present, the way it is currently stored will
   change the rawdata and that is not desired here, so switch to the
   correct data accessor.

REPOSITORY
   rHG Mercurial

BRANCH
   default

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

AFFECTED FILES
   mercurial/wireprotov2server.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -1046,7 +1046,7 @@
  followingdata = []
  
  if b'revision' in fields:

-revisiondata = cl.rawdata(node)
+revisiondata = cl.revision(node)
  followingmeta.append((b'revision', len(revisiondata)))
  followingdata.append(revisiondata)
  




To: joerg.sonnenberger, #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



--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D9533: persistent-nodemap: properly ignore non-existent `.nd` data file

2020-12-07 Thread SimonSapin
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This code was meant to handle the case of a nodemap docket file
  pointing to a nodemap data file that doesn’t exist (anymore),
  but most likely caused an `UnboundLocalError` exception instead
  when `data` was used on the next line without being defined.
  
  This case is theoretically possible with a race condition
  between two hg processes, but is hard to reproduce or test:
  
  - Process A reads a docket file and finds a UID in it that points to a given 
data file name.
  - Process B decides that this same data file needs compacting. It writes a 
new one with a different UID, overwrites the docket file, then removes the old 
data file.
  - Only then process A tries to a open a file that doesn’t exist anymore.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -58,7 +58,9 @@
 else:
 data = fd.read(data_length)
 except OSError as e:
-if e.errno != errno.ENOENT:
+if e.errno == errno.ENOENT:
+return None
+else:
 raise
 if len(data) < data_length:
 return None



To: SimonSapin, #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


[Bug 6453] New: Unknown exception on execute the command "hg pull -u"

2020-12-07 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6453

Bug ID: 6453
   Summary: Unknown exception on execute the command "hg pull -u"
   Product: Mercurial
   Version: 3.8.3
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: acl
  Assignee: bugzi...@mercurial-scm.org
  Reporter: afju...@gmail.com
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

** https://mercurial-scm.org/wiki/BugTracker
** Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)]
** Mercurial SCM DistribuÝdo (versÒo 3.8.3)
** Extens§es carregadas: strip
Traceback (most recent call last):
  File "hg", line 49, in 
  File "mercurial\dispatch.pyo", line 59, in run
  File "mercurial\dispatch.pyo", line 125, in dispatch
  File "mercurial\dispatch.pyo", line 204, in _runcatch
  File "mercurial\dispatch.pyo", line 887, in _dispatch
  File "mercurial\dispatch.pyo", line 632, in runcommand
  File "mercurial\dispatch.pyo", line 1017, in _runcommand
  File "mercurial\dispatch.pyo", line 978, in checkargs
  File "mercurial\dispatch.pyo", line 884, in 
  File "mercurial\util.pyo", line 1005, in check
  File "mercurial\commands.pyo", line 5844, in pull
  File "mercurial\commands.pyo", line 5731, in postincoming
  File "mercurial\hg.pyo", line 721, in updatetotally
  File "mercurial\destutil.pyo", line 160, in destupdate
  File "mercurial\destutil.pyo", line 31, in _destupdatevalidate
  File "mercurial\revlog.pyo", line 487, in ancestors
  File "mercurial\ancestor.pyo", line 284, in __init__
TypeError: bad operand type for unary -: 'NoneType'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] test-extension: flush diagnostic message to stabilize chg output

2020-12-07 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1607339556 -32400
#  Mon Dec 07 20:12:36 2020 +0900
# Node ID e19bab808d0b3491121113509601f990fe5988f1
# Parent  1bf2b44c40078c4e17479a1625c57370dc7750ec
test-extension: flush diagnostic message to stabilize chg output

Since chg server may create new file object for the attached stdout,
procutil.stdout is not ui.fout and the buffered procutil.stdout data wouldn't
be flushed at all. That's why test-extension.t passes without modification
on Python 2.

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -154,7 +154,10 @@ Check that extensions are loaded in phas
   > from mercurial import exthelper
   > from mercurial.utils import procutil
   > 
-  > write = procutil.stdout.write
+  > def write(msg):
+  > procutil.stdout.write(msg)
+  > procutil.stdout.flush()
+  > 
   > name = os.path.basename(__file__).rsplit('.', 1)[0]
   > bytesname = name.encode('utf-8')
   > write(b"1) %s imported\n" % bytesname)
@@ -194,6 +197,9 @@ Check that extensions are loaded in phas
 
 Check normal command's load order of extensions and registration of functions
 
+ On chg server, extension should be first set up by the server. Then
+ object-level setup should follow in the worker process.
+
   $ hg log -r "foo() and bar()" -q
   1) foo imported
   1) bar imported
@@ -209,6 +215,18 @@ Check normal command's load order of ext
   4) bar uipopulate
   5) foo reposetup
   5) bar reposetup
+  4) foo uipopulate (chg !)
+  4) bar uipopulate (chg !)
+  4) foo uipopulate (chg !)
+  4) bar uipopulate (chg !)
+  4) foo uipopulate (chg !)
+  4) bar uipopulate (chg !)
+  4) foo uipopulate (chg !)
+  4) bar uipopulate (chg !)
+  4) foo uipopulate (chg !)
+  4) bar uipopulate (chg !)
+  5) foo reposetup (chg !)
+  5) bar reposetup (chg !)
   0:c24b9ac61126
 
 Check hgweb's load order of extensions and registration of functions

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D9532: transaction: windows workaround for missing line iteration support

2020-12-07 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The mixedfilemodewrapper doesn't support line iteration, so just read
  the whole file in one go.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -418,7 +418,7 @@
 def readjournal(self):
 self._file.seek(0)
 entries = []
-for l in self._file:
+for l in self._file.readlines():
 file, troffset = l.split(b'\0')
 entries.append((file, int(troffset)))
 return entries



To: joerg.sonnenberger, #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