Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:34:50 -0800] rev 35053
bundlerepo: assign bundle attributes in bundle type blocks
It is a bit wonky to assign the same object to multiple
attributes and then possibly overwrite them later.
Refactor the code to use a local variable and defer attribute
assignment until the final values are ready.
This required passing the bundle instance to _handlebundle2part().
The only use of this method I could find is Facebook's
treemanifest extension. Since it is a private method, I don't
think it warrants an API callout.
Differential Revision: https://phab.mercurial-scm.org/D1378
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:22:36 -0800] rev 35052
bundlerepo: make bundle and bundlefile attributes private
These attributes are implementation details and shouldn't be
exposed outside the class.
.. api::
bundlerepo.bundlerepository.bundle and
bundlerepo.bundlerepository.bundlefile are now prefixed with an
underscore.
Differential Revision: https://phab.mercurial-scm.org/D1377
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:14:41 -0800] rev 35051
bundlerepo: don't assume there are only two bundle classes
exchange.readbundle() can return a type that represents a stream
clone bundle. Explicitly handle the bundle1 type and raise a
reasonable error message for unhandled bundle types.
Differential Revision: https://phab.mercurial-scm.org/D1376
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:09:16 -0800] rev 35050
bundlerepo: add docstring for bundlerepository class
Differential Revision: https://phab.mercurial-scm.org/D1375
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:05:02 -0800] rev 35049
bundlerepo: rename arguments to bundlerepository.__init__
To reflect what they actually are.
Differential Revision: https://phab.mercurial-scm.org/D1374
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 17:07:33 -0800] rev 35048
bundlerepo: use suffix variable
It looks like the refactor in
702a26fec3e2 attempted to establish
this method argument but failed to use it. My editor caught it.
Differential Revision: https://phab.mercurial-scm.org/D1373
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 17:02:31 -0800] rev 35047
bundlerepo: make methods agree with base class
My editor was complaining about mismatches between method
signatures.
For methods that are implemented, we change arguments to match
the base. For those that aren't, we use variable arguments
because it shouldn't matter.
Differential Revision: https://phab.mercurial-scm.org/D1372
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 16:48:40 -0800] rev 35046
bundle2: use os.SEEK_* constants
Constants make code easier to read than magic numbers.
I also threw in an explicit argument in a caller to further
increase code comprehension.
Differential Revision: https://phab.mercurial-scm.org/D1370
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 30 Oct 2017 20:35:30 -0700] rev 35045
help: adding a topic on flags
This is a short topic to explain how command-line flags can be specified.
Some users have been confused by hg offerring different flag syntax than some
other libraries, so it'd be nice to point them to this rather than explaining
it every time.
Differential Revision: https://phab.mercurial-scm.org/D1270
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 06 Oct 2017 05:47:56 +0530] rev 35044
py3: handle keyword arguments correctly in hgext/patchbomb.py
The keys of keyword arguments must be str on Python 3 which is unicode. This
patch make sure we pass keyword arguments with keys are str everywhere in this
file and access the keys depending on whether they are bytes or str.
This patch uses pycompat.{byteskwargs|strkwargs} and somewhere it also added r''
to prevent transformer from adding a b'' over there.
Differential Revision: https://phab.mercurial-scm.org/D974
Anton Shestakov <av6@dwimlabs.net> [Sat, 11 Nov 2017 15:07:21 +0800] rev 35043
tests: use jshint when available to check .js files
Anton Shestakov <av6@dwimlabs.net> [Sat, 11 Nov 2017 14:14:38 +0800] rev 35042
hgweb: fix jshint issues in mercurial.js
Everything is pretty self-explanatory except the last hunk, where jshint
complains: "Misleading line break before '||'; readers may interpret this as an
expression boundary."
There is a tweakable called "laxbreak" that allows line breaks before
operators, but I think it's fine to simply join this one line and avoid extra
config for now (we can cook up and add a sensible .jshintrc later).
Boris Feld <boris.feld@octobus.net> [Tue, 17 Oct 2017 15:55:40 +0200] rev 35041
exchange: drop unused '_getbookmarks' function
The function was introduced in
8491845a75b2 in mid-November 2016 but is never
used anywhere in core.
Boris Feld <boris.feld@octobus.net> [Sun, 15 Oct 2017 15:21:47 +0200] rev 35040
bookmark: use bundle2 debug output in one push tests
Having more details about the push process will help to track changes made to
the actual exchange.
Boris Feld <boris.feld@octobus.net> [Tue, 17 Oct 2017 11:01:45 +0200] rev 35039
pull: store binary node in pullop.remotebookmarks
The internal representation of bookmark value is binary. The fact we stored
'hex' was an implementation detail from using pushkey.
We move the values in 'pullop.remotebookmarks' to binary before adding a way to
exchange bookmarks not based on pushkey.
David Demelier <markand@malikania.fr> [Thu, 19 Oct 2017 11:46:41 +0200] rev 35038
config: rename allow_push to allow-push
As part of ConfigConsolidationPlan [1], rename the option according to
the new UI guidelines [2] and add an alias for backward compatibility.
[1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan
[2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options
David Demelier <markand@malikania.fr> [Thu, 19 Oct 2017 11:43:19 +0200] rev 35037
config: rename allowpull to allow-pull
As part of ConfigConsolidationPlan [1], rename the option according to
the new UI guidelines [2] and add an alias for backward compatibility.
[1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan
[2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options
Matt Harbison <matt_harbison@yahoo.com> [Tue, 28 Nov 2017 23:20:08 -0500] rev 35036
convert: avoid wrong lfconvert defaults by moving configitems to core
The `hg lfconvert --to-normal` command uses the convert extension internally to
work its magic, but that produced devel-warn messages if the convert extension
wasn't loaded by the user. The test in
fcd2f9b06629 (modified here) wasn't
showing the warnings because the convert extension was loaded via $HGRCPATH.
Most of the config options default to None/False, but 'hg.usebranchnames' and
'hg.tagsbranch' are supposed to default to True and 'default' respectively.
The first iteration of this was to ui.setconfig() inside lfconvert, to force the
convert extension to load. But there really is no precedent for doing this, and
check-config complained that 'extensions.convert' isn't documented. Yuya
suggested this alternative.
This partially backs out
0d5a1175d0f9.
Boris Feld <boris.feld@octobus.net> [Fri, 24 Nov 2017 21:51:41 -0500] rev 35035
tr-summary: keep a weakref to the unfiltered repository
Repoview can have a different life cycle, causing issue in some corner
cases. The particular instance that revealed this comes from localpeer. The
localpeer hold a reference to the unfiltered repository, but calling 'local()'
will create an on-demand 'visible' repoview. That repoview can be garbaged
collected any time. Here is a simplified step by step reproduction::
1) tr = peer.local().transaction('foo')
2) tr.close()
After (1), the repoview object is garbage collected, so weakref used in (2)
point to nothing.
Thanks to Sean Farley for helping raising and debugging this issue.
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Nov 2017 12:40:13 +0900] rev 35034
dispatch: verify result of early command parsing
Before, early options were stripped from args, and because of this, some
kind of parsing errors weren't reported. For example,
$ hg ci -m -Ra file
would execute "hg ci -m file" in repository "a".
This patch fixes the issue by parsing early options again by real getopt-based
parser, and verifying the results. If the early parsing appears wrong, hg just
aborts. The current error message seems not nice, and should be improved, maybe
in V2 or follow-up.
Note that this isn't a security feature because we can still do anything by
using shell aliases.
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Nov 2017 17:55:15 +0900] rev 35033
dispatch: convert non-list option parsed by _earlygetopt() to string
So we can easily compare it with the corresponding getopt() result.
There's a minor behavior change. Before, "hg --cwd ''" failed with ENOENT.
But with this patch, an empty cwd is silently ignored. "hg -R ''" has always
worked as such, so -R has no BC.
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Nov 2017 16:46:41 +0900] rev 35032
dispatch: add option to not strip command args parsed by _earlygetopt()
This allows us to parse the original args later by full-blown getopt() in
order to verify the result of the faulty early parsing. Still we need the
'strip=True' behavior for shell aliases.
Note that this series is RFC because it seems to change too much to be
included in stable release.
Yuya Nishihara <yuya@tcha.org> [Tue, 14 Nov 2017 00:25:59 +0900] rev 35031
dispatch: fix early parsing of short option with value like -R=foo
Before, -R=foo was parsed as '-R' 'foo', which disagrees with the standard
getopt behavior.
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Nov 2017 14:02:41 +0900] rev 35030
dispatch: abort if early boolean options can't be parsed
Perhaps we'll need to restrict the parsing rules of --debugger and --profile,
where this patch will help us know why the --debugger option doesn't work.
I have another series to extend this feature to --config/--cwd/-R, but even
with that, shell aliases can be used to get around the restriction.
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Nov 2017 22:27:26 +0900] rev 35029
dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Nov 2017 22:22:39 +0900] rev 35028
dispatch: extract stub function to peek boolean command option
We should at least stop parsing at "--". The 'name' argument is passed for
future extension.
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Nov 2017 12:09:19 +0900] rev 35027
dispatch: do not drop unpaired argument at _earlygetopt()
Before, "hg log -R" just worked.
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Nov 2017 20:07:40 +0900] rev 35026
amend: update .hgsubstate before committing a memctx (
issue5677)
This is a minimal copy of localrepo.commit(). As the current amend() function
heavily depends on the wctx API, it wasn't easy to port it to use a separate
status tuple. So for now, wctx._status is updated in-place.
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Nov 2017 19:21:39 +0900] rev 35025
subrepo: extract preprocess of repo.commit() to free function
No code change other than extracting a function. Maybe we should stop mutating
the status argument, but that's out of the scope of stable changes.
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Nov 2017 18:54:57 +0900] rev 35024
tests: demonstrate that .hgsubstate isn't updated on amend
Loosely based on test-amend.t and test-subrepo.t
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Nov 2017 23:48:19 +0900] rev 35023
amend: do not drop missing files (
issue5732)
samefile() can be wrong since wctx.manifest() does not include missing files,
whereas missing files should be preserved on commit.
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Nov 2017 23:45:59 +0900] rev 35022
amend: do not take untracked files as modified or clean (
issue5732)
fctx.exists() shouldn't be used here as it checks if a file physically exists,
which may disagree with the dirstate.
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Nov 2017 23:40:26 +0900] rev 35021
tests: add more complete test for status changes on amend
This demonstrates that missing/untracked files are handled incorrectly. The
correct outputs are suppressed by (false !), and wrong outputs are added with
(true !) instead.
The setup code is copied from test-status-rev.t.
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Nov 2017 19:14:06 +0800] rev 35020
hgweb: add missing semicolons to followlines.js
Minor stylistic issues caught by jshint.
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Nov 2017 18:50:44 +0800] rev 35019
gitweb: apply styles from annotate tooltip to followlines popup
These new colors and styles are already used in the tooltip that gets shown
when user hovers over line numbers on annotate page. The old styles, replaced
in this patch, look completely unrelated to gitweb or any other hgweb theme.
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Nov 2017 18:45:43 +0800] rev 35018
paper: apply styles from annotate tooltip to followlines popup
These new colors and styles are already used in the tooltip that gets shown
when user hovers over line numbers on annotate page. The old styles, replaced
in this patch, look completely unrelated to paper or any other hgweb theme.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 10 Nov 2017 09:44:49 -0800] rev 35017
pull: clarify that -u only updates linearly
Differential Revision: https://phab.mercurial-scm.org/D1355
Mark Thomas <mbthomas@fb.com> [Wed, 08 Nov 2017 09:27:14 -0800] rev 35016
dirstate: don't remove normallookup files from nonnormalset
The dirstate typically tries to keep the nonnormalset and otherparentset
up-to-date when making changes to the dirstate. In the case of files marked
normallookup, however, it erroneously removes the file from the nonnormalset,
after _addpath had just added it.
This doesn't seem to matter at the moment, as nothing relies on the
nonnormalset being correct at this point, however a future re-implementations
of the dirstate map will require this to be kept up-to-date correctly.
Differential Revision: https://phab.mercurial-scm.org/D1339
Mark Thomas <mbthomas@fb.com> [Wed, 08 Nov 2017 09:23:53 -0800] rev 35015
dirstate: clear map cached properties when clearing the map
dirstatemap.clear should remove all record of the files in the map. This
includes removing caches of values derived from these.
Differential Revision: https://phab.mercurial-scm.org/D1338
Mark Thomas <mbthomas@fb.com> [Wed, 08 Nov 2017 09:18:18 -0800] rev 35014
util: add util.clearcachedproperty
This utility function allows clearing of the cached value set up
@propertycache, if there is one.
Differential Revision: https://phab.mercurial-scm.org/D1337
Augie Fackler <augie@google.com> [Fri, 10 Nov 2017 17:12:04 -0500] rev 35013
merge with stable
Kyle Lippincott <spectral@google.com> [Wed, 08 Nov 2017 18:24:43 -0800] rev 35012
changegroup: use any node, not min(), in treemanifest's generatemanifests
This is fixing quadratic behavior, which is probably not noticeable in the
common case, but if a very large directory gets added here, it can get pretty
bad. This was noticed because we had some pushes that spent >25s in changegroup
generation calling min() here, according to profiling.
The original reasoning for min() being used in
829d369fc5a8 was that, at that
point in the series, we were adding almost everything to tmfnodes during the
first iteration through the loop , so we needed to avoid sending child
directories before parents. Later changes made it so that the child directories
were added only when we visited the parent directory (not all of them on the
first iteration), so this is no longer necessary - there won't be any child
directories in tmfnodes before the parents have been sent.
This does mean that the manifests are now exchanged unordered, whereas
previously we would essentially do [a, b, b/c, b/c/d, e], we now can send a, b,
and e in any order; b/c must still follow b, and b/c/d must still follow b/c.
Differential Revision: https://phab.mercurial-scm.org/D1351
Durham Goode <durham@fb.com> [Tue, 07 Nov 2017 10:16:53 -0800] rev 35011
bundle: allow bundlerepo to support alternative manifest implementations
With our treemanifest logic, the manifests are no longer transported as part of
the changegroup and are no longer stored in a revlog. This means the
self.manifestlog line in bundlerepo.filestart no longer calls
_constructmanifest, and therefore does not consume the manifest portion of the
changegroup, which means filestart is not populated and we result in an infinite
loop.
The fix is to make filestart aware that self.manifestlog might not consume the
changegroup part, and consume it manually if necessary.
There's currently no way to test this in core, but our treemanifest extension
has tests to cover this.
Differential Revision: https://phab.mercurial-scm.org/D1329
Boris Feld <boris.feld@octobus.net> [Thu, 19 Oct 2017 12:35:47 +0200] rev 35010
obsfate: makes successorsetverb takes the markers as argument
Right now, successorsetverb only needs successors to compute the verb. But we
will want use additional information (effect-flags and operation) in the near
future to compute a better verb.
Add the markers parameter now so extensions (like Evolve) could wrap the
function and start experimenting around better obsfate verbs.
As successorsetverb now takes both successorset and markers parameters, rename
it to obsfateverb, successorsetandmarkersverb was too long.
Differential Revision: https://phab.mercurial-scm.org/D1191
Mark Thomas <mbthomas@fb.com> [Fri, 03 Nov 2017 09:27:36 -0700] rev 35009
scmutil: don't try to delete origbackup symlinks to directories (
issue5731)
When origbackuppath is set, when looking to see if a file we are backing up
conflicts with a directory in the origbackuppath, we incorrectly match on
symlinks to directories. This means we try to call vfs.rmtree on the
symlink, which fails.
Differential Revision: https://phab.mercurial-scm.org/D1311
Mark Thomas <mbthomas@fb.com> [Fri, 03 Nov 2017 09:27:35 -0700] rev 35008
tests: add a test demonstrating
issue5731
If origbackups are in use, a symlink to a valid directory is backed up, and an
update is made that attempts to backup a file or link over that symlink, we
abort with a bad error message instead of successfully updating.
Differential Revision: https://phab.mercurial-scm.org/D1310
Ryan McElroy <rmcelroy@fb.com> [Tue, 07 Nov 2017 13:48:33 -0800] rev 35007
cmdutil: create dirs for templated cat file output
Previously, the caller was responsible for creating the directory structure of
files written out using a path template. This is onerous, especially if the
exact filenames are not known upfront, but are being accessed via a matcher.
This patch changes things so that hg will attempt to create the appropriate
directories before writing the output file.
Differential Revision: https://phab.mercurial-scm.org/D1332
Ryan McElroy <rmcelroy@fb.com> [Tue, 07 Nov 2017 13:46:15 -0800] rev 35006
cat: test output path behvaior when target path does not exist
In the next patch, we will change the behavior of the cat command to create
output file parent directories before attempting to write the output file.
This patch documents the current unfortunate behavior.
Differential Revision: https://phab.mercurial-scm.org/D1331
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:06:49 +0530] rev 35005
py3: handle keyword arguments in hgext/shelve.py
Differential Revision: https://phab.mercurial-scm.org/D1324
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:06:23 +0530] rev 35004
py3: handle keyword arguments in hgext/uncommit.py
Differential Revision: https://phab.mercurial-scm.org/D1323
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:05:04 +0530] rev 35003
py3: handle keyword arguments in hgext/releasenotes.py
Differential Revision: https://phab.mercurial-scm.org/D1322
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:04:47 +0530] rev 35002
py3: handle keyword arguments in hgext/rebase.py
Differential Revision: https://phab.mercurial-scm.org/D1321
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:04:30 +0530] rev 35001
py3: handle keyword arguments in hgext/keyword.py
Differential Revision: https://phab.mercurial-scm.org/D1320
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:04:12 +0530] rev 35000
py3: handle keyword arguments in hgext/journal.py
Differential Revision: https://phab.mercurial-scm.org/D1319
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:03:54 +0530] rev 34999
py3: handle keyword arguments in hgext/histedit.py
Differential Revision: https://phab.mercurial-scm.org/D1318
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:03:27 +0530] rev 34998
py3: handle keyword arguments in hgext/hgk.py
Differential Revision: https://phab.mercurial-scm.org/D1317
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:03:08 +0530] rev 34997
py3: handle keyword arguments in hgext/graphlog.py
Differential Revision: https://phab.mercurial-scm.org/D1316
Augie Fackler <augie@google.com> [Tue, 07 Nov 2017 13:18:49 -0500] rev 34996
merge with stable
Augie Fackler <raf@durin42.com> [Tue, 07 Nov 2017 13:15:35 -0500] rev 34995
Added signature for changeset
cabc840ffdee
Augie Fackler <raf@durin42.com> [Tue, 07 Nov 2017 13:15:34 -0500] rev 34994
Added tag 4.4.1 for changeset
cabc840ffdee
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Oct 2017 17:46:41 +0900] rev 34993
templatekw: add verbosity keyword to select template by -q/-v/--debug flag
This can be used in conjunction with the ifeq() function.
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Oct 2017 17:31:13 +0900] rev 34992
templatekw: move loadkeyword() to bottom
loadkeyword() isn't a template keyword function.
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Oct 2017 17:05:04 +0900] rev 34991
help: hide phaseidx template keyword
I don't think it's great idea to expose the internal representation of phases.
Let's discourage use of the phaseidx keyword.
Augie Fackler <augie@google.com> [Tue, 07 Nov 2017 11:22:24 -0500] rev 34990
stable: merge with security patches
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 06 Nov 2017 22:32:41 -0800] rev 34989
subrepo: use per-type config options to enable subrepos
We change subrepos.allowed from a list of allowed subrepo types to
a combination of a master switch and per-type boolean flag.
If the master switch is set, subrepos can be disabled wholesale.
If subrepos are globally enabled, then per-type options are
consulted. Mercurial repos are enabled by default. Everything else
is disabled by default.
Augie Fackler <augie@google.com> [Mon, 06 Nov 2017 14:56:17 -0500] rev 34988
config: add some more documentation around why svn and git subrepos are off
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Nov 2017 21:51:42 +0900] rev 34987
subrepo: disable git and svn subrepos by default (BC) (SEC)
We have a security issue with git subrepos. I'm not sure if svn subrepo is
vulnerable, but it seems not 100% safe to allow writing arbitrary data into
a metadata directory. So for now, only hg subrepo is enabled by default.
Maybe we should improve the help to describe why git/svn subrepos are
disabled.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Nov 2017 21:48:58 +0900] rev 34986
subrepo: extend config option to disable subrepos by type (SEC)
This allows us to minimize the behavior change introduced by the next patch.
I have no idea which config style is preferred in UX POV, but I decided to
get things done.
a) list: 'allowed = hg, git, svn'
b) sub option: 'allowed.hg = True' or 'allowed:hg = True'
c) per-type action: 'hg = allow', 'git = abort'
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Nov 2017 21:22:07 +0900] rev 34985
subrepo: add config option to reject any subrepo operations (SEC)
This is an alternative workaround for the
issue5730.
Perhaps this is the simplest way of disabling subrepo operations. It does
nothing clever, but just aborts if Mercurial starts accessing to a subrepo.
I think Greg's patch is more useful since it allows us to at least check
out the parent repository. However, that would be confusing if the default
is flipped to checkout=False and subrepos are silently ignored.
I don't like the config name 'allowed', but I couldn't get any better name.
Yuya Nishihara <yuya@tcha.org> [Fri, 03 Nov 2017 20:12:50 +0900] rev 34984
subrepo: disallow symlink traversal across subrepo mount point (SEC)
It wasn't easy to extend the pathauditor to check symlink traversal across
subrepos because pathauditor._checkfs() rejects a directory having ".hg"
directory. That's why I added the explicit islink() check.
No idea if this patch is necessary after we've fixed the
issue5730 by
splitting submerge() into planning and execution phases.
Yuya Nishihara <yuya@tcha.org> [Fri, 03 Nov 2017 19:17:25 +0900] rev 34983
tests: show symlink traversal across subrepo mount point (SEC)
Also adds a couple of tests where the auditor does work as expected.
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 06 Nov 2017 10:33:40 -0800] rev 34982
share: move config item declarations into core
These config items control share behavior that is implemented in core.
Since the functionality is implemented in core, extensions may
leverage it.
Mozilla has one such extension. And, it needs to access share.pool.
Before this patch, a devel warning regarding accessing an unregistered
config option would be issued unless the share extension were loaded.
Moving the registration of the config options to core fixes this.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 04 Nov 2017 23:39:54 -0400] rev 34981
morestatus: don't crash with different drive letters for repo.root and CWD
Previously, if there were unresolved files and the CWD drive was different from
the repo drive, `hg status -v` would page the normal status, followed by the
exception header. A stacktrace was waiting when the pager exited. The
underlying cause was the same as
f445b10dc7fb.
Unfortunately, I don't see any reasonable way to write a test this [1].
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-November/107401.html
Matt Harbison <matt_harbison@yahoo.com> [Fri, 03 Nov 2017 22:22:50 -0400] rev 34980
pathutil: add doctests for canonpath()
This is a followup to
f445b10dc7fb. Since there's no way to ensure that more
drive letters than C: exist, this seems like the only way to test it. This is
enough to catch the
f445b10dc7fb scenario, as well as CWD outside of the repo
when the path isn't prefixed with path/to/repo.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 02 Nov 2017 23:55:09 -0400] rev 34979
share: handle --relative shares to a different drive letter gracefully
This had the same problem as
f445b10dc7fb. Banning os.path.relpath() is
tempting, but the hint it provides is useful here.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:02:46 +0530] rev 34978
py3: handle keyword arguments in hgext/gpg.py
Differential Revision: https://phab.mercurial-scm.org/D1303
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:02:28 +0530] rev 34977
py3: handle keyword arguments in hgext/fetch.py
Differential Revision: https://phab.mercurial-scm.org/D1302
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:02:07 +0530] rev 34976
py3: handle keyword arguments in hgext/extdiff.py
Differential Revision: https://phab.mercurial-scm.org/D1301
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:01:45 +0530] rev 34975
py3: handle keyword arguments in hgext/commitextras.py
Differential Revision: https://phab.mercurial-scm.org/D1300
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 23 Oct 2017 00:01:16 +0530] rev 34974
py3: handle keyword arguments in hgext/churn.py
Differential Revision: https://phab.mercurial-scm.org/D1299
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 22 Oct 2017 23:53:10 +0530] rev 34973
py3: handle keyword arguments in hgext/children.py
Differential Revision: https://phab.mercurial-scm.org/D1298
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 22 Oct 2017 23:52:47 +0530] rev 34972
py3: handle keyword arguments in hgext/blackbox.py
Differential Revision: https://phab.mercurial-scm.org/D1297
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 22 Oct 2017 23:52:22 +0530] rev 34971
py3: handle keyword arguments in hgext/automv.py
Differential Revision: https://phab.mercurial-scm.org/D1296
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 22 Oct 2017 23:51:57 +0530] rev 34970
py3: handle keyword arguments in hgext/amend.py
Differential Revision: https://phab.mercurial-scm.org/D1295
Matthieu Laneuville <matthieu.laneuville@octobus.net> [Thu, 19 Oct 2017 23:13:57 +0900] rev 34969
run-tests: allow automatic test discovery when providing folder as argument
Currently `run-tests.py` automatically discovers test only in the current
directory if no argument is provided. This patch makes it possible to pass a
number of tests and folders as arguments.
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 03 Nov 2017 14:47:37 +0100] rev 34968
revert: do not reverse hunks in interactive when REV is not parent (
issue5096)
And introduce a new "apply" operation verb for this case as suggested in
issue5096. This replaces the no longer used "revert" operation.
In interactive revert, when reverting to something else that the parent
revision, display an "apply this change" message with a diff that is not
reversed.
The rationale is that `hg revert -i -r REV` will show hunks of the diff from
the working directory to REV and prompt the user to select them for applying
(to working directory). This contradicts
dcc56e10c23b in which it was
decided to have the "direction" of prompted hunks reversed. Later on
[1], there was a broad consensus (but no decision) towards the "as to
be applied direction". Now that --interactive is no longer experimental
(
5910db5d1913), it's time to switch and thus we drop no longer used
"experimental.revertalternateinteractivemode" configuration option.
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-November/090142.html
.. feature::
When interactive revert is run against a revision other than the working
directory parent, the diff shown is the diff to *apply* to the working directory,
rather than the diff to *discard* from the working copy. This is in line with
related user experiences with `git` and appears to be less confusing with
`ui.interface=curses`.
Kevin Bullock <kbullock+mercurial@ringworld.org> [Fri, 03 Nov 2017 10:32:38 -0500] rev 34967
merge with stable
Matthieu Laneuville <matthieu.laneuville@octobus.net> [Fri, 03 Nov 2017 21:14:57 +0900] rev 34966
run-tests: endswith takes bytes as argument in python3, not str
Matt Harbison <matt_harbison@yahoo.com> [Thu, 02 Nov 2017 20:35:31 -0400] rev 34965
pathutil: use util.pathto() to calculate relative cwd in canonpath()
os.path.relpath() exploded if the 'root' and 'cwd' directories had different
drive letters. I noticed this in TortoiseHg when typing a fileset into the
filter, and it kept complaining until the closing '()' was typed. This was
reproducible on the command line with:
$ cd /d
$ hg -R /c/Users/Matt/Projects/hg files 'set:e'
Traceback (most recent call last):
...
File "mercurial\pathutil.pyc", line 182, in canonpath
File "ntpath.pyc", line 529, in relpath
ValueError: path is on drive c:, start on drive d:
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Oct 2017 16:50:57 +0900] rev 34964
patch: improve heuristics to not take the word "diff" as header (
issue1879)
The word "diff" is likely to appear in a commit message. Let's make it less
likely by requiring "diff -" for "diff -r" or "diff --git".
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Oct 2017 17:01:20 +0900] rev 34963
rebase: drop --style option
It existed from the very start, but I don't think the rebase command does
support log-like templates.
Matthieu Laneuville <matthieu.laneuville@octobus.net> [Wed, 02 Aug 2017 13:27:45 +0900] rev 34962
run-tests: $TESTDIR can be something else than $PWD
$TESTDIR is expected to be the directory were the test lives, and is often used
to reference helper functions. However, it is now set to $PWD at test invocation
time, so if `run-tests.py` is called from another folder, the test will fail.
The solution is to force $TESTDIR to be the base directory of the test itself,
irrespective of where the runner is called from.
Boris Feld <boris.feld@octobus.net> [Wed, 01 Nov 2017 17:08:33 +0100] rev 34961
obsolete: activate effect-flag by default
Let's activate effect-flag by default as Evolve is experimental and in order
to gather feedback from users.
Boris Feld <boris.feld@octobus.net> [Mon, 30 Oct 2017 17:09:29 +0100] rev 34960
debug: print parsed bundle2 capabilities with debugcapabilities
The bundle2 capabilities are hard to read in their encoded form. We parse and
print them in a human friendly way.
Boris Feld <boris.feld@octobus.net> [Mon, 30 Oct 2017 17:08:16 +0100] rev 34959
debug: add a debugcapabilities commands
This new debugcommand prints the capabilities of any remote in a human friendly
way. Improved bundle2 capabilities support will be introduced in the next
changesets.
Augie Fackler <augie@google.com> [Mon, 30 Oct 2017 17:46:07 -0400] rev 34958
revert: no longer mark --interactive as experimental
We seem to have settled down on behavior changes here (nothing
matching revset `keyword(revert) and keyword(interactive)` since 4.2
was released), so let's go ahead and advertise this excellent feature.
.. feature:: revert --interactive
The revert command now accepts the flag --interactive to allow reverting
only some of the changes to the specified files.
Augie Fackler <augie@google.com> [Wed, 25 Oct 2017 23:01:54 -0400] rev 34957
ui: add configlist doctest to document a bit more of the whitespace behavior
I'm surprised this wasn't explicitly tested, so I added a test.
Kevin Bullock <kbullock+mercurial@ringworld.org> [Wed, 01 Nov 2017 17:19:45 -0500] rev 34956
merge stable into default
Kevin Bullock <kbullock@ringworld.org> [Wed, 01 Nov 2017 16:54:39 -0500] rev 34955
Added signature for changeset
0ccb43d4cf01
Kevin Bullock <kbullock@ringworld.org> [Wed, 01 Nov 2017 16:54:38 -0500] rev 34954
Added tag 4.4 for changeset
0ccb43d4cf01
Jun Wu <quark@fb.com> [Wed, 01 Nov 2017 14:22:26 -0700] rev 34953
test-dispatch: stabilize the test
When cwd is removed and `hg` is executed, some shells may run `getcwd`
before forking and executing, some may not do it, some may print a
different error message.
The test should be shell-independent so let's just avoid checking the error
message.
Differential Revision: https://phab.mercurial-scm.org/D1282
Kevin Bullock <kbullock+mercurial@ringworld.org> [Wed, 01 Nov 2017 15:34:22 -0500] rev 34952
internals: update test-help.t for config registrar copy-edit
Kevin Bullock <kbullock+mercurial@ringworld.org> [Wed, 01 Nov 2017 13:24:08 -0500] rev 34951
internals: copy-edit "register" -> "registrar" in configitem docs
Augie Fackler <augie@google.com> [Wed, 01 Nov 2017 16:07:33 -0400] rev 34950
merge with i18n
Wagner Bruna <wbruna@yahoo.com> [Wed, 01 Nov 2017 08:31:16 -0200] rev 34949
i18n-pt_BR: synchronized with
cab34bda259e
Matt Harbison <matt_harbison@yahoo.com> [Tue, 31 Oct 2017 23:09:29 -0400] rev 34948
help: minor copy editing for grammar
Yuya Nishihara <yuya@tcha.org> [Tue, 31 Oct 2017 22:37:30 +0900] rev 34947
configitems: relax warning about unwanted default value
The original condition was a bit harsh for extension authors since third-party
extensions need to preserve compatibility with older Mercurial versions, where
no defaults would be loaded from the configtable. So let's silence the warning
if the given default value matches, which should be harmless.
Kostia Balytskyi <ikostia@fb.com> [Thu, 26 Oct 2017 11:07:06 -0700] rev 34946
filemerge: pass a default value to _toolstr (
issue5718)
After a refactoring, _toolstr stopped having default="" as one of it's args,
therefore when called without a default it returns None and not "". This causes
concatenation to fail.
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 31 Oct 2017 06:39:38 +0530] rev 34945
children: fix the log expansion of `hg children` in doc
`hg log -r children()` returns `hg: parse error: missing argument`.
Differential Revision: https://phab.mercurial-scm.org/D1269
Yuya Nishihara <yuya@tcha.org> [Sun, 29 Oct 2017 17:53:52 +0900] rev 34944
test-static-http: flush access log per request
It appears that stderr is fully buffered on Windows.
# no-check-commit because of log_message() function
Yuya Nishihara <yuya@tcha.org> [Sat, 28 Oct 2017 17:23:52 +0900] rev 34943
statichttprepo: do not use platform path separator to build a URL
It wouldn't work between Windows client and Unix server.
Siddharth Agarwal <sid0@fb.com> [Tue, 24 Oct 2017 11:15:30 -0700] rev 34942
merge: disable path conflict checking by default (
issue5716)
We shouldn't ship a severe perf regression in hg update for 4.4.
Differential Revision: https://phab.mercurial-scm.org/D1223
Siddharth Agarwal <sid0@fb.com> [Tue, 24 Oct 2017 11:14:38 -0700] rev 34941
merge: add a config option to disable path conflict checking
We've found a severe perf regression in `hg update` caused by the path conflict
checking code. The next patch will disable this by default.
Differential Revision: https://phab.mercurial-scm.org/D1222
Mark Thomas <mbthomas@fb.com> [Fri, 20 Oct 2017 05:53:35 -0700] rev 34940
dirstate: clean up when restoring identical backups
When a dirstate backup is restored, it is possible that no actual changes to
the dirstate have been made. In this case, the backup is still a hardlink
to the original dirstate.
Unfortunately, `os.rename` silently fails (nothing happens, and no error
occurs) when `src` and `dst` are hardlinks to the same file. As a result,
the backup is left lying around. Over time, these files accumulate.
When restoring dirstate backups, check if the backup and the dirstate are
the same file, and if so, just delete the backup.
Differential Revision: https://phab.mercurial-scm.org/D1201
Mark Thomas <mbthomas@fb.com> [Fri, 20 Oct 2017 05:53:33 -0700] rev 34939
tests: add a test demonstrating failure to clean up dirstate backups
Differential Revision: https://phab.mercurial-scm.org/D1200
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Oct 2017 23:01:56 -0400] rev 34938
tests: adjust hooks for Windows
I'm not sure why these weren't working on Windows. The failures were generally
in the style of:
- remote: phase-move:
cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: 1 -> 0
+ remote: "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
and
- abort: pretxnclose-bookmark.force-forward hook exited with status 1
- [255]
+ abort: pretxnclose-bookmark.force-public hook exited with status 255
+ [255]
These failures originated in
ee5f0d047b41::
f6d17075608f.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Oct 2017 21:29:15 -0400] rev 34937
test-log-linerange: open binary file in binary mode
The '\n' characters were being translated on Windows, throwing off hg and git
hashes, as well as the file content in the diff.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 19 Oct 2017 23:16:48 -0400] rev 34936
test-arbitraryfilectx: stabilize for Windows
Previously, the second last test (context.arbitraryfilectx(..)) returned True on
Windows. I changed the repo setup sequence to import a patch, so that way the
repo would have a proper symlink. That made the last test fail, since it is
comparing files in wdir(), one of which is not the expected symlink.
Apparently the (feature !) line matching doesn't work well with (no-eol), so I
had to conditionalize the test instead of the output.
Durham Goode <durham@fb.com> [Sat, 28 Oct 2017 12:35:54 -0700] rev 34935
dirstate: remove excess attribute lookups for dirstate.status (
issue5714)
A recent refactor added a layer of abstraction to the dirstate which makes doing
things like 'foo in dirstate' now require some extra Python attribute lookups.
This is causing a 100ms slow down in hg status for mozilla-central.
The fix is to hoist the inner dict's functions onto the main class once the lazy
loading it complete, as well as store the actual functions before doing the
status loop (as is done for other such functions).
In my testing, it seems to address the performance regression, but we'll
need to see the perf run results to know for sure.
Differential Revision: https://phab.mercurial-scm.org/D1257
Durham Goode <durham@fb.com> [Thu, 26 Oct 2017 16:15:36 -0700] rev 34934
dirstate: avoid reading the map when possible (
issue5713) (
issue5717)
Before the recent refactor, we would not load the entire map until it was
accessed. As part of the refactor, that got lost and even just trying to load
the dirstate parents would load the whole map. This caused a perf regression
(
issue5713) and a regression with static http serving (
issue5717).
Making it lazy loaded again fixes both.
Differential Revision: https://phab.mercurial-scm.org/D1253