[Bug 6480] New: test-convert-cvs assumes existence of "python"
https://bz.mercurial-scm.org/show_bug.cgi?id=6480 Bug ID: 6480 Summary: test-convert-cvs assumes existence of "python" Product: Mercurial Version: 5.7 Hardware: All OS: NetBSD Status: UNCONFIRMED Severity: bug Priority: wish Component: Mercurial Assignee: bugzi...@mercurial-scm.org Reporter: t...@giga.or.at CC: mercurial-devel@mercurial-scm.org Python Version: --- Not all packaging systems provide a "python" symlink to the python[23] to use. This makes test-convert-cvs.t fail on pkgsrc systems, with: --- /scratch/devel/py-mercurial/work/mercurial-5.7/tests/test-convert-cvs.t +++ /scratch/devel/py-mercurial/work/mercurial-5.7/tests/test-convert-cvs.t.err @@ -615,9 +615,10 @@ > @@ > ''').lstrip()) > EOF + $TESTTMP.sh: python: not found + [127] $ cvscall -q checkout transcoding - U transcoding/file Test converting in normal case -- @@ -625,18 +626,8 @@ (filtering by grep in order to check only form of debug messages) $ hg convert --config convert.cvsps.logencoding=utf-8,euc-jp,cp932 -q --debug transcoding transcoding-hg | grep 'transcoding by' - transcoding by utf-8: 1.1 of file - transcoding by utf-8: 1.1.1.1 of file - transcoding by utf-8: 1.2 of file - transcoding by euc-jp: 1.3 of file - transcoding by cp932: 1.4 of file + [1] $ hg -R transcoding-hg --encoding utf-8 log -T "{rev}: {desc}\n" - 5: update tags - 4: import - 3: \xe3\x81\x82 (cp932) (esc) - 2: \xe3\x81\x82 (euc-jp) (esc) - 1: \xe3\x81\x82 (utf-8) (esc) - 0: Initial revision $ rm -rf transcoding-hg Test converting in error cases @@ -645,15 +636,13 @@ unknown encoding in convert.cvsps.logencoding $ hg convert --config convert.cvsps.logencoding=foobar -q transcoding transcoding-hg - abort: unknown encoding: foobar - (check convert.cvsps.logencoding configuration) - [255] + cvslog hook: 0 entries + cvschangesets hook: 0 changesets $ rm -rf transcoding-hg no acceptable encoding in convert.cvsps.logencoding $ hg convert --config convert.cvsps.logencoding=utf-8,euc-jp -q transcoding transcoding-hg - abort: no encoding can transcode CVS log message for 1.4 of file - (check convert.cvsps.logencoding configuration) - [255] + cvslog hook: 0 entries + cvschangesets hook: 0 changesets $ rm -rf transcoding-hg I assume the second and third chunks are followup failures. -- 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
D9955: build: fake PEP440 versions
joerg.sonnenberger created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If the current version is not exactly a tag, use a local version specifier to fix it up. PEP 440 uses the "+" separator and only allows alphanumeric and dot, so use dot for further separations. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9955 AFFECTED FILES setup.py CHANGE DETAILS diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -419,9 +419,9 @@ ltag = sysstr(hg.run(ltagcmd)) changessincecmd = ['log', '-T', 'x\n', '-r', "only(.,'%s')" % ltag] changessince = len(hg.run(changessincecmd).splitlines()) -version = '%s+%s-%s' % (ltag, changessince, hgid) +version = '%s+hg%s.%s' % (ltag, changessince, hgid) if version.endswith('+'): -version += time.strftime('%Y%m%d') +version = version[:-1] + 'local' + time.strftime('%Y%m%d') elif os.path.exists('.hg_archival.txt'): kw = dict( [[t.strip() for t in l.split(':', 1)] for l in open('.hg_archival.txt')] @@ -430,11 +430,15 @@ version = kw['tag'] elif 'latesttag' in kw: if 'changessincelatesttag' in kw: -version = '%(latesttag)s+%(changessincelatesttag)s-%(node).12s' % kw +version = ( +'%(latesttag)s+.%(changessincelatesttag)s.%(node).12s' % kw +) else: -version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw +version = ( +'%(latesttag)s+.%(latesttagdistance)s.%(node).12s' % kw +) else: -version = kw.get('node', '')[:12] +version = '0+' + kw.get('node', '')[:12] if version: versionb = version @@ -451,20 +455,6 @@ ), ) -try: -oldpolicy = os.environ.get('HGMODULEPOLICY', None) -os.environ['HGMODULEPOLICY'] = 'py' -from mercurial import __version__ - -version = __version__.version -except ImportError: -version = b'unknown' -finally: -if oldpolicy is None: -del os.environ['HGMODULEPOLICY'] -else: -os.environ['HGMODULEPOLICY'] = oldpolicy - class hgbuild(build): # Insert hgbuildmo first so that files in mercurial/locale/ are found @@ -1683,8 +1673,8 @@ # unicode on Python 2 still works because it won't contain any # non-ascii bytes and will be implicitly converted back to bytes # when operated on. -assert isinstance(version, bytes) -setupversion = version.decode('ascii') +assert isinstance(version, str) +setupversion = version extra = {} 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
[PATCH] largefiles: properly pass kwargs into url.open
# HG changeset patch # User Jordi Gutiérrez Hermoso # Date 1612475986 18000 # Thu Feb 04 16:59:46 2021 -0500 # Node ID fee215d5eb63abf93c50de4355fbd46123f50cba # Parent 95b276283b671cd835a2a0918f4297eb2baab425 largefiles: properly pass kwargs into url.open The url.open function has acquired a lot of kwargs over the years. When running `hg import http://example.com/hg/diff/1`, since at least a708e1e4d7a8 in March, 2018, the calling sites for url.open try to pass a `sendaccept` parameter that largefiles' override doesn't accept. Currently that stack traces something like this: Traceback (most recent call last): File "/tmp/hgtests.sv744r5t/install/bin/hg", line 59, in dispatch.run() File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 143, in run status = dispatch(req) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 245, in dispatch status = _rundispatch(req) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 289, in _rundispatch ret = _runcatch(req) or 0 File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 465, in _runcatch return _callcatch(ui, _runcatchfunc) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 475, in _callcatch return scmutil.callcatch(ui, func) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/scmutil.py", line 155, in callcatch return func() File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 455, in _runcatchfunc return _dispatch(req) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1259, in _dispatch lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 913, in runcommand ret = _runcommand(ui, options, cmd, d) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1270, in _runcommand return cmdfunc() File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1256, in d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/util.py", line 1867, in check return func(*args, **kwargs) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/commands.py", line 4184, in import_ patchfile = hg.openpath(ui, patchurl, sendaccept=False) File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/hg.py", line 181, in openpath return url.open(ui, path, sendaccept=sendaccept) TypeError: openlargefile() got an unexpected keyword argument 'sendaccept' So, just accept and pass along any kwargs of the overridden function. diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1853,7 +1853,7 @@ def upgraderequirements(orig, repo): @eh.wrapfunction(urlmod, b'open') -def openlargefile(orig, ui, url_, data=None): +def openlargefile(orig, ui, url_, data=None, **kwargs): if url_.startswith(_lfscheme): if data: msg = b"cannot use data on a 'largefile://' url" @@ -1861,4 +1861,4 @@ def openlargefile(orig, ui, url_, data=N lfid = url_[len(_lfscheme) :] return storefactory.getlfile(ui, lfid) else: -return orig(ui, url_, data=data) +return orig(ui, url_, data=data, **kwargs) diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t +++ b/tests/test-hgweb-diffs.t @@ -1138,6 +1138,21 @@ test import rev as raw-rev $ cd test1 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1 +repeat test above, with largefiles enabled + + $ cd .. + $ rm -r test1 + $ hg clone -r0 test test1 + adding changesets + adding manifests + adding file changes + added 1 changesets with 2 changes to 2 files + new changesets 0cd96de13884 + updating to branch default + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd test1 + $ hg import --config extensions.largefiles= -q --bypass --exact http://localhost:$HGPORT/rev/1 + raw revision with diff block numbers $ killdaemons.py ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@46463: 5 new changesets (1 on stable)
5 new changesets (1 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/128a17d8436f changeset: 46459:128a17d8436f branch: stable user:Yuya Nishihara date:Thu Feb 04 19:56:45 2021 +0900 summary: procutil: extend gui test to detect wayland session (issue6479) https://www.mercurial-scm.org/repo/hg/rev/8214c71589f6 changeset: 46460:8214c71589f6 parent: 46456:1e26b882d704 user:Matt Harbison date:Tue Feb 02 10:56:53 2021 -0500 summary: tests: print the server error log in `test-url-download.t` https://www.mercurial-scm.org/repo/hg/rev/f3f4d1b7dc97 changeset: 46461:f3f4d1b7dc97 user:Simon Sapin date:Mon Feb 01 19:30:28 2021 +0100 summary: rhg: Add basic test with a shared repository https://www.mercurial-scm.org/repo/hg/rev/d03b0601e0eb changeset: 46462:d03b0601e0eb user:Simon Sapin date:Thu Jan 14 13:04:12 2021 +0100 summary: rhg: initial support for shared repositories https://www.mercurial-scm.org/repo/hg/rev/95b276283b67 changeset: 46463:95b276283b67 bookmark:@ tag: tip user:Simon Sapin date:Mon Feb 01 11:41:10 2021 +0100 summary: rhg: add support for share-safe -- 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
Re: [PATCH STABLE] procutil: extend gui test to detect wayland session (issue6479)
Thanks for doing this patch so quickly Yuja. LGTM On 2/4/21 12:21 PM, Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1612436205 -32400 # Thu Feb 04 19:56:45 2021 +0900 # Branch stable # Node ID 6cc6b8610cec85dc624f4bb6568c2fd16ac018d1 # Parent 14feaa5792ed116ec8cc8469fc3de976fb4dd8f5 procutil: extend gui test to detect wayland session (issue6479) diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -546,7 +546,11 @@ def _gui(): # pure build; use a safe default return True else: -return pycompat.iswindows or encoding.environ.get(b"DISPLAY") +return ( +pycompat.iswindows +or encoding.environ.get(b"DISPLAY") +or encoding.environ.get(b"WAYLAND_DISPLAY") +) def gui(): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH STABLE] procutil: extend gui test to detect wayland session (issue6479)
# HG changeset patch # User Yuya Nishihara # Date 1612436205 -32400 # Thu Feb 04 19:56:45 2021 +0900 # Branch stable # Node ID 6cc6b8610cec85dc624f4bb6568c2fd16ac018d1 # Parent 14feaa5792ed116ec8cc8469fc3de976fb4dd8f5 procutil: extend gui test to detect wayland session (issue6479) diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -546,7 +546,11 @@ def _gui(): # pure build; use a safe default return True else: -return pycompat.iswindows or encoding.environ.get(b"DISPLAY") +return ( +pycompat.iswindows +or encoding.environ.get(b"DISPLAY") +or encoding.environ.get(b"WAYLAND_DISPLAY") +) def gui(): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel