D5981: tests: drop a few unnecessary "(glob)"
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I believe thise are unnecessary since https://phab.mercurial-scm.org/rHGa8d3a4be066e0d3b3d01a90a98dc1907cf4fad3b (windows: use util.localpath for repo-relative paths in getuipathfn(), 2019-02-11), but someone with a Windows machine should confirm. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5981 AFFECTED FILES tests/test-status-color.t tests/test-status.t CHANGE DETAILS diff --git a/tests/test-status.t b/tests/test-status.t --- a/tests/test-status.t +++ b/tests/test-status.t @@ -116,11 +116,11 @@ ? ../b/in_b ? ../in_root $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes - ? a/1/in_a_1 (glob) - ? a/in_a (glob) - ? b/1/in_b_1 (glob) - ? b/2/in_b_2 (glob) - ? b/in_b (glob) + ? a/1/in_a_1 + ? a/in_a + ? b/1/in_b_1 + ? b/2/in_b_2 + ? b/in_b ? in_root $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes ? 1/in_a_1 @@ -163,11 +163,11 @@ ? ../b/in_b ? ../in_root $ HGPLAIN=1 hg status --cwd a - ? a/1/in_a_1 (glob) - ? a/in_a (glob) - ? b/1/in_b_1 (glob) - ? b/2/in_b_2 (glob) - ? b/in_b (glob) + ? a/1/in_a_1 + ? a/in_a + ? b/1/in_b_1 + ? b/2/in_b_2 + ? b/in_b ? in_root if relative paths are explicitly off, tweakdefaults doesn't change it diff --git a/tests/test-status-color.t b/tests/test-status-color.t --- a/tests/test-status-color.t +++ b/tests/test-status-color.t @@ -31,11 +31,11 @@ [status.unknown|? ][status.unknown|in_root] HGPLAIN disables color $ HGPLAIN=1 hg status --color=debug - ? a/1/in_a_1 (glob) - ? a/in_a (glob) - ? b/1/in_b_1 (glob) - ? b/2/in_b_2 (glob) - ? b/in_b (glob) + ? a/1/in_a_1 + ? a/in_a + ? b/1/in_b_1 + ? b/2/in_b_2 + ? b/in_b ? in_root HGPLAINEXCEPT=color does not disable color $ HGPLAINEXCEPT=color hg status --color=debug To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] tests: correct the remaining fallout from recent path style changes on Windows
On Sun, Feb 17, 2019 at 7:45 PM Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1550461152 18000 > # Sun Feb 17 22:39:12 2019 -0500 > # Node ID 8e0644d0b8d262c19029fc43c4f8d08ff2571bb1 > # Parent 99ed0ac693fb7c6045ecf69cf17909e8dc48a85a > tests: correct the remaining fallout from recent path style changes on > Windows > Queued, thanks. I agree that this is better than setting ui.slash in the test case. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5792: uncommit: added interactive mode(issue6062)
taapas1128 added a comment. @durin42 I have sent the patch from `hg-stable` (https://www.mercurial-scm.org/repo/hg-stable) . Maybe it is this reason you are unable to apply the patch. Should I send a patch for `hg` repo ? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5792 To: taapas1128, #hg-reviewers, durin42 Cc: durin42, pulkit, lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] tests: correct the remaining fallout from recent path style changes on Windows
# HG changeset patch # User Matt Harbison # Date 1550461152 18000 # Sun Feb 17 22:39:12 2019 -0500 # Node ID 8e0644d0b8d262c19029fc43c4f8d08ff2571bb1 # Parent 99ed0ac693fb7c6045ecf69cf17909e8dc48a85a tests: correct the remaining fallout from recent path style changes on Windows Per @martinvonz, `ui.slash` set by the test runner is now capable of playing a more active role.[1] I verified that both of these work by setting `ui.slash` to False, but these changes seem cleaner. The problem with check-perf-code.py was that the proper imports were not being whitelisted due to '\' vs '/'. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-February/128701.html diff --git a/tests/check-perf-code.py b/tests/check-perf-code.py --- a/tests/check-perf-code.py +++ b/tests/check-perf-code.py @@ -24,7 +24,7 @@ perfpypats = [ def modulewhitelist(names): replacement = [('.py', ''), ('.c', ''), # trim suffix - ('mercurial%s' % (os.sep), ''), # trim "mercurial/" path + ('mercurial%s' % ('/'), ''), # trim "mercurial/" path ] ignored = {'__init__'} modules = {} diff --git a/tests/test-hgignore.t b/tests/test-hgignore.t --- a/tests/test-hgignore.t +++ b/tests/test-hgignore.t @@ -356,7 +356,7 @@ Windows paths are accepted on input $ rm dir1/.hgignore $ echo "dir1/file*" >> .hgignore $ hg debugignore "dir1\file2" - dir1\file2 is ignored + dir1/file2 is ignored (ignore rule in $TESTTMP\ignorerepo\.hgignore, line 4: 'dir1/file*') $ hg up -qC . ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5801: files: respect ui.relative-paths
mharbison72 added a comment. In https://phab.mercurial-scm.org/D5801#87302, @martinvonz wrote: > In https://phab.mercurial-scm.org/D5801#87300, @mharbison72 wrote: > > > In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote: > > > > > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though. > > > > > > The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences. The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway. > > > Ah, so the only difference is the extra "import newer module separately in try clause for early Mercurial" in `contrib/perf.py` then. This patch didn't change that file. Can you check again that it was this patch that caused that and that it's not just flaky? Correct. The extra noise makes it hard to see the actual problems sometimes, and it makes trivial things like fixing (glob) endings more of a nuisance. But I don't see a way to handle that. This one is definitely the problem, because the failing *.t invokes `hg files` to generate the whitelist. It turns out, we can either set `ui.slash=False` or just not use `os.sep` in check-perf-code.py. I'm leaning toward the latter. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5801 To: martinvonz, #hg-reviewers Cc: mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5980: py3: add a new file with only failing tests
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We have only 5 failing tests left now according to buildbot. So let's have a list of failing tests instead of passing one. I am not deleting python3-whitelist for now because it is used by buildbot. Once buildbot is configured to read tests from here, we should delete that. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5980 AFFECTED FILES contrib/py3-fail CHANGE DETAILS diff --git a/contrib/py3-fail b/contrib/py3-fail new file mode 100644 --- /dev/null +++ b/contrib/py3-fail @@ -0,0 +1,5 @@ +test-devel-warnings.t +test-hook.t +test-lfs-serve-access.t +test-notify.t +test-paths.t To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5979: py3: whitelist 5 new passing tests caught by buildbot
pulkit created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Thanks to indygreg and durin42 recent patches. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5979 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -310,6 +310,7 @@ test-http-clone-r.t test-http-permissions.t test-http-protocol.t +test-http-proxy.t test-http.t test-https.t test-hybridencode.py @@ -366,6 +367,7 @@ test-lfs-bundle.t test-lfs-largefiles.t test-lfs-pointer.py +test-lfs-serve.t test-lfs-test-server.t test-lfs.t test-linelog.py @@ -607,13 +609,15 @@ test-remotefilelog-histpack.py test-remotefilelog-http.t test-remotefilelog-keepset.t +test-remotefilelog-linknodes.t test-remotefilelog-local.t test-remotefilelog-log.t test-remotefilelog-partial-shallow.t test-remotefilelog-permissions.t test-remotefilelog-permisssions.t test-remotefilelog-prefetch.t test-remotefilelog-pull-noshallow.t +test-remotefilelog-push-pull.t test-remotefilelog-repack-fast.t test-remotefilelog-repack.t test-remotefilelog-share.t @@ -646,6 +650,7 @@ test-revset-dirstate-parents.t test-revset-legacy-lookup.t test-revset-outgoing.t +test-revset.t test-revset2.t test-rollback.t test-run-tests.py To: pulkit, #hg-reviewers Cc: mjpieters, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5801: files: respect ui.relative-paths
martinvonz added a comment. In https://phab.mercurial-scm.org/D5801#87300, @mharbison72 wrote: > In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote: > > > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though. > > > The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences. The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway. Ah, so the only difference is the extra "import newer module separately in try clause for early Mercurial" in `contrib/perf.py` then. This patch didn't change that file. Can you check again that it was this patch that caused that and that it's not just flaky? In https://phab.mercurial-scm.org/D5801#87300, @mharbison72 wrote: > In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote: > > > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though. > > > The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences. The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5801 To: martinvonz, #hg-reviewers Cc: mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 6082] New: Support ! pattern negation in .hgignore as for Git
https://bz.mercurial-scm.org/show_bug.cgi?id=6082 Bug ID: 6082 Summary: Support ! pattern negation in .hgignore as for Git Product: Mercurial Version: unspecified Hardware: PC OS: Linux Status: UNCONFIRMED Severity: feature Priority: wish Component: Mercurial Assignee: bugzi...@mercurial-scm.org Reporter: pierre.aug...@univ-grenoble-alpes.fr CC: mercurial-devel@mercurial-scm.org It's difficult to work with hg-git for some Git repositories (example https://github.com/pyenv) because they use in their .gitignore the ! pattern. From the Git documentation: "An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. " For a repository using such pattern, one gets: `.gitignore: unsupported ignore pattern '!/.gitignore'` There is an issue in the hg-git repository on Bitbucket (https://bitbucket.org/durin42/hg-git/issues/190/add-support-for-gitignore-pattern-negation), but it seems that it should be solved at the Mercurial level. Note that Git does something reasonable in terms of performance ("It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.") so Mercurial could do the same? -- 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
D5792: uncommit: added interactive mode(issue6062)
durin42 added a comment. Anything recent. @ on https://mercurial-scm.org/hg is fine. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5792 To: taapas1128, #hg-reviewers, durin42 Cc: durin42, pulkit, lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5801: files: respect ui.relative-paths
mharbison72 added a comment. In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote: > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though. The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences. The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5801 To: martinvonz, #hg-reviewers Cc: mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5792: uncommit: added interactive mode(issue6062)
taapas1128 added a comment. @durin42 to which rev should I rebase it to ? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5792 To: taapas1128, #hg-reviewers, durin42 Cc: durin42, pulkit, lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 6081] New: Improve message "waiting for lock ..." ?
https://bz.mercurial-scm.org/show_bug.cgi?id=6081 Bug ID: 6081 Summary: Improve message "waiting for lock ..." ? Product: Mercurial Version: unspecified Hardware: PC OS: Linux Status: UNCONFIRMED Severity: feature Priority: wish Component: Mercurial Assignee: bugzi...@mercurial-scm.org Reporter: pierre.aug...@univ-grenoble-alpes.fr CC: mercurial-devel@mercurial-scm.org Some students were confused by the message "waiting for lock on working directory of /home/me/tmp/tmp_repo held by process '6631' on host 'gre/effc'" See https://bz.mercurial-scm.org/show_bug.cgi?id=4752 I was told that Git prints a clearer explanation: " $ git commit -a fatal: Unable to create '/tmp/git/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue. " Wouldn't it be good to print something as clear/explicit as Git? -- 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 7 of 7] tests: bulk changes to avoid whitespace errors of check-code.py
# HG changeset patch # User FUJIWARA Katsunori # Date 1550417245 -32400 # Mon Feb 18 00:27:25 2019 +0900 # Node ID 2f6a1d093864a07557a439d6c8fa0f583bc6a4ce # Parent 4f1714df74136e8b46a35810e2e46a7d25b243a8 # Available At https://bitbucket.org/foozy/mercurial-wip # hg pull https://bitbucket.org/foozy/mercurial-wip -r 2f6a1d093864 # EXP-Topic tests-fix-check-code-errors tests: bulk changes to avoid whitespace errors of check-code.py This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. This revision avoids "whitespace" errors of check-code.py below: - missing whitespace after "," - missing whitespace in expression - no whitespace around "=" for named parameters - wrong whitespace around "=" diff --git a/tests/test-bundle2-pushback.t b/tests/test-bundle2-pushback.t --- a/tests/test-bundle2-pushback.t +++ b/tests/test-bundle2-pushback.t @@ -25,7 +25,8 @@ > b'key': b'new-server-mark', > b'old': b'', > b'new': b'tip'} - > encodedparams = [(k, pushkey.encode(v)) for (k,v) in params.items()] + > encodedparams = [(k, pushkey.encode(v)) + > for (k, v) in params.items()] > op.reply.newpart(b'pushkey', mandatoryparams=encodedparams) > else: > op.reply.newpart(b'output', data=b'pushback not enabled') diff --git a/tests/test-convert-cvs.t b/tests/test-convert-cvs.t --- a/tests/test-convert-cvs.t +++ b/tests/test-convert-cvs.t @@ -11,11 +11,11 @@ $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH $ cat > cvshooks.py < def cvslog(ui,repo,hooktype,log): - > ui.write(b'%s hook: %d entries\n' % (hooktype,len(log))) + > def cvslog(ui, repo, hooktype, log): + > ui.write(b'%s hook: %d entries\n' % (hooktype, len(log))) > - > def cvschangesets(ui,repo,hooktype,changesets): - > ui.write(b'%s hook: %d changesets\n' % (hooktype,len(changesets))) + > def cvschangesets(ui, repo, hooktype, changesets): + > ui.write(b'%s hook: %d changesets\n' % (hooktype, len(changesets))) > EOF $ hookpath=`pwd` $ cat <> $HGRCPATH diff --git a/tests/test-extension.t b/tests/test-extension.t --- a/tests/test-extension.t +++ b/tests/test-extension.t @@ -640,7 +640,7 @@ import-checker.py or so on their content Make sure a broken uisetup doesn't globally break hg: $ cat > $TESTTMP/baduisetup.py < def uisetup(ui): - > 1/0 + > 1 / 0 > EOF Even though the extension fails during uisetup, hg is still basically usable: @@ -649,7 +649,7 @@ Even though the extension fails during u File "*/mercurial/extensions.py", line *, in _runuisetup (glob) uisetup(ui) File "$TESTTMP/baduisetup.py", line 2, in uisetup - 1/0 + 1 / 0 ZeroDivisionError: * by zero (glob) *** failed to set up extension baduisetup: * by zero (glob) Mercurial Distributed SCM (version *) (glob) diff --git a/tests/test-hgweb-no-request-uri.t b/tests/test-hgweb-no-request-uri.t --- a/tests/test-hgweb-no-request-uri.t +++ b/tests/test-hgweb-no-request-uri.t @@ -62,12 +62,12 @@ should be used from d74fc8dec2b4 onward > output = stringio() > env['PATH_INFO'] = '/' > env['QUERY_STRING'] = 'style=atom' - > process(hgweb.hgweb(b'.', name = b'repo')) + > process(hgweb.hgweb(b'.', name=b'repo')) > > output = stringio() > env['PATH_INFO'] = '/file/tip/' > env['QUERY_STRING'] = 'style=raw' - > process(hgweb.hgweb(b'.', name = b'repo')) + > process(hgweb.hgweb(b'.', name=b'repo')) > > output = stringio() > env['PATH_INFO'] = '/' diff --git a/tests/test-import-context.t b/tests/test-import-context.t --- a/tests/test-import-context.t +++ b/tests/test-import-context.t @@ -12,9 +12,9 @@ Test applying context diffs > count = int(pattern[0:-1]) > char = pattern[-1].encode('utf8') + b'\n' > if not lasteol and i == len(patterns) - 1: - > fp.write((char*count)[:-1]) + > fp.write((char * count)[:-1]) > else: - > fp.write(char*count) + > fp.write(char * count) > fp.close() > EOF $ cat > cat.py < # > # this makes the original largefiles code abort: > _origcopyfileobj = shutil.copyfileobj - > def copyfileobj(fsrc, fdst, length=16*1024): + > def copyfileobj(fsrc, fdst, length=16 * 1024): > # allow journal files (used by transaction) to be written > if b'journal.' in fdst.name: > return _origcopyfileobj(fsrc, fdst, length) diff --git a/tests/test-mq-missingfiles.t b/tests/test-mq-missingfiles.t --- a/tests/test-mq-missingfiles.t +++ b/tests/test-mq-missingfiles.t @@ -15,10 +15,10 @@ future qrefresh. > > f = open(path, 'wb') > for i in range(len(args) // 2): - >count, s = args[2*i:2*i+2] + >count, s = args[2 * i:2 * i + 2] >count = int(count) >s = encode(s) - >f.write(s*count) + >f.write(s * count)
[PATCH 3 of 7] tests: bulk change to avoid "unneeded trailing ', ' ..." error of check-code.py
# HG changeset patch # User FUJIWARA Katsunori # Date 1550417245 -32400 # Mon Feb 18 00:27:25 2019 +0900 # Node ID d294202804a296c3f03e1c013886c5c1f174be6c # Parent 308243c661d7fb232997d290dfd861b95e36f090 # Available At https://bitbucket.org/foozy/mercurial-wip # hg pull https://bitbucket.org/foozy/mercurial-wip -r d294202804a2 # EXP-Topic tests-fix-check-code-errors tests: bulk change to avoid "unneeded trailing ',' ..." error of check-code.py This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. "trailing ','" at the end of command option list in the code fragment of test-bundle2-format.t is still left as it is, in order to follow the style of command definitions in Mercurial core. diff --git a/tests/test-bundle2-format.t b/tests/test-bundle2-format.t --- a/tests/test-bundle2-format.t +++ b/tests/test-bundle2-format.t @@ -82,7 +82,8 @@ Create an extension to test bundle2 API > (b'', b'genraise', False, b'includes a part that raise an exception during generation'), > (b'', b'timeout', False, b'emulate a timeout during bundle generation'), > (b'r', b'rev', [], b'includes those changeset in the bundle'), - > (b'', b'compress', b'', b'compress the stream'),], + > (b'', b'compress', b'', b'compress the stream'), + > ], > b'[OUTPUTFILE]') > def cmdbundle2(ui, repo, path=None, **opts): > """write a bundle2 container on standard output""" diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -569,7 +569,7 @@ iterable in addbranchrevs() > extensions.loadall(myui) > extensions.populateui(myui) > repo = hg.repository(myui, b'a') - > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable",]) + > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable"]) > EOF $ "$PYTHON" branchclone.py ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 5 of 7] tests: bulk changes to avoid "omit superfluous pass" check-code.py error
# HG changeset patch # User FUJIWARA Katsunori # Date 1550417245 -32400 # Mon Feb 18 00:27:25 2019 +0900 # Node ID 617e8b6f8721d3f9ba351c614a47dfd287505704 # Parent c1c8ae482985411a899cced234c2ef07d508c356 # Available At https://bitbucket.org/foozy/mercurial-wip # hg pull https://bitbucket.org/foozy/mercurial-wip -r 617e8b6f8721 # EXP-Topic tests-fix-check-code-errors tests: bulk changes to avoid "omit superfluous pass" check-code.py error This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. diff --git a/tests/test-extension.t b/tests/test-extension.t --- a/tests/test-extension.t +++ b/tests/test-extension.t @@ -688,13 +688,11 @@ hide outer repo > @command(b'debugfoobar', [], b'hg debugfoobar') > def debugfoobar(ui, repo, *args, **opts): > "yet another debug command" - > pass > @command(b'foo', [], b'hg foo') > def foo(ui, repo, *args, **opts): > """yet another foo command > This command has been DEPRECATED since forever. > """ - > pass > EOF $ debugpath=`pwd`/debugextension.py $ echo "debugextension = $debugpath" >> $HGRCPATH @@ -964,7 +962,6 @@ Test help topic with same name as extens > @command(b'multirevs', [], b'ARG', norepo=True) > def multirevs(ui, repo, arg, *args, **opts): > """multirevs command""" - > pass > EOF $ echo "multirevs = multirevs.py" >> $HGRCPATH diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -825,7 +825,6 @@ this is a section and erroring out weird > @command(b'hashelp', [], b'hg hashelp', norepo=True) > def hashelp(ui, *args, **kwargs): > """Extension command's help""" - > pass > > def uisetup(ui): > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 7] tests: use NO_CHECK_EOF as heredoc limit mark to omit checking code fragments
# HG changeset patch # User FUJIWARA Katsunori # Date 1550417245 -32400 # Mon Feb 18 00:27:25 2019 +0900 # Node ID b618569414e7d2db2c1d31a17c15bda3b8830901 # Parent 6704696141b85f4a5b6b13171548085cae4dafe5 # Available At https://bitbucket.org/foozy/mercurial-wip # hg pull https://bitbucket.org/foozy/mercurial-wip -r b618569414e7 # EXP-Topic tests-fix-check-code-errors tests: use NO_CHECK_EOF as heredoc limit mark to omit checking code fragments This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. "primes.py" embedded in test-highlight.t causes an error of check-commit.py below: don't use .next(), use next(...) But changing embedded primes.py is painful, because it is committed in test script, and affects hash IDs. On the other hand, primes.py itself is never executed in test script. Therefore, this patch uses NO_CHECK_EOF as heredoc limit mark in order to omit any checking on this code fragments. diff --git a/tests/test-highlight.t b/tests/test-highlight.t --- a/tests/test-highlight.t +++ b/tests/test-highlight.t @@ -19,7 +19,7 @@ create random Python file to exercise Pygments - $ cat < primes.py + $ cat < primes.py > """Fun with generators. Corresponding Haskell implementation: > > primes = 2 : sieve [3, 5..] @@ -51,7 +51,7 @@ create random Python file to exercise Py > n = 10 > p = primes() > print("The first %d primes: %s" % (n, list(itertools.islice(p, n - > EOF + > NO_CHECK_EOF $ echo >> primes.py # to test html markup with an empty line just before EOF $ hg ci -Ama adding primes.py ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 7] tests: replace imported module to avoid check-code.py error
# HG changeset patch # User FUJIWARA Katsunori # Date 1550417245 -32400 # Mon Feb 18 00:27:25 2019 +0900 # Node ID c1c8ae482985411a899cced234c2ef07d508c356 # Parent d294202804a296c3f03e1c013886c5c1f174be6c # Available At https://bitbucket.org/foozy/mercurial-wip # hg pull https://bitbucket.org/foozy/mercurial-wip -r c1c8ae482985 # EXP-Topic tests-fix-check-code-errors tests: replace imported module to avoid check-code.py error This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. diff --git a/tests/test-status.t b/tests/test-status.t --- a/tests/test-status.t +++ b/tests/test-status.t @@ -290,7 +290,7 @@ hg status -A: $ hg status -A -Tpickle > pickle >>> from __future__ import print_function - >>> import pickle + >>> from mercurial.util import pickle >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb"))) >>> for s, p in data: print("%s %s" % (s, p)) ! deleted ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5801: files: respect ui.relative-paths
martinvonz added a comment. In https://phab.mercurial-scm.org/D5801#87273, @mharbison72 wrote: > For some reason, this breaks test-contrib-perf.t: > > https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/1274/steps/run-tests.py%20%28python%202.7.13%29/logs/stdio > > I also tried setting True and False in ui.relative-paths, to no effect. Any ideas? I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5801 To: martinvonz, #hg-reviewers Cc: mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 6 of 7] tests: replace "naked except clause" to avoid check-code.py error
# HG changeset patch # User FUJIWARA Katsunori # Date 1550417245 -32400 # Mon Feb 18 00:27:25 2019 +0900 # Node ID 4f1714df74136e8b46a35810e2e46a7d25b243a8 # Parent 617e8b6f8721d3f9ba351c614a47dfd287505704 # Available At https://bitbucket.org/foozy/mercurial-wip # hg pull https://bitbucket.org/foozy/mercurial-wip -r 4f1714df7413 # EXP-Topic tests-fix-check-code-errors tests: replace "naked except clause" to avoid check-code.py error This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. diff --git a/tests/test-acl.t b/tests/test-acl.t --- a/tests/test-acl.t +++ b/tests/test-acl.t @@ -38,7 +38,7 @@ > def fakegetusers(ui, group): > try: > return acl._getusersorig(ui, group) - > except: + > except BaseException: > return [b"fred", b"betty"] > acl._getusersorig = acl._getusers > acl._getusers = fakegetusers ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 7] tests: define class in modern style to avoid check-code.py error
# HG changeset patch # User FUJIWARA Katsunori # Date 1550417245 -32400 # Mon Feb 18 00:27:25 2019 +0900 # Node ID 308243c661d7fb232997d290dfd861b95e36f090 # Parent b618569414e7d2db2c1d31a17c15bda3b8830901 # Available At https://bitbucket.org/foozy/mercurial-wip # hg pull https://bitbucket.org/foozy/mercurial-wip -r 308243c661d7 # EXP-Topic tests-fix-check-code-errors tests: define class in modern style to avoid check-code.py error This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. diff --git a/tests/test-hook.t b/tests/test-hook.t --- a/tests/test-hook.t +++ b/tests/test-hook.t @@ -855,7 +855,7 @@ preoutgoing hook can prevent outgoing ch > def printtags(ui, repo, **args): > ui.write(b'[%s]\n' % b', '.join(sorted(repo.tags( > - > class container: + > class container(object): > unreachable = 1 > EOF ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5978: subrepo: use root-repo-relative path from `hg files` with ui.relative-paths=no
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The fix is to pass in a "subuipathfn" as we do everywhere else. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5978 AFFECTED FILES mercurial/cmdutil.py mercurial/commands.py mercurial/subrepo.py tests/test-subrepo.t CHANGE DETAILS diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -36,7 +36,7 @@ $ hg files -S --config ui.relative-paths=no .hgsub a - a + s/a $ hg -R s ci -Ams0 $ hg sum diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -325,7 +325,7 @@ """Resolve the fileset expression for this repo""" return matchmod.never(badfn=badfn) -def printfiles(self, ui, m, fm, fmt, subrepos): +def printfiles(self, ui, m, uipathfn, fm, fmt, subrepos): """handle the files command for this subrepo""" return 1 @@ -795,15 +795,15 @@ return ctx.flags(name) @annotatesubrepoerror -def printfiles(self, ui, m, fm, fmt, subrepos): +def printfiles(self, ui, m, uipathfn, fm, fmt, subrepos): # If the parent context is a workingctx, use the workingctx here for # consistency. if self._ctx.rev() is None: ctx = self._repo[None] else: rev = self._state[1] ctx = self._repo[rev] -return cmdutil.files(ui, ctx, m, fm, fmt, subrepos) +return cmdutil.files(ui, ctx, m, uipathfn, fm, fmt, subrepos) @annotatesubrepoerror def matchfileset(self, expr, badfn=None): diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2213,8 +2213,10 @@ m = scmutil.match(ctx, pats, opts) ui.pager('files') +uipathfn = scmutil.getuipathfn(ctx.repo(), legacyrelativevalue=True) with ui.formatter('files', opts) as fm: -return cmdutil.files(ui, ctx, m, fm, fmt, opts.get('subrepos')) +return cmdutil.files(ui, ctx, m, uipathfn, fm, fmt, + opts.get('subrepos')) @command( 'forget', diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2171,11 +2171,10 @@ forgot.extend(f for f in forget if f not in rejected) return bad, forgot -def files(ui, ctx, m, fm, fmt, subrepos): +def files(ui, ctx, m, uipathfn, fm, fmt, subrepos): ret = 1 needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint() -uipathfn = scmutil.getuipathfn(ctx.repo(), legacyrelativevalue=True) for f in ctx.matches(m): fm.startitem() fm.context(ctx=ctx) @@ -2188,11 +2187,13 @@ for subpath in sorted(ctx.substate): submatch = matchmod.subdirmatcher(subpath, m) +subuipathfn = scmutil.subdiruipathfn(subpath, uipathfn) if (subrepos or m.exact(subpath) or any(submatch.files())): sub = ctx.sub(subpath) try: recurse = m.exact(subpath) or subrepos -if sub.printfiles(ui, submatch, fm, fmt, recurse) == 0: +if sub.printfiles(ui, submatch, subuipathfn, fm, fmt, + recurse) == 0: ret = 0 except error.LookupError: ui.status(_("skipping missing subrepository: %s\n") To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5977: subrepo: demonstrate broken `hg files` with ui.relative-paths=no
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/D5977 AFFECTED FILES tests/test-subrepo.t CHANGE DETAILS diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -31,6 +31,13 @@ a s/a +`hg files` respects ui.relative-paths +BROKEN: shows subrepo paths relative to the subrepo + $ hg files -S --config ui.relative-paths=no + .hgsub + a + a + $ hg -R s ci -Ams0 $ hg sum parent: 0:f7b1eb17ad24 tip To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 6080] New: Unclear warning message when pushing a closed branch
https://bz.mercurial-scm.org/show_bug.cgi?id=6080 Bug ID: 6080 Summary: Unclear warning message when pushing a closed branch Product: Mercurial Version: unspecified Hardware: PC OS: Linux Status: UNCONFIRMED Severity: feature Priority: wish Component: Mercurial Assignee: bugzi...@mercurial-scm.org Reporter: pierre.aug...@univ-grenoble-alpes.fr CC: mercurial-devel@mercurial-scm.org A developer of a project using Mercurial was confused by a warning that he did not understood. He was trying to push on his own repository after a pull from the main repository of the project and he got: ``` hg push ../tmp_repo pushing to ../tmp_repo searching for changes abort: push creates new remote branches: dev! (use 'hg push --new-branch' to create new remote branches) ``` The branch dev was closed and he didn't know that this branch exists since he pulled the branch already closed from the main repository. So he obtained something like: ``` hg branches default3:2c8ac9499cf1 ``` and `hg heads` also showed one head. Wouldn't be good to provide a better message in this case? At least to mention that the branch is closed with something like "abort: push creates new remote branches: dev (closed)!" -- 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
D5959: templates: adding a config() function for template customization
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6704696141b8: templates: adding a config() function for template customization (authored by rdamazio, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5959?vs=14083=14133 REVISION DETAIL https://phab.mercurial-scm.org/D5959 AFFECTED FILES mercurial/configitems.py mercurial/templatefuncs.py tests/test-template-functions.t CHANGE DETAILS diff --git a/tests/test-template-functions.t b/tests/test-template-functions.t --- a/tests/test-template-functions.t +++ b/tests/test-template-functions.t @@ -1549,4 +1549,31 @@ $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n" \xc3\xa9- (esc) +read config options: + + $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n" + foo + $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n" \ + > --config templateconfig.knob=bar + bar + $ hg log -T "{configbool('templateconfig', 'knob', True)}\n" + True + $ hg log -T "{configbool('templateconfig', 'knob', True)}\n" \ + > --config templateconfig.knob=0 + False + $ hg log -T "{configint('templateconfig', 'knob', 123)}\n" + 123 + $ hg log -T "{configint('templateconfig', 'knob', 123)}\n" \ + > --config templateconfig.knob=456 + 456 + $ hg log -T "{config('templateconfig', 'knob')}\n" + devel-warn: config item requires an explicit default value: 'templateconfig.knob' at: * (glob) + + $ hg log -T "{configbool('ui', 'interactive')}\n" + False + $ hg log -T "{configbool('ui', 'interactive')}\n" --config ui.interactive=1 + True + $ hg log -T "{config('templateconfig', 'knob', if(true, 'foo', 'bar'))}\n" + foo + $ cd .. diff --git a/mercurial/templatefuncs.py b/mercurial/templatefuncs.py --- a/mercurial/templatefuncs.py +++ b/mercurial/templatefuncs.py @@ -295,6 +295,39 @@ hint = _("get() expects a dict as first argument") raise error.ParseError(bytes(err), hint=hint) +@templatefunc('config(section, name[, default])', requires={'ui'}) +def config(context, mapping, args): +"""Returns the requested hgrc config option as a string.""" +fn = context.resource(mapping, 'ui').config +return _config(context, mapping, args, fn, evalstring) + +@templatefunc('configbool(section, name[, default])', requires={'ui'}) +def configbool(context, mapping, args): +"""Returns the requested hgrc config option as a boolean.""" +fn = context.resource(mapping, 'ui').configbool +return _config(context, mapping, args, fn, evalboolean) + +@templatefunc('configint(section, name[, default])', requires={'ui'}) +def configint(context, mapping, args): +"""Returns the requested hgrc config option as an integer.""" +fn = context.resource(mapping, 'ui').configint +return _config(context, mapping, args, fn, evalinteger) + +def _config(context, mapping, args, configfn, defaultfn): +if not (2 <= len(args) <= 3): +raise error.ParseError(_("config expects two or three arguments")) + +# The config option can come from any section, though we specifically +# reserve the [templateconfig] section for dynamically defining options +# for this function without also requiring an extension. +section = evalstringliteral(context, mapping, args[0]) +name = evalstringliteral(context, mapping, args[1]) +if len(args) == 3: +default = defaultfn(context, mapping, args[2]) +return configfn(section, name, default) +else: +return configfn(section, name) + @templatefunc('if(expr, then[, else])') def if_(context, mapping, args): """Conditionally execute based on the result of diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1081,6 +1081,10 @@ default=None, generic=True, ) +coreconfigitem('templateconfig', '.*', +default=dynamicdefault, +generic=True, +) coreconfigitem('trusted', 'groups', default=list, ) To: rdamazio, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 6079] New: histedit uses curses by default (against doc)
https://bz.mercurial-scm.org/show_bug.cgi?id=6079 Bug ID: 6079 Summary: histedit uses curses by default (against doc) Product: Mercurial Version: 4.9 Hardware: PC OS: Windows Status: UNCONFIRMED Severity: feature Priority: wish Component: histedit Assignee: bugzi...@mercurial-scm.org Reporter: from...@squelart.com CC: mercurial-devel@mercurial-scm.org After encountering the issue reported in bug 6078, I installed windows-curses, and then saw that indeed histedit now wants to use curses. I personally preferred the old way, using the editor I'd chosen in $EDITOR. But I guess it's a good way to make people notice! :-) Now, reading the release notes: "'hg histedit' will now present a curses UI if curses is available and 'ui.interface' or 'ui.interface.histedit' is set to 'curses'." I had not set any of these, but was still presented with curses. Setting 'ui.interface.histedit' to "text" (which `hg help config` says should be the default) reverted to using my preferred $EDITOR, but that was not obvious to find out! So I think the default should stay "text" as before. Otherwise the documentation should be updated to reflect the new default, and more helpfully describe how to change it back. -- 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