Re: [PATCH RFC] lfs: clean up a variety of strings/bytes issues

2019-01-26 Thread Augie Fackler
> On Jan 26, 2019, at 10:35 PM, Matt Harbison wrote: > > On Fri, 25 Jan 2019 17:33:54 -0500, Augie Fackler wrote: > >> # HG changeset patch >> # User Augie Fackler >> # Date 1548455589 18000 >> # Fri Jan 25 17:33:09 2019 -0500 >> # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa >> #

Re: [PATCH RFC] lfs: clean up a variety of strings/bytes issues

2019-01-26 Thread Matt Harbison
On Fri, 25 Jan 2019 17:33:54 -0500, Augie Fackler wrote: # HG changeset patch # User Augie Fackler # Date 1548455589 18000 # Fri Jan 25 17:33:09 2019 -0500 # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 lfs: clean up a variety of

D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread yuja (Yuya Nishihara)
yuja added a comment. >> Why is that? @yuja, can you elaborate? > > > > This is version-controlled code that changes in lock-step with the branchmap module, adding backwards compatibility tests here would add a costly maintenance burden. If you have an older revision of the branchmap

Re: D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread Yuya Nishihara
> > Why is that? @yuja, can you elaborate? > > > > This is version-controlled code that changes in lock-step with the > > branchmap module, adding backwards compatibility tests here would add a > > costly maintenance burden. If you have an older revision of the branchmap > > module, you also

D5728: crecord: always return a str from uihunk.__repr__

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Otherwise Python 3 complains about it returning bytes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5728 AFFECTED FILES

D5729: convert: print exception message directly

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Otherwise the default repr() implementation will b'' prefix the returned str on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL

D5727: tests: handles bytes/str mismatch in test-commit-interface-curses.t

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This fixes various test failures on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5727 AFFECTED FILES

D5726: githelp: format with %d if an integer

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG873a28d7e962: githelp: format with %d if an integer (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5726?vs=13525=13533

D5725: githelp: make argument parsing more compatible with Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG031d91623fdc: githelp: make argument parsing more compatible with Python 3 (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5723: tests: add b'' to config file name

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGf5cb822625cc: tests: add b to config file name (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5723?vs=13522=13530

D5722: sslutil: ensure serverhostname is bytes when formatting

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGf07aff7e8b5a: sslutil: ensure serverhostname is bytes when formatting (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5724: tests: add b'' prefixes to flagprocessorext.py

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGfad627d2047c: tests: add b prefixes to flagprocessorext.py (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5721: sslutil: use raw strings for exception reason compare

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0d226b2139df: sslutil: use raw strings for exception reason compare (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5719: keepalive: track ready state with a bool

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG1db94ebbc207: keepalive: track ready state with a bool (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5719?vs=13518=13527

D5718: keepalive: use collections.defaultdict for host map

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa43acfa2b76d: keepalive: use collections.defaultdict for host map (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5726: githelp: format with %d if an integer

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python 3 doesn't allow us to format an int with %s like Python 2 did. So handle that. REPOSITORY rHG Mercurial REVISION DETAIL

D5725: githelp: make argument parsing more compatible with Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY There were various mixing of str and bytes in here. This change fixes most of the failures in test-githelp.t. REPOSITORY rHG Mercurial REVISION DETAIL

D5723: tests: add b'' to config file name

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Without this, things die in the bowels of the config system due to mixing str and bytes. 1. skip-blame: just b'' prefix REPOSITORY rHG Mercurial

D5724: tests: add b'' prefixes to flagprocessorext.py

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Otherwise a part of test-flavprocessor.t fails due to not setting the proper key. REPOSITORY rHG Mercurial REVISION DETAIL

D5722: sslutil: ensure serverhostname is bytes when formatting

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It will likely be a str on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5722 AFFECTED FILES mercurial/sslutil.py

D5721: sslutil: use raw strings for exception reason compare

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Otherwise we attempt to compare a bytes to a str on Python 3 and it always fails. REPOSITORY rHG Mercurial REVISION DETAIL

D5720: keepalive: implement _close_conn() so closes are known

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Keepalives were not working on Python 3 because http.client.HTTPResponse was refactored to call _close_conn() instead of close(). Our custom close() is what

D5719: keepalive: track ready state with a bool

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This code may have been written before Python had a bool type. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5719 AFFECTED FILES

D5718: keepalive: use collections.defaultdict for host map

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Cleaning up the code as part of debugging Python 3 issues. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5718 AFFECTED FILES

D5716: statichttprepo: use str to appease Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6e9bebb65ce7: statichttprepo: use str to appease Python 3 (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5715: statichttprepo: use URLError.reason directly

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2bf689b13a17: statichttprepo: use URLError.reason directly (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5714: mail: document behavior of Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9b3be572ff0c: mail: document behavior of Python 3 (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5714?vs=13506=13514

D5713: notify: be more defensive aboute None values

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG43f9b8c0574b: notify: be more defensive aboute None values (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5711: tests: add optional setsockopt() lines for Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG4f0aca2b8c21: tests: add optional setsockopt() lines for Python 3 (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5712: wireprotov2server: use our JSON encoder

2019-01-26 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGe82288a9556c: wireprotov2server: use our JSON encoder (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5712?vs=13504=13512

D5712: wireprotov2server: use our JSON encoder

2019-01-26 Thread pulkit (Pulkit Goyal)
pulkit accepted this revision. pulkit added a comment. Nice one! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5712 To: indygreg, #hg-reviewers, pulkit Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list

D5710: py3: add 7 new passing tests to whitelist found by buildbot

2019-01-26 Thread pulkit (Pulkit Goyal)
pulkit abandoned this revision. pulkit added a comment. Damn! Yes I have a script which just where I enter new passing tests and it adds them to whitelist. That script helps me to prevent manually sorting the entries. REPOSITORY rHG Mercurial REVISION DETAIL

D5717: tests: conditionalize test output on Python 3.7

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python 3.7 changed behavior of urllib.parse.quote() from RFC 2396 to RFC 3986 and ~ is now in the set of reserved characters and isn't escaped.

D5088: hghave: add pyXY features for Python version numbers

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 13509. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5088?vs=12096=13509 REVISION DETAIL https://phab.mercurial-scm.org/D5088 AFFECTED FILES tests/hghave.py CHANGE DETAILS diff --git a/tests/hghave.py

D5716: statichttprepo: use str to appease Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The URL fed into urllib and HTTP headers need to be str on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5716

D5715: statichttprepo: use URLError.reason directly

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY https://phab.mercurial-scm.org/rHG0b3f4be5c5bf8258e4370c7755a2a1ab32ac07eb changed str(inst) to inst.reason[0] all the way back in 2006. URLError.reason is a

D5712: wireprotov2server: use our JSON encoder

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python's json module doesn't like to encode bytes instances. This makes this code difficult to work with Python 3. We simply swap in Mercurial's JSON

D5714: mail: document behavior of Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY test-notify.t (and possibly other tests) are failing on Python 3 because email.message.Message is now aware of encodings and attempts to roundtrip values with

D5713: notify: be more defensive aboute None values

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY encoding.strtolocal is the identity function on Python 2 but an actual string manipulation routine on Python 3. In some cases, we were passing None, which

D5711: tests: add optional setsockopt() lines for Python 3

2019-01-26 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5711 AFFECTED FILES tests/test-http-api-httpv2.t CHANGE DETAILS diff --git

D5638: branchmap: encapsulate cache updating in the map itself

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments. INLINE COMMENTS > mjpieters wrote in localrepo.py:2077 > Yes, the updating will change in a later, as yet to be submitted patch. > > But why should it be clear //here// that there is a cache that is kept > up-to-date on access to the branchmap? That's a

D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments. INLINE COMMENTS > mjpieters wrote in perf.py:2326 > Why is that? @yuja, can you elaborate? > > This is version-controlled code that changes in lock-step with the branchmap > module, adding backwards compatibility tests here would add a costly > maintenance

D5638: branchmap: encapsulate cache updating in the map itself

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters added inline comments. INLINE COMMENTS > martinvonz wrote in perf.py:2299 > Same here: I think this needs to be made compatible with both versions > (before and after this patch) I'll wait for confirmation; see the other patch. > martinvonz wrote in localrepo.py:2077 > Hmm, it's

D5638: branchmap: encapsulate cache updating in the map itself

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 13502. mjpieters marked an inline comment as done. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5638?vs=1=13502 REVISION DETAIL https://phab.mercurial-scm.org/D5638 AFFECTED FILES contrib/perf.py

D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 13501. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5635?vs=13330=13501 REVISION DETAIL https://phab.mercurial-scm.org/D5635 AFFECTED FILES contrib/perf.py mercurial/branchmap.py CHANGE DETAILS diff --git

D5636: branchmap: updating triggers a write

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters added inline comments. INLINE COMMENTS > martinvonz wrote in discovery.py:242-243 > Indentation seems bad (seemed bad before too) It's a generator expression as single argument. I was deliberately not making style changes in these patches, so I didn't touch the indentation here. If

D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters added a subscriber: yuja. mjpieters added inline comments. INLINE COMMENTS > martinvonz wrote in perf.py:2326 > As I was recently reminded by Yuya, the perf commands are supposed to be > compatible with older versions of hg too, and this doesn't seem to be > compatible with the

D5710: py3: add 7 new passing tests to whitelist found by buildbot

2019-01-26 Thread av6 (Anton Shestakov)
av6 added a comment. Is this patch a result of some flawed automated script? Because wow, unless my eyes fail me, these additions are all duplicates. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5710 To: pulkit, #hg-reviewers Cc: av6, mercurial-devel

D5710: py3: add 7 new passing tests to whitelist found by buildbot

2019-01-26 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Thanks to indygreg who fixed a lot of Python 3 issues recently. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5710 AFFECTED FILES

D5709: diffstat: support filenames with whitespaces on renames

2019-01-26 Thread navaneeth.suresh (Navaneeth Suresh)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG4a33a6bf2b52: diffstat: support filenames with whitespaces on renames (authored by navaneeth.suresh, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

[PATCH 3 of 3] dispatch: unify handler of IOError and OSError

2019-01-26 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1548492783 -32400 # Sat Jan 26 17:53:03 2019 +0900 # Node ID 76f6d37dfe338f6887de6cfca483f2baef39724d # Parent 83cd7b49057adc113d349eba2af6d3da38d3a5af dispatch: unify handler of IOError and OSError These exceptions were merged in Python 3.

[PATCH 2 of 3] dispatch: quote filename in IOError as well

2019-01-26 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1548492715 -32400 # Sat Jan 26 17:51:55 2019 +0900 # Node ID 83cd7b49057adc113d349eba2af6d3da38d3a5af # Parent f9eab964f2eaa3fe7ad9f92344b4919ef4514858 dispatch: quote filename in IOError as well It's explicitly added for OSError at

[PATCH 1 of 3] dispatch: add inline comment about possible IOError subtypes

2019-01-26 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1548492247 -32400 # Sat Jan 26 17:44:07 2019 +0900 # Node ID f9eab964f2eaa3fe7ad9f92344b4919ef4514858 # Parent 4a409c19831fb83171e4e65e02ba57da9eb4c3bd dispatch: add inline comment about possible IOError subtypes It's hard to tell which

D5706: cleanup: use p1() and p2() instead of parents()[0] and parents()[1]

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0bd56c291359: cleanup: use p1() and p2() instead of parents()[0] and parents()[1] (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5708: cleanup: use p1() instead of parents() when we only need the first parent

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5cb8158a61f7: cleanup: use p1() instead of parents() when we only need the first parent (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5707: cleanup: use repo['.'] instead of repo[None].p1()

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2ff8994ac71d: cleanup: use repo[.] instead of repo[None].p1() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5644: largefiles: avoid walking full manifest

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG4a409c19831f: largefiles: avoid walking full manifest (authored by martinvonz, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5644?vs=13340=13498#toc REPOSITORY rHG

D5709: diffstat: support filenames with whitespaces on renames

2019-01-26 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is a follow-up patch to https://phab.mercurial-scm.org/D5628. `line.split()` cannot get filenames with whitespaces as mentioned by @yuja. This

D5706: cleanup: use p1() and p2() instead of parents()[0] and parents()[1]

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We have had these methods on both contexts and dirstate for a long time now. REPOSITORY rHG Mercurial REVISION DETAIL

D5708: cleanup: use p1() instead of parents() when we only need the first parent

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5708 AFFECTED FILES hgext/fetch.py hgext/histedit.py

D5707: cleanup: use repo['.'] instead of repo[None].p1()

2019-01-26 Thread martinvonz (Martin von Zweigbergk)
martinvonz 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/D5707 AFFECTED FILES contrib/synthrepo.py hgext/fastannotate/formatter.py mercurial/commands.py