Re: [PATCH stable] py3: always flush ui streams on Python 3

2020-06-04 Thread Denis Laxalde
Yuya Nishihara a écrit : > On Wed, 03 Jun 2020 05:46:05 +0200, Manuel Jacob wrote: > > On 2020-06-03 00:04, Augie Fackler wrote: > > >> On Jun 2, 2020, at 14:07, Manuel Jacob wrote: > > >> > > >> # HG changeset patch > > >> # User Manuel Jacob > > >> # Date 1591120869 -7200 > > >> # Tue

D7384: commands: necessary annotations and suppresssions to pass pytype

2020-01-30 Thread dlax (Denis Laxalde)
dlax added a comment. In D7384#118739 , @marmoute wrote: > What's up on this ? It seemed on a good track, but I don't think it landed. @dlax I think you offer to use a context manager got a warm welcome, I would says, go ahead with it.

D7980: resourceutil: ensure `_rootpath` is defined under py2exe

2020-01-23 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > resourceutil.py:39 > datapath = os.path.dirname(os.path.dirname(pycompat.fsencode(__file__))) > _rootpath = os.path.dirname(datapath) > `_rootpath` declaration could be moved after the `else` clause to avoid repetition. REPOSITORY

[PATCH STABLE v2] py3: force bytestr conversion of "reason" in scmutil.callcatch()

2019-12-18 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1576696641 -3600 # Wed Dec 18 20:17:21 2019 +0100 # Branch stable # Node ID 33249635134f8c3fdcd79b1a0da15880a2f57650 # Parent 743c69b393326ab82383638c1fed669794ac0ec1 py3: force bytestr conversion of "reason" in scmutil

[PATCH STABLE] py3: force bytestr conversion of "reason" in scmutil.callcatch()

2019-12-18 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1576687426 -3600 # Wed Dec 18 17:43:46 2019 +0100 # Branch stable # Node ID b5ea9c258bedfc2ba12111e98c038076ded3ac6a # Parent b06cf2809ec3486b25187ac2c8e766d6ac18763b py3: force bytestr conversion of "reason" in scmutil

D7682: patch: make __repr__() return str

2019-12-17 Thread dlax (Denis Laxalde)
dlax added inline comments. dlax accepted this revision. INLINE COMMENTS > patch.py:966 > def __repr__(self): > -return b'' % (b' '.join(map(repr, self.files( > +return '' % (' '.join(map(repr, self.files( > Somehow unrelated, but `self.files()` returns a list of

D7633: clone: extract helper for checking mutually exclusive args

2019-12-13 Thread dlax (Denis Laxalde)
dlax added a comment. Useful refactoring! INLINE COMMENTS > cmdutil.py:263 > > +def check_unique_argument(opts, *args): > +"""abort if more than one of the arguments are in opts""" The function name is a bit misleading; it looks like it would check that an option wasn't specified

D7620: merge: add commands.merge.require-rev to require an argument to hg merge

2019-12-13 Thread dlax (Denis Laxalde)
This revision now requires changes to proceed. dlax added a comment. dlax requested changes to this revision. This should be documented in `mercurial/helptext/config.txt` I think. Otherwise, this look sensible to me. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION

D7506: phabricator: add a "phabstatus" show view

2019-12-11 Thread dlax (Denis Laxalde)
dlax added a comment. In D7506#111947 , @spectral wrote: > I don't think `from . import show` works generally. I did that because `test-check-module-imports.t` complained otherwise when using `from hgext import show`:

D7506: phabricator: add a "phabstatus" show view

2019-12-11 Thread dlax (Denis Laxalde)
Closed by commit rHG70060915c3f2: phabricator: add a phabstatus show view (authored by dlax). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7506?vs=18589=18603 CHANGES SINCE LAST

D7507: phabricator: add a "phabstatus" template keyword

2019-12-11 Thread dlax (Denis Laxalde)
Closed by commit rHG79c0121220e3: phabricator: add a phabstatus template keyword (authored by dlax). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7507?vs=18590=18604 CHANGES

Re: [PATCH 1 of 2] crecord: repurpose "a" key to toggle all selections (BC)

2019-12-11 Thread Denis Laxalde
Jordi Gutiérrez Hermoso a écrit : > # HG changeset patch > # User Jordi Gutiérrez Hermoso > # Date 1576015329 18000 > # Tue Dec 10 17:02:09 2019 -0500 > # Node ID bd10bc4bdb994b875040c0c58f1c341df66ddd46 > # Parent ce088b38f92b6d480df2072dc45fb068443758dd > crecord: repurpose "a" key to

D7507: phabricator: add a "phabstatus" template keyword

2019-12-10 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18590. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7507?vs=18321=18590 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7507/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7507

D7506: phabricator: add a "phabstatus" show view

2019-12-10 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18589. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7506?vs=18338=18589 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7506/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7506

D7505: logcmdutil: call _exthook() in changesettemplater

2019-12-10 Thread dlax (Denis Laxalde)
Closed by commit rHG6331a6fc3304: logcmdutil: call _exthook() in changesettemplater (authored by dlax). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7505?vs=18312=18581 CHANGES

D7513: phabricator: fix processing of tags/desc in getoldnodedrevmap()

2019-12-10 Thread dlax (Denis Laxalde)
Closed by commit rHG16b607e9f714: phabricator: fix processing of tags/desc in getoldnodedrevmap() (authored by dlax). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D7540: tests: cover revision conversion logic in githelp tests

2019-12-02 Thread dlax (Denis Laxalde)
Closed by commit rHG5470e63686ca: tests: cover revision conversion logic in githelp tests (authored by dlax). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7540?vs=18417=18432

D7540: tests: cover revision conversion logic in githelp tests

2019-12-02 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY There was no test involving actual conversion of option values when they contain a git revision name (to be converted as a hg one by hgext.githelp.convert()).

D7537: githelp: fix a `str` type conditional for py3

2019-12-02 Thread dlax (Denis Laxalde)
dlax added a comment. dlax accepted this revision. There is apparently no test coverage for this. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7537/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7537 To: mharbison72, #hg-reviewers, dlax Cc:

D7533: repair: fix an `isinstance(nodelist, str)` check for py3

2019-12-01 Thread dlax (Denis Laxalde)
dlax added a comment. dlax accepted this revision. All these API where one can pass either a list of "things" or just one "thing" is kind of ugly. We should only handle the list case, I think. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7533/new/

[PATCH STABLE v3] log: map None rev to wdirrev when filtering revisions with --line-range

2019-11-30 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1575060193 -3600 # Fri Nov 29 21:43:13 2019 +0100 # Branch stable # Node ID 9bb01a946abc17328a28920ccea61f50d41d987b # Parent 969e8a52e3842d19387d02e91d6a19a993950ac0 log: map None rev to wdirrev when filtering revisions with --line-range

[PATCH STABLE v2] log: map None rev to wdirrev when filtering revisions with --line-range

2019-11-30 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1575060193 -3600 # Fri Nov 29 21:43:13 2019 +0100 # Branch stable # Node ID 411d301683935cb02d1c15adbe1d7ef58789da76 # Parent 969e8a52e3842d19387d02e91d6a19a993950ac0 log: map None rev to wdirrev when filtering revisions with --line-range

[PATCH 1 of 2 STABLE] tests: check that 'log --line-range' follows uncommitted changes

2019-11-29 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1575059694 -3600 # Fri Nov 29 21:34:54 2019 +0100 # Branch stable # Node ID 969e8a52e3842d19387d02e91d6a19a993950ac0 # Parent 371765e775a2cb4c4b41eed10dbee0ceee8ab1f9 tests: check that 'log --line-range' follows uncommitted changes

[PATCH 2 of 2 STABLE] py3: fix 'log --line-range' with uncommitted changes in range

2019-11-29 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1575060193 -3600 # Fri Nov 29 21:43:13 2019 +0100 # Branch stable # Node ID 8e65df8a972333c0d30b03f5dee4ce802088d799 # Parent 969e8a52e3842d19387d02e91d6a19a993950ac0 py3: fix 'log --line-range' with uncommitted changes in range When 'hg log

D7517: filemerge: byteify the open() mode

2019-11-24 Thread dlax (Denis Laxalde)
dlax added a comment. > This is actually pycompat.open(), so it need bytes. I don't understand why this is needed. The default value for "mode" as bytes comes from a407f9009392 , but I don't understand the

D7516: webutil: add missing argument to join()

2019-11-24 Thread dlax (Denis Laxalde)
dlax added a comment. dlax accepted this revision. Looks like dead code REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7516/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7516 To: mharbison72, #hg-reviewers, dlax Cc: dlax, mercurial-devel

D7507: phabricator: add a "phabstatus" template keyword

2019-11-23 Thread dlax (Denis Laxalde)
dlax added a comment. > I only have a superficial understanding about how templates work, but I assume that there's no global pre-resolution step where a single query could be done and the results stuffed into the context or something, is there? Not that I am aware. Using this keyword

D7513: phabricator: fix processing of tags/desc in getoldnodedrevmap()

2019-11-23 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added subscribers: mercurial-devel, Kwan. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It seems that the previous logic was wrong (it essentially comes from changeset 3ab0d5767b54

D7506: phabricator: add a "phabstatus" show view

2019-11-23 Thread dlax (Denis Laxalde)
dlax edited the summary of this revision. dlax updated this revision to Diff 18338. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7506?vs=18320=18338 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7506/new/ REVISION DETAIL

D7506: phabricator: add a "phabstatus" show view

2019-11-23 Thread dlax (Denis Laxalde)
dlax added a comment. dlax planned changes to this revision. In D7506#110321 , @mharbison72 wrote: > In D7506#110288 , @mharbison72 wrote: > >> I'm not sure why, but this version seems to also

D7507: phabricator: add a "phabstatus" template keyword

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18321. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7507?vs=18316=18321 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7507/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7507

D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18320. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7506?vs=18315=18320 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7506/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7506

D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax added a comment. dlax planned changes to this revision. In D7506#110225 , @mharbison72 wrote: > I like it. Thanks! > Any idea why the changeset isn't colored, unlike `hg show stack`? It might also be a little more readable if

D7508: relnotes: add note about changes to match.{explicit, reverse}dir

2019-11-22 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > next:22 > + also called when only `explicitdir` used to be called. That may > + mean that you can simple remove the use of `explicitdir` if you > + were already using `traversedir`. simple -> simply? REPOSITORY rHG Mercurial CHANGES SINCE

D7507: phabricator: add a "phabstatus" template keyword

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18316. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7507?vs=18314=18316 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7507/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7507

D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18315. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7506?vs=18313=18315 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7506/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7506

D7507: phabricator: add a "phabstatus" template keyword

2019-11-22 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added subscribers: mercurial-devel, Kwan. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We add a "phabstatus" template keyword, returning an object with "url" and "status" keys. This is quite similar to "phabreview" template keyword, but it

D7506: phabricator: add a "phabstatus" show view

2019-11-22 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added subscribers: mercurial-devel, Kwan, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We add a "phabstatus" show view (called as "hg show phabstatus") which renders a dag with underway revisions associated with a differential

D7505: logcmdutil: call _exthook() in changesettemplater

2019-11-22 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Class changesetprinter has an _exthook() method that is called in _show() before the patch is displayed. Call the method as well in changesettemplater._show().

D7504: py3: replace %s by %r on binary format string when needed

2019-11-22 Thread dlax (Denis Laxalde)
This revision now requires changes to proceed. dlax added a comment. dlax requested changes to this revision. nit: the actual PEP is pep-0461 (https://www.python.org/dev/peps/pep-0461/) INLINE COMMENTS > localrepo.py:1571 > +b"unsupported changeid '%r' of type %r" >

D7051: phabricator: remove tests and all recordings

2019-11-22 Thread dlax (Denis Laxalde)
dlax added a comment. > The next commit is going to change the format of conduit API requests so none of the VCR recordings will match and all the tests will fail. @Kwan, it seems to me that there is no longer any recording data nor actual test from this changeset. Did you plan to add

D7460: tests: add more tests for "hg shelve --delete"

2019-11-21 Thread dlax (Denis Laxalde)
Closed by commit rHG4330851947fb: tests: add more tests for hg shelve --delete (authored by dlax). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7460?vs=18250=18258 CHANGES SINCE

D7465: filemerge: fix a missing attribute usage

2019-11-21 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > mharbison72 wrote in filemerge.py:122 > I’m not sure how this works, but this was enough to make pytype happy. Does > it make any sense to compare an absent file to an absent file? > > Maybe the right thing is to add a ctx attribute here? > Does

[PATCH] import: add a --secret option

2019-11-21 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1574324750 -3600 # Thu Nov 21 09:25:50 2019 +0100 # Node ID f847210f92b94a13d7e260611e41d5508aeacb99 # Parent 039fbd14d4e2889be830cc114957c31972c6ea04 import: add a --secret option Similarly to "hg commit", we add a --secret opt

D7465: filemerge: fix a missing attribute usage

2019-11-21 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > filemerge.py:122 > fctx.isabsent() > -and fctx.ctx() == self.ctx() > +and fctx.ctx() == self._ctx > and fctx.path() == self.path() What about `fctx`? It could also lack the `ctx()` method if an

D7464: filemerge: drop a default argument to appease pytype

2019-11-21 Thread dlax (Denis Laxalde)
dlax added a comment. Shouldn't this be also done for all similar functions? (i.e. `_xmergeimm` and functions registered as a merge tool with `@internaltool`) REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7464/new/ REVISION DETAIL

D7460: tests: add more tests for "hg shelve --delete"

2019-11-20 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18250. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7460?vs=18249=18250 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7460/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7460

D7458: shelve: add the missing `create` parameter to the bundlerepo constructor

2019-11-20 Thread dlax (Denis Laxalde)
dlax added a comment. dlax accepted this revision. Good catch. On the other hand, it's not clear to me what's the point of this "create" argument given `bundlerepo.instance()` will just use it to raise Abort if it is true. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION

D7460: tests: add more tests for "hg shelve --delete"

2019-11-20 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It appears that the only tests for "hg shelve --delete" concern command errors (e.g. incompatible command options). Adding some more to check that non-existent

D7296: pycompat: kludge around pytype being confused by __new__

2019-11-19 Thread dlax (Denis Laxalde)
dlax added a comment. In D7296#109684 , @dlax wrote: > Looking closer at the error above, it mentions `bytestr.__init__`, not `__new__` (and there is in fact no type annotation for `__new__` in typeshed

D7296: pycompat: kludge around pytype being confused by __new__

2019-11-19 Thread dlax (Denis Laxalde)
dlax added a comment. dlax added a subscriber: yuja. In D7296#109683 , @durin42 wrote: > In D7296#109672 , @dlax wrote: > >> Sorry, still not ok afaict :/ > > So, I tried fixing this and it

Re: [PATCH 2 of 2] typing: fix return type of logcmdutil.getrevs()

2019-11-19 Thread Denis Laxalde
Yuya Nishihara a écrit : > # HG changeset patch > # User Yuya Nishihara > # Date 1574175192 -32400 > # Tue Nov 19 23:53:12 2019 +0900 > # Node ID 835d415c5a17258e2cf11e9fcd650441690dfbd4 > # Parent 75589cc751d7053a9852f7de88b35ec64909a46a > typing: fix return type of logcmdutil.getrevs() >

D7296: pycompat: kludge around pytype being confused by __new__

2019-11-19 Thread dlax (Denis Laxalde)
This revision now requires changes to proceed. dlax added a comment. dlax requested changes to this revision. Sorry, still not ok afaict :/ INLINE COMMENTS > pycompat.py:305 > > +bytestr = _bytestr # type: Callable[[Union[bytes, str], bytestr]] > + `]` is still at the wrong place, I

D7408: extensions: hide two confusing import statements from pytype

2019-11-18 Thread dlax (Denis Laxalde)
dlax added a comment. In D7408#109565 , @indygreg wrote: > Where does `hgext.__index__` come from?! This is generated by setup.py, apparently only when building with py2exe. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION

D7296: pycompat: kludge around pytype being confused by __new__

2019-11-16 Thread dlax (Denis Laxalde)
This revision now requires changes to proceed. dlax added inline comments. dlax requested changes to this revision. INLINE COMMENTS > pycompat.py:294 > > +bytestr = _bytestr # type: Callable[[Union[bytes, str], bytestr] > + A `]` is missing before `, bytestr`. Then, it's also missing

D7410: extensions: suppress a pytype failure due to a typeshed bug

2019-11-15 Thread dlax (Denis Laxalde)
dlax added a comment. dlax accepted this revision. meanwhile, https://github.com/python/typeshed/pull/3465 REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7410/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7410 To: durin42, #hg-reviewers,

D7296: pycompat: kludge around pytype being confused by __new__

2019-11-15 Thread dlax (Denis Laxalde)
dlax added a comment. black complains because inline comments have only one space before (esp. the first one produces a parse error). LGTM otherwise. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7296/new/ REVISION DETAIL

D7384: commands: necessary annotations and suppresssions to pass pytype

2019-11-15 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > commands.py:4742 > +# warning about list not having a max() method. > +endrev = revs.max() + 1 # pytype: disable=attribute-error > getcopies = scmutil.getcopiesfn(repo, endrev=endrev) `revs` is always a

D7430: bisect: replace try:/finally: by a "restore_state" context manager

2019-11-15 Thread dlax (Denis Laxalde)
Closed by commit rHGf37da59a36d9: bisect: replace try:/finally: by a restore_state context manager (authored by dlax). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG

D7410: extensions: suppress a strange pytype failure

2019-11-15 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > dlax wrote in extensions.py:96 > the doc indeed says that "fd" is file object In https://github.com/python/typeshed/blob/master/stdlib/3/imp.pyi type of `find_module` seems wrong. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION

D7410: extensions: suppress a strange pytype failure

2019-11-15 Thread dlax (Denis Laxalde)
dlax added inline comments. dlax accepted this revision. INLINE COMMENTS > extensions.py:96 > +# pytype seems to think `fd` is a str, but I'm pretty sure > +# it's wrong. This may be a bug we need to report upstream. > +return imp.load_module( the doc indeed says that

D7408: extensions: hide two confusing import statements from pytype

2019-11-15 Thread dlax (Denis Laxalde)
dlax added a comment. dlax accepted this revision. Out of curiosity, where does this `__index__` value come from? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7408/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7408 To: durin42,

D7384: commands: necessary annotations and suppresssions to pass pytype

2019-11-15 Thread dlax (Denis Laxalde)
This revision now requires changes to proceed. dlax added a comment. dlax requested changes to this revision. D7430 makes this changes unnecessary I think. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7384/new/

D7296: pycompat: kludge around pytype being confused by __new__

2019-11-15 Thread dlax (Denis Laxalde)
This revision now requires changes to proceed. dlax added a comment. dlax requested changes to this revision. Rather `class bytestr(bytes): # type: Callable[[Union[bytes, str], bytestr]` as @yuya suggested in D7380 . REPOSITORY rHG Mercurial CHANGES

D7430: bisect: replace try:/finally: by a "restore_state" context manager

2019-11-15 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This should help pytype to not consider "bgood" variable as NameError. See https://phab.mercurial-scm.org/D7384 for context. REPOSITORY rHG Mercurial BRANCH

D7296: pycompat: kludge around pytype being confused by __new__

2019-11-14 Thread dlax (Denis Laxalde)
dlax added a comment. class bytestr(bytes): # type: (Union[bytes,str]) -> bytestr [...] Does this work? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7296/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7296 To: durin42,

D7380: encoding: define per-use identity functions only in typechecking mode

2019-11-14 Thread dlax (Denis Laxalde)
dlax added a comment. Have you tried using variables annotations? Like: strtolocal = pycompat.identity # type: (str) -> bytes strfromlocal = pycompat.identity # type: (bytes) -> str REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7380/new/

[PATCH 2 of 2] tests: test "hg log" with --line-range and --copies

2019-11-14 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573727585 -3600 # Thu Nov 14 11:33:05 2019 +0100 # Node ID a0b29e94b386346d61e1549d5b8e47bec51b0783 # Parent 3386a6737e04d6a8cf4787f8a76765dcea5857de tests: test "hg log" with --line-range and --copies This now works (does not c

[PATCH 1 of 2] logcmdutil: let getlinerangerevs() return "revs" as a smartset

2019-11-14 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573726298 -3600 # Thu Nov 14 11:11:38 2019 +0100 # Node ID 3386a6737e04d6a8cf4787f8a76765dcea5857de # Parent ec53ea01c9e6c64ff1e4ffc5ce5b8623c5dae9da logcmdutil: let getlinerangerevs() return "revs" as a smartset This makes it

D7385: debugcommands: suppress import errors for pytype

2019-11-14 Thread dlax (Denis Laxalde)
dlax added a comment. dlax accepted this revision. I wonder if using `importlib.import_module()` wouldn't help. Or is it something we avoid in Mercurial? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7385/new/ REVISION DETAIL

D7384: commands: necessary annotations and suppresssions to pass pytype

2019-11-14 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > commands.py:1127 > +bgood, # pytype: disable=name-error > +) > return This one is sad. I think this can be sorted out by replacing the `try:/finally:` with a context manager. (Can send a patch, if it sounds good to

D7289: branchmap: always copy closednodes to a set

2019-11-14 Thread dlax (Denis Laxalde)
dlax added a comment. On second thought, it's not obvious why it'd be better than annotating `__init__()`. Is this because this would require many changes in callers? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7289/new/ REVISION DETAIL

D7381: cmdutil: add a pytype annotation to help out some callsites

2019-11-14 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > cmdutil.py:3970 > def readgraftstate(repo, graftstate): > +# type: (Any, statemod.cmdstate) -> Dict[bytes, Any] > """read the graft state file and return a dict of the data stored in > it""" Wouldn't `-> Dict[bytes, List[bytes]]` be okay?

D7377: commands: log --line-range is incompatible with --copies

2019-11-14 Thread dlax (Denis Laxalde)
dlax added a comment. Nice pytype catch! That's a bug, I think. `logcmdutil.getlinerangerevs()` should return `revs` as a smartset, not as list. I'll work on a fix. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7377/new/ REVISION DETAIL

[PATCH 6 of 6] patchbomb: fix wrong argument type when calling mail generator.flatten()

2019-11-13 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573661165 -3600 # Wed Nov 13 17:06:05 2019 +0100 # Node ID 9ebd700f9dc4e27c0bd45dce1108f7a2255b # Parent 11d514fd71855ace61c549d3154f52569cea9264 patchbomb: fix wrong argument type when calling mail generator.flatten() diff --git

[PATCH 4 of 6] mail: use a native string for "subtype" value

2019-11-13 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573654984 -3600 # Wed Nov 13 15:23:04 2019 +0100 # Node ID 6f035c6bb911f36cd2459272843388a218be120d # Parent f84d980d58cd3e1bdf2b19aa03b419e438eff808 mail: use a native string for "subtype" value This is somehow similar t

[PATCH 3 of 6] mail: let all charset values be native strings

2019-11-13 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573595550 -3600 # Tue Nov 12 22:52:30 2019 +0100 # Node ID f84d980d58cd3e1bdf2b19aa03b419e438eff808 # Parent ff60edae8bb65ef213f9d83b6065c161d57f2a51 mail: let all charset values be native strings Charset values will typically be used

[PATCH 5 of 6] mail: move strtolocal call in _addressencode()

2019-11-13 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573659988 -3600 # Wed Nov 13 16:46:28 2019 +0100 # Node ID 11d514fd71855ace61c549d3154f52569cea9264 # Parent 6f035c6bb911f36cd2459272843388a218be120d mail: move strtolocal call in _addressencode() diff --git a/mercurial/mail.py b/mercurial

[PATCH 1 of 6] mail: fix a bad return type in _encode()

2019-11-13 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573575136 -3600 # Tue Nov 12 17:12:16 2019 +0100 # Node ID a57f3ab9661af30fd20d6a69d872448afa4612bd # Parent c207c46a86b92ad7be05de2bf85bb36757e8ae3a mail: fix a bad return type in _encode() This particular instruction returned only

[PATCH 2 of 6] mail: add type hints for pytype

2019-11-13 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573680044 -3600 # Wed Nov 13 22:20:44 2019 +0100 # Node ID ff60edae8bb65ef213f9d83b6065c161d57f2a51 # Parent a57f3ab9661af30fd20d6a69d872448afa4612bd mail: add type hints for pytype We essentially annotate functions in which handling

D7373: py3: pass a bytes value for "msg" to nouideprecwarn()

2019-11-13 Thread dlax (Denis Laxalde)
Closed by commit rHGc207c46a86b9: py3: pass a bytes value for msg to nouideprecwarn() (authored by dlax). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7373?vs=18051=18053 CHANGES

D7373: py3: pass a bytes value for "msg" to nouideprecwarn()

2019-11-13 Thread dlax (Denis Laxalde)
dlax added a comment. should fix tracebacks in https://ci.octobus.net/job/EvolvePy3/278/console REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7373/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7373 To: dlax, indygreg, #hg-reviewers Cc:

D7373: py3: pass a bytes value for "msg" to nouideprecwarn()

2019-11-13 Thread dlax (Denis Laxalde)
dlax created this revision. Herald added a reviewer: indygreg. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY That function formats "msg" with the "version" value. On Python 3, this leads to "TypeError: can only concatenate str (not

[PATCH STABLE] py3: avoid iterating over a literal bytes in highlight

2019-11-12 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573553103 -3600 # Tue Nov 12 11:05:03 2019 +0100 # Branch stable # Node ID 430d80ba9271920ca6da8db62b507390f65d20d1 # Parent e513e87b0476cc9a6eb31abe420448877fa9c902 py3: avoid iterating over a literal bytes in highlight In Python 3

[PATCH 2 of 2 v2] py3: use native strings when forming email headers in patchbomb

2019-11-10 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573312591 -3600 # Sat Nov 09 16:16:31 2019 +0100 # Node ID fa028d890b185176d23c580a2cc020fbcb62bd4a # Parent 9a59fd5811220d3d2742b041dbdc9a0d0f5f2992 py3: use native strings when forming email headers in patchbomb Per previous changesets

[PATCH 1 of 2 v2] mail: convert addr to str early in addrlistencode()

2019-11-10 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573314873 -3600 # Sat Nov 09 16:54:33 2019 +0100 # Node ID 9a59fd5811220d3d2742b041dbdc9a0d0f5f2992 # Parent b8e4d65733c52d2425e571a6148dbfbafe9ebab3 mail: convert addr to str early in addrlistencode() diff --git a/mercurial/mail.py b

[PATCH 4 of 4] py3: use native strings when forming email headers in patchbomb

2019-11-09 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573312591 -3600 # Sat Nov 09 16:16:31 2019 +0100 # Node ID cc7ee463d94f42083eee0bbda497beb6a1f4eb6d # Parent 068618bc1ae197973b082742a3446aeaab02cad9 py3: use native strings when forming email headers in patchbomb Per previous changesets

[PATCH 2 of 4] mail: let addressencode() / addrlistencode() return native strings

2019-11-09 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573309012 -3600 # Sat Nov 09 15:16:52 2019 +0100 # Node ID 36c4ef3894cdb62ae0a63b7b266f1b07df6dcb12 # Parent 1c7a66bf3315f69036420e2b07b584abacfef881 mail: let addressencode() / addrlistencode() return native strings Avoids conversion

[PATCH 3 of 4] mail: convert addr to str early in addrlistencode()

2019-11-09 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573314873 -3600 # Sat Nov 09 16:54:33 2019 +0100 # Node ID 068618bc1ae197973b082742a3446aeaab02cad9 # Parent 36c4ef3894cdb62ae0a63b7b266f1b07df6dcb12 mail: convert addr to str early in addrlistencode() diff --git a/mercurial/mail.py b

[PATCH 1 of 4] mail: let headencode() return a native string

2019-11-09 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573299914 -3600 # Sat Nov 09 12:45:14 2019 +0100 # Node ID 1c7a66bf3315f69036420e2b07b584abacfef881 # Parent a78a65c33b5aa84cc9c3ae5f7dad636d371f149c mail: let headencode() return a native string This is to avoid conversion to/from str

[PATCH STABLE] py3: fix sorting of obsolete markers in obsutil (issue6217)

2019-11-09 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573291918 -3600 # Sat Nov 09 10:31:58 2019 +0100 # Branch stable # Node ID e513e87b0476cc9a6eb31abe420448877fa9c902 # Parent be0f77fd274dfeaf47a2104b178039894532c425 py3: fix sorting of obsolete markers in obsutil (issue6217

Re: [PATCH 3 of 3 STABLE] py3: fix handling of ctrl keys in crecord (issue6213)

2019-11-08 Thread Denis Laxalde
Yuya Nishihara a écrit : > On Wed, 06 Nov 2019 17:23:29 +0100, Denis Laxalde wrote: > > # HG changeset patch > > # User Denis Laxalde > > # Date 1573055674 -3600 > > # Wed Nov 06 16:54:34 2019 +0100 > > # Branch stable > > # Node ID f4415c4f24f879

[PATCH STABLE] py3: compare http server's command with a native string

2019-11-07 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573113506 -3600 # Thu Nov 07 08:58:26 2019 +0100 # Branch stable # Node ID aa65668163280666889f40b335a2a3f9144bb3b2 # Parent be384a2052aa864733b3f75c357bb2bc7cd42ae4 py3: compare http server's command with a native string The "co

D7262: templateutil: fix a missing ABCMeta assignment

2019-11-07 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > dlax wrote in templateutil.py:114 > This is ignored on Python 3 (meaning it's possible to instantiate `mappable` > directly, despite some methods being abstract). It should be `class > mappable(metaclass=abc.ABCMeta)` on Python 3. > But I realize

D7262: templateutil: fix a missing ABCMeta assignment

2019-11-07 Thread dlax (Denis Laxalde)
dlax added inline comments. INLINE COMMENTS > templateutil.py:114 > > +__metaclass__ = abc.ABCMeta > + This is ignored on Python 3 (meaning it's possible to instantiate `mappable` directly, despite some methods being abstract). It should be `class mappable(metaclass=abc.ABCMeta)` on

[PATCH 2 of 3 STABLE] py3: keep "keypressed" a native str in crecord

2019-11-06 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573055581 -3600 # Wed Nov 06 16:53:01 2019 +0100 # Branch stable # Node ID 5802765e3828e3b3f1396b92ed7ef18a1eca6456 # Parent ae3e67359e0bf045ae1bb797d8f4e043fa55042b py3: keep "keypressed" a native str in crecord This will help i

[PATCH 1 of 3 STABLE] py3: compare response of crecord's confirmationwindow with str

2019-11-06 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573056733 -3600 # Wed Nov 06 17:12:13 2019 +0100 # Branch stable # Node ID ae3e67359e0bf045ae1bb797d8f4e043fa55042b # Parent be384a2052aa864733b3f75c357bb2bc7cd42ae4 py3: compare response of crecord's confirmationwindow with str

[PATCH 3 of 3 STABLE] py3: fix handling of ctrl keys in crecord (issue6213)

2019-11-06 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1573055674 -3600 # Wed Nov 06 16:54:34 2019 +0100 # Branch stable # Node ID f4415c4f24f879845f5dc631d592440e88d2afee # Parent 5802765e3828e3b3f1396b92ed7ef18a1eca6456 py3: fix handling of ctrl keys in crecord (issue6213) The "keypr

[PATCH 1 of 2 STABLE] py3: add Python 3 exception output to test-lfs-serve-access.t

2019-11-04 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1572879849 -3600 # Mon Nov 04 16:04:09 2019 +0100 # Branch stable # Node ID cb58293505fa65d1b7f2a7d0e3fc3b3320122ac6 # Parent 1edf620a37a32755c413ca4f3a9745b0458fc1bc py3: add Python 3 exception output to test-lfs-serve-access.t Similar

[PATCH 3 of 3 STABLE] py3: encode strings before setting rev summary in gnuarch converter

2019-11-04 Thread Denis Laxalde
# HG changeset patch # User Denis Laxalde # Date 1572858548 -3600 # Mon Nov 04 10:09:08 2019 +0100 # Branch stable # Node ID b760c0afe8e8cc864b069b4f56d6548e004131d2 # Parent e0e912bb2453e033807000be5a5c648efef72d59 py3: encode strings before setting rev summary in gnuarch converter

  1   2   3   4   5   6   >