Simple extension gives TypeError: expected a 20-byte hash

2018-05-16 Thread Marco Wegner
Hello, im trying to write an extension, that adds some Text at the end of the commitmessage. But my example gives me an TypeError: expected a 20-byte hash error on commit. Where is my failure? Here is my extension code: #!/usr/bin/python import re import mercurial, sys, os def reposetup(ui, re

Re: [PATCH] dispatch: unify handling of None returned by a command function

2018-05-16 Thread Yuya Nishihara
On Tue, 15 May 2018 09:50:36 -0700, Martin von Zweigbergk wrote: > On Sat, May 12, 2018 at 6:09 AM Yuya Nishihara wrote: > > > # HG changeset patch > > # User Yuya Nishihara > > # Date 1526106789 -32400 > > # Sat May 12 15:33:09 2018 +0900 > > # Node ID f5d41abf680b6830b21de4aca1c81532eda36

D3567: py3: use pycompat.bytestr() on bytes before %r-ing it

2018-05-16 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2f406142d7b4: py3: use pycompat.bytestr() on bytes before %r-ing it (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3567?vs=87

Re: D3561: dispatch: drop redundant setting of "ret" to -1

2018-05-16 Thread Yuya Nishihara
> diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py > --- a/mercurial/dispatch.py > +++ b/mercurial/dispatch.py > @@ -230,7 +230,6 @@ > except IOError as inst: > if inst.errno != errno.EPIPE: > raise > -ret = -1 > finally: > dura

D3561: dispatch: drop redundant setting of "ret" to -1

2018-05-16 Thread yuja (Yuya Nishihara)
yuja added a comment. > diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py > > - a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -230,7 +230,6 @@ except IOError as inst: if inst.errno != errno.EPIPE: raise > - ret = -1 finally: duration = util.timer() - starttime req.ui

D3560: tests: test failure reporting in blackbox code

2018-05-16 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG81ca0fd348e3: tests: test failure reporting in blackbox code (authored by martinvonz, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D3560?vs=8698&id=8709#toc REPOSITORY rHG

Re: D3569: py3: convert the report to bytes

2018-05-16 Thread Yuya Nishihara
> --- a/mercurial/dispatch.py > +++ b/mercurial/dispatch.py > @@ -1028,7 +1028,7 @@ > '** which supports versions %s of Mercurial.\n' > '** Please disable %s and try your action again.\n' > '** If that fixes the bug please report it

D3568: py3: use pycompat.bytestr() instead of str() in extensions.py

2018-05-16 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9d44c71bd892: py3: use pycompat.bytestr() instead of str() in extensions.py (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D35

D3569: py3: convert the report to bytes

2018-05-16 Thread yuja (Yuya Nishihara)
yuja added a comment. > - a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -1028,7 +1028,7 @@ '** which supports versions %s of Mercurial.\n' '** Please disable %s and try your action again.\n' '** If that fixes the bug please report it to %s\n') > - % (name, testedwith, name, repor

D3564: py3: add b'' prefixes in tests/test-extension.t

2018-05-16 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa9ffb4a577d0: py3: add b'' prefixes in tests/test-extension.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3564?vs=8702&id=

D3563: py3: suppress the value returned by .write() calls

2018-05-16 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6660b90805c6: py3: suppress the value returned by .write() calls (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3563?vs=8701&

Re: D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-16 Thread Yuya Nishihara
> -def setup(repo): > +# Mapping of root:str to repo for repos that have the narrow requirement > +# specified. > +_rootrepomap = {} > + > +def _getrepo(ds): > +"""Check if narrow is enabled for repo associated with `ds`; return > repo.""" > +return _rootrepomap.get(ds._root, None) This m

D3562: tests: mark tests that fail when using chg as #require no-chg

2018-05-16 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued, thanks. > REVISION SUMMARY > > As far as I can tell, most of these failures are due to using $HGPORT, which it > seems chg might be using itself? I don't know enough to debug these failures to > fix them properly. Perhaps some "chg serve

Re: D3562: tests: mark tests that fail when using chg as #require no-chg

2018-05-16 Thread Yuya Nishihara
Queued, thanks. > REVISION SUMMARY > As far as I can tell, most of these failures are due to using $HGPORT, > which it > seems chg might be using itself? I don't know enough to debug these > failures to > fix them properly. Perhaps some "chg serve -d" calls would bypass the hack to execut

D3559: narrow: only wrap dirstate functions once, instead of per-reposetup

2018-05-16 Thread yuja (Yuya Nishihara)
yuja added a comment. > -def setup(repo): > +# Mapping of root:str to repo for repos that have the narrow requirement > +# specified. > +_rootrepomap = {} > + > +def _getrepo(ds): > +"""Check if narrow is enabled for repo associated with `ds`; return repo.""" > +re

D3562: tests: mark tests that fail when using chg as #require no-chg

2018-05-16 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG538e850ae737: tests: mark tests that fail when using chg as #require no-chg (authored by spectral, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D

Re: D3553: notify: add option to include function names in the diff output

2018-05-16 Thread Yuya Nishihara
> + notify.show-functions > +Set to True to get the equivalent of "hg diff --show-functions". Default: > +False So is this equivalent to setting the diff option? ``` [diff] showfunc = True ``` I'm not sure if we need `notify.show-functions` in addition to `diff.*` options, but if we do

D3553: notify: add option to include function names in the diff output

2018-05-16 Thread yuja (Yuya Nishihara)
yuja added a comment. > + notify.show-functions > +Set to True to get the equivalent of "hg diff --show-functions". Default: > +False So is this equivalent to setting the diff option? [diff] showfunc = True I'm not sure if we need `notify.show-functions` in

[PATCH 2 of 2] dispatch: mask negative exit code recorded in blackbox log

2018-05-16 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1526469743 -32400 # Wed May 16 20:22:23 2018 +0900 # Node ID a548e75b75e778f26a50b429fc7b31618cc34d3f # Parent d5956b687bbc39c686390b45d08caea976b8b7dd dispatch: mask negative exit code recorded in blackbox log That's what we do for the exit

[PATCH 1 of 2] dispatch: fix exit code of unhandled exception recorded in blackbox log

2018-05-16 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1526469470 -32400 # Wed May 16 20:17:50 2018 +0900 # Node ID d5956b687bbc39c686390b45d08caea976b8b7dd # Parent 81ca0fd348e3fe3bd442b2eb0d1232abef069155 dispatch: fix exit code of unhandled exception recorded in blackbox log Spotted by Martin

Re: Simple extension gives TypeError: expected a 20-byte hash

2018-05-16 Thread Yuya Nishihara
On Wed, 16 May 2018 06:58:42 +, Marco Wegner wrote: > im trying to write an extension, that adds some Text at the end of the > commitmessage. > But my example gives me an TypeError: expected a 20-byte hash error on > commit. Where is my failure? > Here is my extension code: > > #!/usr/bin/py

D3553: notify: add option to include function names in the diff output

2018-05-16 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger updated this revision to Diff 8715. joerg.sonnenberger edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3553?vs=8673&id=8715 REVISION DETAIL https://phab.mercurial-scm.org/D3553 AFFECTED FILES hgex

D3561: dispatch: drop redundant setting of "ret" to -1

2018-05-16 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment. In https://phab.mercurial-scm.org/D3561#56386, @yuja wrote: > > diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py > > > > - a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -230,7 +230,6 @@ except IOError as inst: if inst.errno != errno.EP

Re: [PATCH 2 of 2] dispatch: mask negative exit code recorded in blackbox log

2018-05-16 Thread Martin von Zweigbergk via Mercurial-devel
On Wed, May 16, 2018 at 5:19 AM Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara > # Date 1526469743 -32400 > # Wed May 16 20:22:23 2018 +0900 > # Node ID a548e75b75e778f26a50b429fc7b31618cc34d3f > # Parent d5956b687bbc39c686390b45d08caea976b8b7dd > dispatch: mask negat

D3570: tests: update py3 test since json fields are now sorted

2018-05-16 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The fields have been sorted since https://phab.mercurial-scm.org/rHG814151cd8c4a232c8bab7cf305c17b0b9677cd0c (logcmdutil: rewrite jsonchangeset printer to be

D3536: json: reject unicode on py2 as well

2018-05-16 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 8717. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3536?vs=8657&id=8717 REVISION DETAIL https://phab.mercurial-scm.org/D3536 AFFECTED FILES mercurial/templatefilters.py CHANGE DETAILS diff --git a/mercurial

D3536: json: reject unicode on py2 as well

2018-05-16 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment. In https://phab.mercurial-scm.org/D3536#56051, @yuja wrote: > > - elif isinstance(obj, str): > > - # This branch is unreachable on Python 2, because bytes == str > > - # and we'll return in the next-earlier block in the elif > > - # ladder. On Python 3, th

D3569: py3: convert the report to bytes

2018-05-16 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 8719. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3569?vs=8708&id=8719 REVISION DETAIL https://phab.mercurial-scm.org/D3569 AFFECTED FILES mercurial/dispatch.py CHANGE DETAILS diff --git a/mercurial/dispatch.p

[PATCH] filemerge: support specfiying a python function to custom merge-tools

2018-05-16 Thread tom_hindle
# HG changeset patch # User hindlemail # Date 1526501501 21600 # Wed May 16 14:11:41 2018 -0600 # Node ID 7e7e8dd8e70bbba7cca9a5f17371697c159e6b14 # Parent 0fa050bc68cb7a3bfb67390f2a84ff1c7efa9778 filemerge: support specfiying a python function to custom merge-tools Eliminates the need to sp

D3571: tests: test-parseindex.t works just fine with chg

2018-05-16 Thread spectral (Kyle Lippincott)
spectral created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY In https://phab.mercurial-scm.org/rHG538e850ae73745c55bbb7da1ee3659c21a315688 I annotated tests that failed with chg with "#require no-chg", but did not investig

Re: [PATCH 6 of 6] lfs: enable the final download count status message

2018-05-16 Thread Matt Harbison
On Fri, 20 Apr 2018 11:01:30 -0400, Pulkit Goyal <7895pul...@gmail.com> wrote: On Sun, Apr 15, 2018 at 12:14 PM, Matt Harbison wrote: # HG changeset patch # User Matt Harbison # Date 1523754995 14400 # Sat Apr 14 21:16:35 2018 -0400 # Node ID acd5a25c179269df689b8799aa7cbc52d5451251 #

[PATCH 1 of 2] phabricator: register config settings

2018-05-16 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1526525067 14400 # Wed May 16 22:44:27 2018 -0400 # Node ID 8003050dd9ee58fbc1eceda17aec5332830e9da2 # Parent c3fd9a0f8277a4abbc709a91f642f841bad1cc62 phabricator: register config settings I didn't bother registering the deprecated phabricato

[PATCH 2 of 2] phabricator: add a config knob for `phabsend --amend`

2018-05-16 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1526525604 14400 # Wed May 16 22:53:24 2018 -0400 # Node ID 8c2bbfe099b44820f8722e873852d6bd5811c111 # Parent 8003050dd9ee58fbc1eceda17aec5332830e9da2 phabricator: add a config knob for `phabsend --amend` Since it's useful for certain workflo