Gregory Szorc <gregory.szorc@gmail.com> [Tue, 12 Feb 2019 14:29:56 -0800] rev 41709
py3: port tinyproxy.py to work with Python 3
There were various str/bytes mismatches in the code. This caused
the proxy server to misbehave at run-time. The manifestation
was typically premature socket disconnect from the perspective
of the client.
Differential Revision: https://phab.mercurial-scm.org/D5951
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 12 Feb 2019 12:13:56 -0800] rev 41708
url: always access req._tunnel_host
The getattr() was there to handle Python versions before 2.6, which
lacked this attribute.
We /might/ be able to further delete some code here. However, the
behavior here is extremely hard to follow because large parts of
this code duplicate code from the Python standard library and it
is difficult to understand what is actually needed.
Differential Revision: https://phab.mercurial-scm.org/D5950
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 15 Feb 2019 13:07:07 -0800] rev 41707
tests: double escape \ in test-import-eol.t and test-mq-eol.t
The shell eats the \\.
Differential Revision: https://phab.mercurial-scm.org/D5974
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 15 Feb 2019 13:05:01 -0800] rev 41706
tests: use raw string in test-impexp-branch.t
On first glance, the escaping of \s seems correct. However,
the shell eats the escape and we're left with '\s` in the
written file. Let's use a raw string so we don't have to
double escape.
Differential Revision: https://phab.mercurial-scm.org/D5973
Julien Cristau <jcristau@mozilla.com> [Mon, 11 Feb 2019 16:27:20 +0100] rev 41705
phabricator: make user searches case-insensitive
User names in conduit are case insensitive, but when looking for "FOO"
it would return "foo" instead and we'd think the user didn't exist. So
lower case both the query and the response when comparing them.
Differential Revision: https://phab.mercurial-scm.org/D5934
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 15 Feb 2019 11:31:17 -0800] rev 41704
exchange: raise error.Abort instead of ValueError
Raising ValueError results in an uncaught exception and a traceback
being printed. In the context of servers, it can result in an HTTP
500 and an exception being logged in the error log.
I don't think this is proper behavior.
The bundle2 code paths have a mechanism for translating an
error.Abort into an error message reported to the clients. I
think we should use that instead.
This commit replaces some ValueError with Abort so that
servers can error more gracefully.
Differential Revision: https://phab.mercurial-scm.org/D5972
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 15 Feb 2019 11:42:54 -0800] rev 41703
tests: remove -q from test-lfs-serve.t
This will make it easier to observe a behavior change in the
next commit.
Differential Revision: https://phab.mercurial-scm.org/D5971
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 13 Feb 2019 16:58:24 -0500] rev 41702
chistedit: use magenta for current line as in crecord (
issue6071)
It was inconsistent in the UI to have different way to show the
current line.
Akshit Jain <Akshjain.jain74@gmail.com> [Thu, 14 Feb 2019 20:57:26 +0530] rev 41701
chistedit: improve proper username in histedit curses interface
in changeset section (
issue6072)
Differential Revision: https://phab.mercurial-scm.org/D5967
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Thu, 14 Feb 2019 10:41:47 -0500] rev 41700
crecord: remove obsolete version check
An internal function shouldn't be checking compatibility with
Mercurial versions.
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Wed, 13 Feb 2019 16:02:44 -0500] rev 41699
histedit: remove "chistedit" mention from interface
"chisted" is internal jargon. The end user should not need to be aware
that it's different from histedit.
Navaneeth Suresh <navaneeths1998@gmail.com> [Wed, 13 Feb 2019 18:17:42 +0530] rev 41698
revset: improve documentation on expectsize()
This is a follow-up patch to D5813. It improves the documentation of
`expectsize(set, size)`.
Differential Revision: https://phab.mercurial-scm.org/D5953
Martin von Zweigbergk <martinvonz@google.com> [Wed, 13 Feb 2019 12:09:36 -0800] rev 41697
scmutil: fix a comment that doesn't match the code
Differential Revision: https://phab.mercurial-scm.org/D5956
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 14 Feb 2019 13:16:36 -0800] rev 41696
remotefilelog: remove strkwargs()
The previous commit activated previously unused code paths on
Python 3 and revealed that we were calling strkwargs() on a dict
that already had str keys. The only caller of _forceprefetch()
is _adjustlinknode() a few lines up and the static commonlogkwargs
dict features str keys.
Differential Revision: https://phab.mercurial-scm.org/D5958
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 13 Feb 2019 16:31:20 -0800] rev 41695
remotefilelog: use raw strings when looking for variable names
Keys in self.__dict__ and vars() are always str. So we need to use
raw strings to ensure lookups work on Python 3.
# skip-blame just r'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5957
Georges Racinet <georges.racinet@octobus.net> [Thu, 10 Jan 2019 18:25:18 +0100] rev 41694
rust-cpython: binding for headrevs()
This uses the core `dagops::retain_heads` to give a Rust implementation
to `mercurial.dagop.headrevs`.
Testing happens for now from `test-rust-ancestors.py`
(for quick and minimal change), but it'd made more sense to put the binary
index data elsewhere and to create a new test python module
Georges Racinet <georges.racinet@octobus.net> [Wed, 16 Jan 2019 16:05:27 +0100] rev 41693
rust-cpython: moved py_set() utility to conversion module
We're still hoping to get rid of it eventually, but we're going
to need it from outside the `ancestors` module before that.
Georges Racinet <gracinet@anybox.fr> [Sun, 02 Dec 2018 16:19:22 +0100] rev 41692
rust: translated random test of missingancestors
This is a Rust implementation of the random
DAG generator and related incrementalmissingancestors
tests against a naive brute force implementation.
It is provided as an integration test, so that it
won't run by default if any unit test fails.
In case of a failed example, all needed information
for reproduction is included in the panic message,
(this is how
`test_remove_ancestors_from_case1()` has been generated),
as well as the random seed.
The whole test is rerunnable by passing the random seed
in the TEST_RANDOM_SEED environment variable.
The other parameters (numbers of iterations) can be passed
in the TEST_MISSING_ANCESTORS environment variable.
An alternative would have been to expose to Python
MissingAncestors<VecGraphs> but that would have meant
pollution of the release build used from Python,
whereas we do it in this changeset within the tests submodule
Differential Revision: https://phab.mercurial-scm.org/D5417
Martin von Zweigbergk <martinvonz@google.com> [Tue, 12 Feb 2019 13:46:38 -0800] rev 41691
debugpathcopies: fix typo in synopsis
Differential Revision: https://phab.mercurial-scm.org/D5949
Martin von Zweigbergk <martinvonz@google.com> [Tue, 12 Feb 2019 13:42:42 -0800] rev 41690
debugrename: don't require at least one path
I don't see a reason that it needs to require a path. Most commands
match everything when no paths are given, but here you have to do
something like `hg debugrename -r . .` (from the repo root) to match
everything.
Differential Revision: https://phab.mercurial-scm.org/D5948
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 12 Feb 2019 11:27:27 -0800] rev 41689
revlog: use iterbytestr()
Otherwise we iterate over integers in Python 3 and the
character compare fails.
Differential Revision: https://phab.mercurial-scm.org/D5947
Martin von Zweigbergk <martinvonz@google.com> [Sun, 10 Feb 2019 22:41:51 -0800] rev 41688
commit: respect ui.relative-paths
The command usually doesn't print any paths, but there are some
warnings and verbose messages that includes paths.
Differential Revision: https://phab.mercurial-scm.org/D5939
Martin von Zweigbergk <martinvonz@google.com> [Sun, 10 Feb 2019 22:21:45 -0800] rev 41687
resolve: slightly simplify join expression by joining with empty strings
Differential Revision: https://phab.mercurial-scm.org/D5938
Martin von Zweigbergk <martinvonz@google.com> [Sun, 10 Feb 2019 22:18:19 -0800] rev 41686
resolve: respect ui.relative-paths also for warning messages
I guess this should have been part of
72a9aacff645 (resolve: respect
ui.relative-paths, 2019-01-29).
Differential Revision: https://phab.mercurial-scm.org/D5937
Martin von Zweigbergk <martinvonz@google.com> [Mon, 11 Feb 2019 09:40:24 -0800] rev 41685
addremove: respect ui.relative-paths
I previously changed these code paths while trying to not change any
behavior to avoid inconsistencies between them in the intermediate
commits. They're now all ready to be switched over to respecting
ui.relative-paths.
Differential Revision: https://phab.mercurial-scm.org/D5936
Martin von Zweigbergk <martinvonz@google.com> [Mon, 11 Feb 2019 09:12:23 -0800] rev 41684
windows: use util.localpath for repo-relative paths in getuipathfn()
Now that we have a single place that translates from internal path
representation (slash-separated) to UI representation
(i.e. scmutil.getuipathfn()), let's switch that over to using
util.localpath for absolute paths. I don't expect any test impact on
Windows because we still respect ui.slash, which is set by the test
runner.
As Yuya pointed out,
a997163e7fae (status: extract helper for
producing relative or absolute path for UI, 2019-01-29) accidentally
changed to slash-separated paths on Windows because it used used to
use repo.pathto(f, cwd='') (which calls util.localpath()) and after
that patch it just prints the filename without any
transformation. This patch should fix that regression.
Differential Revision: https://phab.mercurial-scm.org/D5935
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Tue, 12 Feb 2019 17:10:31 -0500] rev 41683
walkchangerevs: obey allfiles parameter when taking the slow path
When walkchangerevs sees that there's a pattern, it hits the slow
path. The slow path in turn reverts to the old dumb grep behaviour of
only looking at files changed at each revision. Therefore, a command
such as
hg grep -l --all-files '.*' 'glob:**'
would show you all the nonempty files touched by the current revision.
This modifies that behaviour to look at the manifest at each revision
instead of the changed files in case that --all-files was requested.
Boris Feld <boris.feld@octobus.net> [Fri, 08 Feb 2019 18:26:35 +0100] rev 41682
test: stabilize test-wireproto-exchangev2.t flaky output
When running the test suite with multiple processes, we often get flaky
outputs, like here: https://ci.octobus.net/job/MercurialPy2/267/console
```
- received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
add changeset
cd2534766bec
add changeset
e96ae20f4188
add changeset
caa2a465451d
+ received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
```
Instead of simply sorting the clone and pull output, I saved the output in a
separate file and checked the `received frame` messages on one side and then
the rest of the output on the other side. This way we conserve the order of
messages as it seems important.
Differential Revision: https://phab.mercurial-scm.org/D5897
Kyle Lippincott <spectral@google.com> [Mon, 04 Feb 2019 14:29:03 -0800] rev 41681
zsh: fix `hg resolve` completion when in a subdirectory (
issue6067)
Differential Revision: https://phab.mercurial-scm.org/D5836
Navaneeth Suresh <navaneeths1998@gmail.com> [Sun, 03 Feb 2019 19:10:39 +0530] rev 41680
revset: add expectsize to check the size of a set
`expectsize(<set>, <int>)` revset fails if `<set>` is not exactly `<int>`
elements. `expectsize(<set>, <min>:<max>)` revset fails if `<set>` is not
exactly between `<min>` and `<max>` inclusive.
This then allows an alias for `hg next` to be `update -r one(children(.))`
with sane failure behavior, and also makes some other scripting tasks
a little less difficult.
(Summary from WeShouldDoThat)
Differential Revision: https://phab.mercurial-scm.org/D5813
Augie Fackler <augie@google.com> [Mon, 11 Feb 2019 11:18:37 -0500] rev 41679
merge with stable
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 11 Feb 2019 15:41:08 +0300] rev 41678
branchmap: decode a label only once
This moves decoding of a label out of for loop. Minor speed up expected in cases
when one branch has multiple heads. For example: someone using bookmarks as
branches and hence ending up with multiple heads on default branch.
Differential Revision: https://phab.mercurial-scm.org/D5932
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 11 Feb 2019 15:34:35 +0300] rev 41677
branchmap: move __init__ up in branchcache class
Making __init__ the first function defined helps understanding the class much
better.
Differential Revision: https://phab.mercurial-scm.org/D5931
Martin von Zweigbergk <martinvonz@google.com> [Sat, 09 Feb 2019 22:50:53 -0800] rev 41676
match: delete unused root and cwd arguments from {always,never,exact}() (API)
Differential Revision: https://phab.mercurial-scm.org/D5930
Martin von Zweigbergk <martinvonz@google.com> [Sun, 10 Feb 2019 14:35:36 -0800] rev 41675
match: delete unused root and cwd arguments to constructors (API)
Most matchers no longer need the root and cwd
arguments. patternmatcher and includematcher still need the root
argument for subincludes.
Differential Revision: https://phab.mercurial-scm.org/D5929
Martin von Zweigbergk <martinvonz@google.com> [Sun, 10 Feb 2019 21:33:21 -0800] rev 41674
dirstate: call and cache os.getcwd() in constructor
I'm about to make scmutil.matchfiles() not pass the root and cwd paths
to match.exact(), since they no longer have any effect. That turned
out to have the surprising effect of making some tests
(test-rebase-scenario-global.t and test-removeemptydirs.t) crash when
the working directory was removed. The problem was that my patch
removed the call to repo.getcwd(), which caused the current working
directory to not be cached in the dirstate as early as it was
before. This patch fixes that by caching the current working directory
in the dirstate constructor.
Differential Revision: https://phab.mercurial-scm.org/D5928
Martin von Zweigbergk <martinvonz@google.com> [Sun, 10 Feb 2019 14:16:37 -0800] rev 41673
cleanup: prefer matchmod.{always,never}() over accessing matchers directly
We have these factory methods so we should use them.
Differential Revision: https://phab.mercurial-scm.org/D5927
Martin von Zweigbergk <martinvonz@google.com> [Sun, 10 Feb 2019 14:16:33 -0800] rev 41672
match: allow passing in badfn to always() and never()
So that no callers are required to access the matchers themselves.
Differential Revision: https://phab.mercurial-scm.org/D5926
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 10 Feb 2019 14:04:08 -0800] rev 41671
py3: use raw strings and %d for formatting
Before the string compares on Python 3 failed because we were
comparing bytes to str. Using raw strings ensures we are
always comparing str.
While we're here, also use %d to format integers.
Differential Revision: https://phab.mercurial-scm.org/D5925
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Jan 2019 15:35:51 -0800] rev 41670
diff: make --stat respect ui.relative-paths
It would have been easy to make all diffs respect ui.relative-paths,
but we don't want that since it makes the diff invalid. Perhaps it
makes sense to do that with --noprefix since the point of that is to
make paths that are easy to copy&paste, and the diff is already
invalid anyway. But this patch just makes the --stat version respect
the config option. The --stat view is not even close to a valid diff,
so I think it makes sense to show the paths in more human-friendly
form.
Differential Revision: https://phab.mercurial-scm.org/D5896
Martin von Zweigbergk <martinvonz@google.com> [Sat, 09 Feb 2019 23:48:19 -0800] rev 41669
match: delete unused argument "listsubrepos" from _buildmatch()
Seems to have been unused since
9f9ffe5f687c (match: compose 'set:'
pattern as matcher, 2018-06-10).
Differential Revision: https://phab.mercurial-scm.org/D5924
Martin von Zweigbergk <martinvonz@google.com> [Sat, 09 Feb 2019 16:46:11 -0800] rev 41668
match: delete unused rel() (API)
Differential Revision: https://phab.mercurial-scm.org/D5923
Martin von Zweigbergk <martinvonz@google.com> [Sat, 09 Feb 2019 16:43:20 -0800] rev 41667
largefiles: get cwd and relative paths from repo instead of matcher
As far as I can tell, the matcher returned from matchandpats() got its
cwd from the context object, which in turn got it from the repo, so
this should be equivalent.
Differential Revision: https://phab.mercurial-scm.org/D5922
Martin von Zweigbergk <martinvonz@google.com> [Sat, 09 Feb 2019 14:37:58 -0800] rev 41666
scmutil: remove special handling of pats==("",) in matchandpats() (API)
I don't know under what circumstances we used to pass that value, but
we don't seem to do it now.
Differential Revision: https://phab.mercurial-scm.org/D5921
Martin von Zweigbergk <martinvonz@google.com> [Fri, 08 Feb 2019 13:33:40 -0800] rev 41665
scmutil: respect ui.relative-paths in default match.badfn
We should probably be passing in a uipathfn here instead, so the
caller can get consistent output (between match.badfn and whatever
else it prints). I think we should ideally remove the badfn from the
matcher completely, but that's a different story. This patch is at
least not making it worse.
Differential Revision: https://phab.mercurial-scm.org/D5916
Martin von Zweigbergk <martinvonz@google.com> [Fri, 08 Feb 2019 13:00:28 -0800] rev 41664
cmdutil: migrate previously missed instances to uipathfn
I seem to have missed these two instances in
15f63ac122ea (files:
respect ui.relative-paths, 2019-01-29) and
7068c6b0114b (revert:
respect ui.relative-paths, 2019-02-05).
Differential Revision: https://phab.mercurial-scm.org/D5915
Martin von Zweigbergk <martinvonz@google.com> [Fri, 08 Feb 2019 13:54:20 -0800] rev 41663
cat: respect ui.relative-paths for "skipping missing subrepository"
Differential Revision: https://phab.mercurial-scm.org/D5914
Martin von Zweigbergk <martinvonz@google.com> [Fri, 08 Feb 2019 13:51:29 -0800] rev 41662
addremove: use uipathfn instead of m.rel() for recorded similatity message
When no path arguments are given to addremove, it generally prints
absolute paths. However, before this patch, we would always print the
"recording removal of foo as rename to bar (78% similar)" message with
relative paths.
Differential Revision: https://phab.mercurial-scm.org/D5913