Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:45:33 +0200] rev 34229
configitems: register the 'web.allow_archive' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:45:32 +0200] rev 34228
configitems: register the 'web.address' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:45:31 +0200] rev 34227
configitems: register the 'web.accesslog' config
Boris Feld <boris.feld@octobus.net> [Fri, 15 Sep 2017 19:21:08 +0200] rev 34226
web: use '_unset' default value for proxy config method
This special value is needed to make sure registered default value are taken in
account.
Augie Fackler <raf@durin42.com> [Sat, 16 Sep 2017 11:48:05 -0400] rev 34225
tests: use int() instead of long() in test-pathencode.py
Augie Fackler <raf@durin42.com> [Sat, 16 Sep 2017 11:47:53 -0400] rev 34224
tests: add xrange alias for test-pathencode.py
Augie Fackler <raf@durin42.com> [Sat, 16 Sep 2017 11:33:16 -0400] rev 34223
python3: another 3 tests whitelisted
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 21:22:34 -0400] rev 34222
repair: reliably obtain bytestr of node ids
Augie Fackler <raf@durin42.com> [Fri, 15 Sep 2017 18:38:36 -0400] rev 34221
bundles: turn nbchanges int into a bytestr using pycompat.bytestr
Fixes some python 3 failures.
Augie Fackler <raf@durin42.com> [Sat, 16 Sep 2017 11:09:08 -0400] rev 34220
exchange: hit opargs with pycompat.strkwargs before **-ing it
Fixes Python 3 problems.
Yuya Nishihara <yuya@tcha.org> [Fri, 15 Sep 2017 23:58:45 +0900] rev 34219
revlog: update signature of dummy addgroup() in bundlerepo and unionrepo
Per
c8b6ed51386b,
2f5c45fe3a3b and
00e3f909907f.
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Sep 2017 22:55:48 +0900] rev 34218
py3: use 'surrogatepass' error handler to process U+DCxx transparently
It's disallowed by default on Python 3.
https://docs.python.org/3/library/codecs.html#error-handlers
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Sep 2017 22:42:19 +0900] rev 34217
py3: don't pass bytes to array.array()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:54:29 +0900] rev 34216
py3: wrap bytes in encoding.from/toutf8b() with bytestr
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:28:47 +0900] rev 34215
py3: iterate bytes as a byte string in store.lowerencode()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:27:50 +0900] rev 34214
py3: use bytechr() in store._buildlowerencodefun()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:26:10 +0900] rev 34213
store: give name to lowerencode function
lambda function isn't easy to track in traceback.
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:32:45 +0900] rev 34212
py3: iterate bytes as a byte string in dagparser.py
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:28:39 +0900] rev 34211
py3: wrap string constants in dagparser.py with bytestr()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:25:50 +0900] rev 34210
py3: drop use of str() in dagparser.py
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:22:54 +0900] rev 34209
dagparser: fix variable name in error message
There's no variable named 'type'.
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:47:21 +0900] rev 34208
py3: convert function name to bytes in ui.configwith()
Augie Fackler <raf@durin42.com> [Wed, 23 Aug 2017 01:23:16 -0400] rev 34207
drawdag: port to python 3
Augie Fackler <raf@durin42.com> [Wed, 23 Aug 2017 10:51:26 -0400] rev 34206
drawdag: add a couple of doctests to help with python3 porting
Augie Fackler <raf@durin42.com> [Wed, 23 Aug 2017 01:24:01 -0400] rev 34205
drawdag: tagsmod.tag() takes a list of names, not a single name
We were getting lucky on Python 2 since we have only one-byte names,
but on Python 3 badness was happening.
Augie Fackler <raf@durin42.com> [Wed, 23 Aug 2017 01:22:59 -0400] rev 34204
bruterebase: port to python 3
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 21:21:13 -0400] rev 34203
exchange: use '%d' % x instead of str(x) to encode ints
Recommended by Yuya instead of using pycompat.bytestr() in this case.
Augie Fackler <raf@durin42.com> [Fri, 15 Sep 2017 19:44:32 -0400] rev 34202
posix: always pass a native str to unicodedata.normalize's first arg
Augie Fackler <raf@durin42.com> [Fri, 15 Sep 2017 19:44:05 -0400] rev 34201
posix: use slicing to grab a single byte out of a bytes in HFS+ normcase code
Augie Fackler <raf@durin42.com> [Fri, 15 Sep 2017 19:43:32 -0400] rev 34200
encoding: ensure getutf8char always returns a bytestr, never an int
Augie Fackler <raf@durin42.com> [Fri, 15 Sep 2017 19:43:02 -0400] rev 34199
posix: fix HFS+ normcase doctest to produce valid bytes literals in Python 3
We were previously getting lucky on Python 2.
Augie Fackler <augie@google.com> [Fri, 15 Sep 2017 22:08:25 -0400] rev 34198
tests: add and remove some (glob) markers
I have no idea if these changes are reasonable, but they look like
they'd help on the Windows buildbot.
Augie Fackler <raf@durin42.com> [Mon, 18 Sep 2017 11:53:54 -0400] rev 34197
Added signature for changeset
920977f72c7b
Augie Fackler <raf@durin42.com> [Mon, 18 Sep 2017 11:53:53 -0400] rev 34196
Added tag 4.3.2 for changeset
920977f72c7b
Augie Fackler <augie@google.com> [Mon, 18 Sep 2017 11:51:41 -0400] rev 34195
merge with i18n
Wagner Bruna <wbruna@softwareexpress.com.br> [Mon, 31 Jul 2017 12:18:42 -0300] rev 34194
i18n-pt_BR: synchronized with
850d2ec2cf6a
Boris Feld <boris.feld@octobus.net> [Fri, 15 Sep 2017 18:57:50 +0200] rev 34193
hgwebdir: read 'web.template' untrusted
The 'hgweb_mod.py' version of this read it untrusted. For consistency we align
the two versions of this code.
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 24 Aug 2017 22:55:56 +0530] rev 34192
uncommit: move fb-extension to core which uncommits a changeset
uncommit extension in fb-hgext adds a uncommit command which by default
uncommits a changeset and move all the changes to the working directory. If
file names are passed, uncommit moves the changes from those files to the
working directory and left the changeset with remaining committed files.
The uncommit extension in fb-hgext does not creates an empty commit like the one
in evolve extension unless user has specified ui.alllowemptycommit to True.
The test file added is a combination of tests from test-uncommit.t,
test-uncommit-merge.t and test-uncommit-bookmark.t from fb-hgext.
.. feature::
A new uncommit extension which provides `hg uncommit` using which one can
uncommit part or all of the changeset. This command undoes the effect of a
local commit, returning the affected files to their uncommitted state.
Differential Revision: https://phab.mercurial-scm.org/D529
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 13 Sep 2017 21:15:46 -0700] rev 34191
show: use consistent (and possibly shorter) node lengths
`hg show` makes heavy use of shortest() to limit the length of the node
hash.
For the "stack" and "work" views, you are often looking at multiple
lines of similar output for "lines" of work. It is visually appeasing
for things to vertically align. A naive use of {shortest(node, N)}
could result in variable length nodes and for the first character of
the description to vary by a column or two.
We implement a function to determine the longest shortest prefix for
a set of revisions. The new function is used to determine the printed
node length for all `hg show` views.
.. feature::
show: use consistent node length in views
Our previous shortest node length of 5 was arbitrarily chosen.
shortest() already does the work of ensuring that a partial node
isn't ambiguous with an integer revision, which is our primary risk
of a collision for very short nodes. It should be safe to go with the
shortest node possible.
Existing code is also optimized to handle nodes as short as 4.
So, we decrease the minimum hash length from 5 to 4.
We also add a test demonstrating that prefix collisions increase the
node length.
.. feature::
show: decrease minimum displayed hash length from 5 to 4
Differential Revision: https://phab.mercurial-scm.org/D558
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 03 Aug 2017 21:51:34 -0700] rev 34190
show: pass the minimum length for nodes as a template keyword
This will allow us to make the displayed length configurable
and/or dynamic.
Differential Revision: https://phab.mercurial-scm.org/D556
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 03 Aug 2017 21:13:27 -0700] rev 34189
cmdutil: allow extra properties to be added to each context
The changeset displayer allows setting extra keywords to be available
to the templating layer. This patch adds an argument to displaygraph()
to pass a dict of extra properties to be available to every changeset.
Differential Revision: https://phab.mercurial-scm.org/D555
Michael Bolin <mbolin@fb.com> [Thu, 14 Sep 2017 09:41:22 -0700] rev 34188
dirstate: perform transactions with _map using single call, where possible
This is in the same style as https://phab.mercurial-scm.org/D493.
In general, this replaces patterns such as:
```
f in self._map:
entry = self._map[f]
```
with:
```
entry = self._map.get(f):
if entry is not None:
# use entry
```
Test Plan:
`make tests`
Differential Revision: https://phab.mercurial-scm.org/D663
Boris Feld <boris.feld@octobus.net> [Tue, 05 Sep 2017 00:34:13 +0200] rev 34187
extensions: register config item early
Config items are likely to be used in during extensions setup. So we much
register them before that.
For example this apply to the 'win32text.warn' options.
Boris Feld <boris.feld@octobus.net> [Tue, 05 Sep 2017 00:31:59 +0200] rev 34186
extensions: factor extra data loading out
Some of the extra data need to be registered earlier than they currently are
(eg: config items). We first factor out the logic to registered them in a small
function before reusing it in the next changeset.
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:45:56 +0200] rev 34185
configitems: register the 'win32text.warn' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:17 +0200] rev 34184
configitems: register the 'mq.secret' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:16 +0200] rev 34183
configitems: register the 'mq.plain' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:15 +0200] rev 34182
configitems: register the 'mq.keepchanges' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:14 +0200] rev 34181
configitems: register the 'mq.git' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:45:54 +0200] rev 34180
configitems: register the 'win32mbcs.encoding' config
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 03 Sep 2017 03:49:15 +0530] rev 34179
copytrace: move fast heuristic copytracing algorithm to core
copytrace extension in fb-hgext has a heuristic implementation of copy tracing
which is faster than the current copy tracing. The heuristic limits the search
of copies to just files that are either:
1) Renames in the same directory
2) Moved to other directory with same name
The default copytrace implementation is very slow as it finds all the new files
that were added from merge base up to the head commit and for each file it
checks whether it this was copied or moved version of a different file.
Stash@fb did analysis for the above heuristics on the fb repo and found that
among 2,443,768 moves/copies there are only 32,234 moves/copies which does not
fall under the above heuristics which is approx. 0.013 of total copies.
This patch moves the heuristics algorithm under config
`experimental.copytrace=heuristics`.
While moving fbext to core, this patch removes couple of less useful config
options named `sourcecommitlimit` and `maxmovescandidatestocheck`.
Tests are also added for the heuristics algorithm, which are basically copied
from fbext/tests/test-copytrace.t. The tests follow a pattern creating a server
repo and then cloning to a local repo to create public and draft changesets, the
distinction which will be useful in upcoming patches.
After this patch `experimental.copytrace` has the following behaviour:
1) `off`: turns off copytracing
2) `heuristics`: use the heuristic algorithm added in this patch.
3) everything else: use the full copytracing algorithm
.. feature::
A new fast heuristic algorithm for copytracing which assumes that the files
moves are either::
1) Renames in the same directory
2) Moves in other directories with same names
You can use this algorithm by setting `experimental.copytrace=heuristics`.
Differential Revision: https://phab.mercurial-scm.org/D623
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:36:46 +0200] rev 34178
configitems: register the 'convert.svn.startrev' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:36:36 +0200] rev 34177
configitems: register the 'convert.svn.debugsvnlog' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:36:28 +0200] rev 34176
configitems: register the 'convert.skiptags' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:36:20 +0200] rev 34175
configitems: register the 'convert.p4.startrev' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:36:00 +0200] rev 34174
configitems: register the 'convert.localtimezone' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:35:55 +0200] rev 34173
configitems: register the 'convert.ignoreancestorcheck' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:35:48 +0200] rev 34172
configitems: register the 'convert.hg.usebranchnames' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:35:38 +0200] rev 34171
configitems: register the 'convert.hg.tagsbranch' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:35:29 +0200] rev 34170
configitems: register the 'convert.hg.startrev' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:35:22 +0200] rev 34169
configitems: register the 'convert.hg.sourcename' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:35:12 +0200] rev 34168
configitems: register the 'convert.hg.saverev' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:58 +0200] rev 34167
configitems: register the 'convert.hg.revs' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:49 +0200] rev 34166
configitems: register the 'convert.hg.ignoreerrors' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:45 +0200] rev 34165
configitems: register the 'convert.hg.clonebranches' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:32 +0200] rev 34164
configitems: register the 'convert.git.skipsubmodules' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:23 +0200] rev 34163
configitems: register the 'convert.git.similarity' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:14 +0200] rev 34162
configitems: register the 'convert.git.saverev' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:06 +0200] rev 34161
configitems: register the 'convert.git.renamelimit' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:34:00 +0200] rev 34160
configitems: register the 'convert.git.remoteprefix' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:33:51 +0200] rev 34159
configitems: register the 'convert.git.findcopiesharder' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:33:41 +0200] rev 34158
configitems: register the 'convert.git.extrakeys' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:33:29 +0200] rev 34157
configitems: register the 'convert.git.committeractions' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:33:25 +0200] rev 34156
configitems: register the 'convert.cvsps.mergeto' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:33:15 +0200] rev 34155
configitems: register the 'convert.cvsps.mergefrom' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:33:06 +0200] rev 34154
configitems: register the 'convert.cvsps.fuzz' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:32:53 +0200] rev 34153
configitems: register the 'convert.cvsps.cache' config
The convert extensions has code a bit all around, but it seems simpler to use a
central declaration of options at the root first.
Durham Goode <durham@fb.com> [Wed, 13 Sep 2017 20:39:01 -0700] rev 34152
bundle2: move exception handling into part iterator
As part of separating the part iteration logic from the part handling logic,
let's move the exception handling to the part iterator class.
Differential Revision: https://phab.mercurial-scm.org/D705
Durham Goode <durham@fb.com> [Wed, 13 Sep 2017 17:16:50 -0700] rev 34151
bundle2: move part counter to partiterator
As part of moving the part iterator logic to a separate class, let's move the
part counting logic and the output for it.
Differential Revision: https://phab.mercurial-scm.org/D704
Durham Goode <durham@fb.com> [Wed, 13 Sep 2017 17:16:45 -0700] rev 34150
bundle2: move part iterator a separate class
Currently, the part iterator logic is tightly coupled with the part handling
logic, which means it's hard to replace the part handling logic without
duplicating the part iterator bits.
In a future diff we'll want to be able to replace all part handling, so let's
begin refactoring the part iterator logic to it's own class.
Differential Revision: https://phab.mercurial-scm.org/D703
Durham Goode <durham@fb.com> [Mon, 11 Sep 2017 13:39:22 -0700] rev 34149
changegroup: add source parameter to generatemanifests
Extensions, like remotefilelog, will want to look at the source of a pull when
determining what manifests to add to a changegroup. For instance, on push they
will include everything, while on pull they won't.
Differential Revision: https://phab.mercurial-scm.org/D686
Durham Goode <durham@fb.com> [Wed, 13 Sep 2017 10:43:44 -0700] rev 34148
changegroup: remove changegroup dependency from revlog.addgroup
Previously revlog.addgroup would accept a changegroup and a linkmapper and use
it to iterate of the deltas. As part of untangling the revlog-changegroup
interdependency, let's move the changegroup delta iteration logic to it's own
function and pass the simple iterator to the revlog instead.
This will make it easier to introduce non-revlogs stores in the future, without
reinventing any changegroup specific logic.
Differential Revision: https://phab.mercurial-scm.org/D688
Durham Goode <durham@fb.com> [Wed, 13 Sep 2017 10:43:16 -0700] rev 34147
revlog: refactor chain variable
Previously the addgroup loop would set chain to be the result of
self._addrevision(node,...). Since _addrevision now always returns the passed in
node, we can drop that behavior and just always set chain = node in the loop.
This will be useful in a future patch where we refactor the cg.deltachunk logic
to another function and therefore chain disappears entirely from this function.
Differential Revision: https://phab.mercurial-scm.org/D699
Mark Thomas <mbthomas@fb.com> [Mon, 11 Sep 2017 17:49:49 +0000] rev 34146
scmutil: don't append .orig to backups in origbackuppath (BC)
When ui.origbackuppath is set, .orig files are stored outside of the working
copy, however they still have a .orig suffix appended to them. This can cause
unexpected conflicts, particularly when tracked files or directories have .orig
at the end.
This change removes the .orig suffix from files stored in an out-of-tree
origbackuppath.
Test Plan:
Update and run unit tests.
Differential Revision: https://phab.mercurial-scm.org/D679
Durham Goode <durham@fb.com> [Mon, 11 Sep 2017 15:59:18 -0700] rev 34145
ssh: fix flakey ssh errors on BSD systems
This is a trivial backport of
c037fd655b47 performed by
augie@google.com, but the change is still really Durham's not mine, so
I [augie] am leaving him as the author.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Sep 2017 11:16:57 -0700] rev 34144
repair: preserve phase also when not using generaldelta (
issue5678)
It seems like we used to pick the oldest possible version of the
changegroup to use for bundles created by the repair module (used
e.g. by "hg strip" and for temporary bundles by "hg rebase"). I tried
to preserve that behavior when I created the changegroup.safeversion()
method in
3b2ac2115464 (changegroup: introduce safeversion(),
2016-01-19).
However, we have recently chagned our minds and decided that these
commands are only used locally and downgrades are unlikely. That
decicion allowed us to start adding obsmarker and phase information to
these bundles. However, as the bug report shows, it means we get
different behavior e.g. when generaldelta is not enabled (because when
it was enabled, it forced us to use bundle2). The commit that actually
caused the reported bug was
8e3021fd1a44 (strip: include phases in
bundle (BC), 2017-06-15).
So, since we now depend on having more information in the bundles,
let's make sure we instead pick the newest possible changegroup
version.
Differential Revision: https://phab.mercurial-scm.org/D715
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Sep 2017 11:16:47 -0700] rev 34143
tests: add test for
issue5678
In addition to a test case for the direct problem described in the bug
report, this also adds a test case showing how obsmarkers can also get
lost when not using generaldelta.
Differential Revision: https://phab.mercurial-scm.org/D714
Phil Cohen <phillco@fb.com> [Tue, 12 Sep 2017 19:27:01 -0700] rev 34142
merge: move cwd-missing detection to helper functions
This will exist in two places with defered writes, so we want to avoid
duplication.
Differential Revision: https://phab.mercurial-scm.org/D626
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:09:04 +0900] rev 34141
doctest: enable tests by default on Python 3
Still several tests fail mostly because of the string issues, sigh. I'll
fix them one by one.
Yuya Nishihara <yuya@tcha.org> [Thu, 24 Aug 2017 22:33:28 +0900] rev 34140
doctest: normalize b'', u'' and exception output on Python 3
The idea is described in the following page.
https://dirkjan.ochtman.nl/writing/2014/07/06/single-source-python-23-doctests.html
# no-check-commit
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:33:10 +0900] rev 34139
doctest: coerce dict.keys() to list
Otherwise it would be printed as odict_keys([...]) on Python 3.
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:16:01 +0900] rev 34138
doctest: upgrade old-style "except" clause
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 14:56:31 +0900] rev 34137
doctest: use print_function and convert bytes to unicode where needed
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:47:17 +0900] rev 34136
doctest: do not embed non-ascii characters in docstring
Since the outer docstring is parsed as a unicode on Python 3, we have to
either double-escape or construct non-ascii string from ascii string.
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:42:27 +0900] rev 34135
doctest: pass encoding name as system string
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 14:38:58 +0900] rev 34134
doctest: replace str() with bytes()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 14:37:25 +0900] rev 34133
doctest: replace chr() with pycompat.bytechr()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 14:35:37 +0900] rev 34132
doctest: replace .iteritems() with .items()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 14:32:11 +0900] rev 34131
doctest: bulk-replace string literals with b'' for Python 3
Our code transformer can't rewrite string literals in docstrings, and I
don't want to make the transformer more complex.
Yuya Nishihara <yuya@tcha.org> [Thu, 07 Sep 2017 22:36:54 +0900] rev 34130
debuginstall: do not pass exception object to formatter (
issue5676)
Yuya Nishihara <yuya@tcha.org> [Thu, 07 Sep 2017 22:27:23 +0900] rev 34129
debuginstall: use codecs.lookup() to detect invalid encoding
encoding.fromlocal() never tries to decode an ascii string since
853574db5b12,
and there's no universal non-ascii string which can be decoded as any valid
character set.
Yuya Nishihara <yuya@tcha.org> [Sun, 10 Sep 2017 23:37:14 +0900] rev 34128
extensions: fix wrapcommand/function of class instance
5361771f9714 changed _updatewrapper() to copy the __name__ attribute, but
not all callable objects has __name__.
Spotted by loading mq with extdiff.
Durham Goode <durham@fb.com> [Tue, 12 Sep 2017 09:13:02 -0700] rev 34127
changegroup: avoid creating empty changegroup part
Previously this check happened in the changegroup code itself. Since its
refactor, this logic needs to move out to callers that care about it, such as
this one. Otherwise we get empty bundle devel-warnings in certain extensions.
Differential Revision: https://phab.mercurial-scm.org/D690
Durham Goode <durham@fb.com> [Tue, 12 Sep 2017 15:12:27 -0700] rev 34126
tests: split test-revset.t in half
This test has gotten so large that running it can exceed the normal timeout on
systems under load (like if we're running all the tests in parallel). This patch
splits the test cleanly in half.
Differential Revision: https://phab.mercurial-scm.org/D694
Phil Cohen <phillco@fb.com> [Mon, 11 Sep 2017 13:17:43 -0700] rev 34125
merge: flush any deferred writes just before recordupdates()
``recordupdates`` calls into the dirstate which requires the files to be
there, so this is the last possible moment we can flush anything.
Differential Revision: https://phab.mercurial-scm.org/D673
Phil Cohen <phillco@fb.com> [Mon, 11 Sep 2017 13:03:27 -0700] rev 34124
merge: flush any deferred writes before, and after, running any workers
Since we fork to create workers, any changes they queue up will be lost after
the worker terminates, so the easiest solution is to have each worker flush
the writes they accumulate--we are close to the end of the merge in any case.
To prevent duplicated writes, we also have the master processs flush before
forking.
In an in-memory merge (M2), we'll instead disable the use of workers.
Differential Revision: https://phab.mercurial-scm.org/D628
Phil Cohen <phillco@fb.com> [Mon, 11 Sep 2017 13:03:27 -0700] rev 34123
filemerge: flush if using deferred writes when running a merge tool
Since merge tools might read from the filesystem, we need to write out our
deferred writes here.
No-ops if not using deferred writes.
Differential Revision: https://phab.mercurial-scm.org/D627
Phil Cohen <phillco@fb.com> [Mon, 11 Sep 2017 13:03:27 -0700] rev 34122
merge: pass wctx to premerge, filemerge
In the in-memory merge branch. we'll need to call a function (``flushall``) on
the wctx inside of _xmerge.
This prepares the way so it can be done without hacks like ``fcd.ctx()``.
Differential Revision: https://phab.mercurial-scm.org/D449
Boris Feld <boris.feld@octobus.net> [Mon, 11 Sep 2017 18:07:29 +0200] rev 34121
cmdutil: fix amend when passing a date
Following https://phab.mercurial-scm.org/D636, passing the same date that the
changeset to amend would results in no new commits but the output changed
from:
$ hg amend -d '0 0'
nothing changed
[1]
to:
$ hg amend -d '0 0'
Restore the old behavior by parsing the date passed as parameter so the
condition "date == old.date()" correctly works in cases both dates are
identical.
Add a test for covering this regression.
This bug was found thanks to Evolve test suite.
Differential Revision: https://phab.mercurial-scm.org/D691
Augie Fackler <augie@google.com> [Tue, 12 Sep 2017 11:18:35 -0400] rev 34120
merge with stable
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:39:32 +0200] rev 34119
configitems: register the 'eol.only-consistent' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:39:26 +0200] rev 34118
configitems: register the 'eol.native' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:39:21 +0200] rev 34117
configitems: register the 'eol.fix-trailing-newline' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:43 +0200] rev 34116
configitems: register the 'patchbomb.publicurl' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:41 +0200] rev 34115
configitems: register the 'patchbomb.intro' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:40 +0200] rev 34114
configitems: register the 'patchbomb.from' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:39 +0200] rev 34113
configitems: register the 'patchbomb.flagtemplate' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:38 +0200] rev 34112
configitems: register the 'patchbomb.confirm' config
Boris Feld <boris.feld@octobus.net> [Fri, 30 Jun 2017 03:43:37 +0200] rev 34111
configitems: register the 'patchbomb.bundletype' config
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 21:12:27 -0700] rev 34110
blackbox: remove _bbvfs state
`_bbvfs` is redundant because it could be calcualted from `_bbrepo`.
Differential Revision: https://phab.mercurial-scm.org/D651
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 21:08:59 -0700] rev 34109
blackbox: do not cache file objects
Having the blackbox file objects cached in `ui._bbfp` could in theory be
troublesome if multiple processes (ex. chg servers) have file objects
referring to a same file. (Although I spent some time and failed to build a
convincing test case)
This patch makes blackbox re-open the file every time to make the situation
better. Ideally we also need proper locking.
The caching logic traces back to the commit introducing blackbox
(
18242716a). That commit does not have details about why caching is
necessary. Consider the fact that blackbox logs are not many, it seems fine
to remove the fp cache to be more confident.
Differential Revision: https://phab.mercurial-scm.org/D650
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 20:54:53 -0700] rev 34108
blackbox: inline _bbwrite
There is no need to make it a separate method. This makes the next change
easier to read.
Differential Revision: https://phab.mercurial-scm.org/D649
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 19:27:30 -0700] rev 34107
blackbox: fix rotation with chg
The added test will show:
$ $PYTHON showsize.py .hg/blackbox*
.hg/blackbox.log: < 500
.hg/blackbox.log.1: < 500
.hg/blackbox.log.2: < 500
.hg/blackbox.log.3: < 500
.hg/blackbox.log.4: < 500
.hg/blackbox.log.5: >= 500
with previous code.
The issue is caused by blackbox caching file objects *by path*, and the
rotation size check could run on a wrong file object (i.e. it should check
"blackbox.log", but `filehandles["blackbox.log"]` contains a file object
that has been renamed to "blackbox.log.5").
This patch removes the "filehandlers" global cache added by
45313f5a3a8c to
solve the issue.
I think the original patch was trying to make different ui objects use a same
file object if their blackbox.log path is the same. In theory it could also
be problematic in the rotation case. Anyway, that should become unnecessary
after D650.
Differential Revision: https://phab.mercurial-scm.org/D648
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 18:31:25 -0700] rev 34106
test-blackbox: make it compatible with chg
Differential Revision: https://phab.mercurial-scm.org/D647
Durham Goode <durham@fb.com> [Mon, 11 Sep 2017 15:59:18 -0700] rev 34105
ssh: fix flakey ssh errors on BSD systems
There's been a persistent issue with flakiness on BSD systems (like OSX) where
the 'no suitable response from remote hg' message would sometimes not appear.
This was caused by one of the earlier calls failing with a "IOError: Broken
pipe". Catching those errors and printing the same message removes the
flakiness.
Differential Revision: https://phab.mercurial-scm.org/D687
Phil Cohen <phillco@fb.com> [Mon, 11 Sep 2017 13:03:27 -0700] rev 34104
context: add overlayworkingcontext and overlayworkingfilectx
These two classes will be used extensively in the first in-memory merge
milestone.
Differential Revision: https://phab.mercurial-scm.org/D616
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:52:40 -0700] rev 34103
changegroup: rename getsubsetraw to makestream
Now that nothing uses getsubsetraw except makestream, let's move the
functionality into the makestream. This removes the last remaining excess
changegroup creation function, getsubsetraw.
Differential Revision: https://phab.mercurial-scm.org/D671
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:51:31 -0700] rev 34102
changegroup: remove external uses of getbundler
Now that makestream and makechangegroup are the primary creation methods for
changegroups, let's get rid of this rogue use of getbundler and getsubsetraw.
Differential Revision: https://phab.mercurial-scm.org/D670
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:50:12 -0700] rev 34101
changegroup: replace getchangegroup with makechangegroup
As part of reducing the number of changegroup creation APIs, let's replace
getchangegroup with calls to makechangegroup. This is mostly a drop in
replacement, but it does change the version specifier to be required, so it's
more obvious which callers are creating old version 1 changegroups still.
Differential Revision: https://phab.mercurial-scm.org/D669
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:48:42 -0700] rev 34100
changegroup: replace changegroup with makechangegroup
As part of reducing the number of changegroup creation APIs, let's replace the
changegroup function with makechangegroup. This pushes the responsibility of
creating the outgoing set to the caller, but that seems like a simple and
reasonable concept for the caller to be aware of.
Differential Revision: https://phab.mercurial-scm.org/D668
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:47:39 -0700] rev 34099
changegroup: delete getlocalchangegroup
As part of reducing the number of changegroup creation APIs, let's go ahead and
delete this unused function. It appears to have been deprecated in the last
release anyway.
Differential Revision: https://phab.mercurial-scm.org/D667
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 19:01:56 -0700] rev 34098
changegroup: replace getlocalchangegroupraw with makestream
As part of reducing the number of changegroup creation apis, let's replace calls
to getlocalchangegroupraw with calls to makestream. Aside from one case of
checking if there are no outgoing commits and returning None, this is pretty
much a drop in replacement.
Differential Revision: https://phab.mercurial-scm.org/D666
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:43:59 -0700] rev 34097
changegroup: replace changegroupsubset with makechangegroup
As part of getting rid of all the permutations of changegroup creation, let's
remove changegroupsubset and call makechangegroup instead. This moves the
responsibility of creating the outgoing set to the caller, but that seems like a
relatively reasonable unit of functionality for the caller to have to care about
(i.e. what commits should be bundled).
Differential Revision: https://phab.mercurial-scm.org/D665
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:39:02 -0700] rev 34096
changegroup: replace getsubset with makechangegroup
The current changegroup APIs are a bit of a mess. Currently you can use
getsubsetraw, getsubset, changegroupsubset, getlocalchangegroupraw,
getchangegroup, and getlocalchangroup to produce changegroups. This patch is the
beginning of a refactor to boil all of that away to just makechangegroup and
makestream.
The first step adds the new functions and replaces getsubset function with them.
Differential Revision: https://phab.mercurial-scm.org/D664
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 16:17:04 -0700] rev 34095
rebase: remove unnecessary '.unfiltered()' calls
Now we have a clear centric place to control whether `rbsrt.repo` is
unfiltered or not, we can drop `unfiltered()` in other places.
Differential Revision: https://phab.mercurial-scm.org/D645
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 16:13:04 -0700] rev 34094
rebase: remove complex unhiding code
This is similar to Martin von Zweigbergk's previous patch [1].
Previous patches are adding more `.unfiltered()` to the rebase code. So I
wonder: are we playing whack-a-mole regarding on `unfiltered()` in rebase?
Thinking about it, I believe most of the rebase code *should* just use an
unfiltered repo. The only exception is before we figuring out a
`rebasestate`. This patch makes it so. See added comment in code for why
that's more reasonable.
This would make the code base cleaner (not mangling the `repo` object),
faster (no need to invalidate caches), simpler (less LOC), less error-prone
(no need to think about what to unhide, ex. should we unhide wdir p2? how
about destinations?), and future proof (other code may change visibility in
an unexpected way, ex. directaccess may make the destination only visible
when it's in "--dest" revset tree).
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/094277.html
Differential Revision: https://phab.mercurial-scm.org/D644
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 15:23:19 -0700] rev 34093
rebase: use unfiltered repo when loading state
Before this patch, `rebase --abort` may fail to do the cleanup:
$ hg rebase --abort
rebase aborted (no revision is removed, only broken state is cleared)
The added test case makes sure `--abort` works in this case.
Differential Revision: https://phab.mercurial-scm.org/D643
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 12:40:00 -0700] rev 34092
rebase: do not crash rebasing merge with a parent having hidden successor
The added test will crash with previous code.
Differential Revision: https://phab.mercurial-scm.org/D640
Durham Goode <durham@fb.com> [Wed, 06 Sep 2017 18:33:55 -0700] rev 34091
changegroup: fix to allow empty manifest parts
The current chunk reading algorithm relied on counting the number of empty
chunks and comparing it to the number of chunk lists it expected (1 list of
files for cg1 and cg2, and 1 list of files + 1 list of trees for cg3). This
implicitly assumed that both the changelog part and the manifestlog part were
never empty (since them being empty would cause it to count it as one list being
done, and screw up the count). In our treemanifest code, the manifest section
could be empty, so we need to handle that case.
This patches refactors that code to be more explicit about how it counts the
expected parts.
Differential Revision: https://phab.mercurial-scm.org/D646
Mads Kiilerich <mads@kiilerich.com> [Mon, 11 Sep 2017 00:42:24 +0200] rev 34090
mq: create non-lossy patches, also with custom global diff configuration
Users with custom [diff] configuration most certainly didn't intend it to make
mq lose changes. It could:
* git is handled perfectly fine.
* nobinary could make mq leave some files out from the patches.
* noprefix could make mq itself (and probably also other tools) fail to apply
patches without the usual a/b prefix.
* ignorews, ignorewsamount, or ignoreblanklines could create patches with
missing whitespace that could fail to apply correctly.
Thus, when refreshing patches, use patch.difffeatureopts, optionally with git
as before, but without the config options for whitespace and format changing
that most likely will cause loss or problems.
(patch.diffopts is just patch.difffeatureopts with all options enabled and can
be replaced with that.)
Mads Kiilerich <mads@kiilerich.com> [Mon, 11 Sep 2017 00:42:22 +0200] rev 34089
mq: test coverage of how [diff] configuration influence can break mq patches
Jun Wu <quark@fb.com> [Tue, 05 Sep 2017 15:18:45 -0700] rev 34088
wrapcommand: use functools.partial
Like the previous patch, this helps remove noises in traceback.
Practically, this removes another 6 lines in `rebase -s . -d .` traceback in
my setup:
....
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
-File "hg/mercurial/extensions.py", line 331, in closure
- return func(*(args + a), **kw)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "fb-hgext/hgext3rd/fbhistedit.py", line 283, in _rebase
return orig(ui, repo, **opts)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
-File "hg/mercurial/extensions.py", line 331, in closure
- return func(*(args + a), **kw)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "remotenames.py", line 633, in exrebasecmd
ret = orig(ui, repo, **opts)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
-File "hg/mercurial/extensions.py", line 331, in closure
- return func(*(args + a), **kw)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "fb-hgext/hgext3rd/fbamend/__init__.py", line 453, in wraprebase
return orig(ui, repo, **opts)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
....
Differential Revision: https://phab.mercurial-scm.org/D633
Jun Wu <quark@fb.com> [Tue, 05 Sep 2017 13:37:36 -0700] rev 34087
wrapfunction: use functools.partial if possible
Every `extensions.bind` call inserts a frame in traceback:
... in closure
return func(*(args + a), **kw)
which makes traceback noisy.
The Python stdlib has a `functools.partial` which is backed by C code and
does not pollute traceback. However it does not support instancemethod and
sets `args` attribute which could be problematic for alias handling.
This patch makes `wrapfunction` use `functools.partial` if we are wrapping a
function directly exported by a module (so it's impossible to be a class or
instance method), and special handles `wrapfunction` results so alias
handling code could handle `args` just fine.
As an example, `hg rebase -s . -d . --traceback` got 6 lines removed in my
setup:
File "hg/mercurial/dispatch.py", line 898, in _dispatch
cmdpats, cmdoptions)
-File "hg/mercurial/extensions.py", line 333, in closure
- return func(*(args + a), **kw)
File "hg/hgext/journal.py", line 84, in runcommand
return orig(lui, repo, cmd, fullargs, *args)
-File "hg/mercurial/extensions.py", line 333, in closure
- return func(*(args + a), **kw)
File "fb-hgext/hgext3rd/fbamend/hiddenoverride.py", line 119, in runcommand
result = orig(lui, repo, cmd, fullargs, *args)
File "hg/mercurial/dispatch.py", line 660, in runcommand
ret = _runcommand(ui, options, cmd, d)
-File "hg/mercurial/extensions.py", line 333, in closure
- return func(*(args + a), **kw)
File "hg/hgext/pager.py", line 69, in pagecmd
return orig(ui, options, cmd, cmdfunc)
....
Differential Revision: https://phab.mercurial-scm.org/D632
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:36 -0700] rev 34086
cmdutil: remove redundant commitfunc parameter in amend (API)
Since the redundant commit during the amend has been been removed, there is no
need for commit callback function in amend now. Therefore, this commit removes
the unused parameter "commmitfunc" which was being used for this purpose.
Test Plan:
Ensured that all the tests pass
Differential Revision: https://phab.mercurial-scm.org/D635
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:36 -0700] rev 34085
cmdutil: remove the redundant commit during amend
There was an extra commit made during the amend operation to track the
changes to the working copy. However, this logic was written a long time back
and newer API's make this extra commit redundant. Therefore, I am removing the
extra commit. After this change, I noticed that
- Execution time of the cmdutil.amend improved by over 40%.
- Execution time of "hg commit --amend" improved by over 20%.
Test Plan:
I ensured that the all the hg tests passed after the change. I had
to fix a few tests which were aware of the extra commit made during the amend.
Differential Revision: https://phab.mercurial-scm.org/D636
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 12:56:19 -0700] rev 34084
checknlink: rename file object from 'fd' to 'fp'
Make it clear that `fp` (`file` object) is different from `fd` (low-level
file descriptor number).
Differential Revision: https://phab.mercurial-scm.org/D642
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Sep 2017 15:06:45 -0700] rev 34083
cleanup: rename "matchfn" to "match" where obviously a matcher
We usually call matchers either "match" or "m" and reserve "matchfn"
for functions.
Differential Revision: https://phab.mercurial-scm.org/D641
Martin von Zweigbergk <martinvonz@google.com> [Wed, 06 Sep 2017 08:22:54 -0700] rev 34082
check-code: fix incorrect capitalization in camelcase regex
This was found internally at Google as part of a monorepo-wide
cleanup.
Differential Revision: https://phab.mercurial-scm.org/D637
Martin von Zweigbergk <martinvonz@google.com> [Wed, 06 Sep 2017 10:41:13 -0700] rev 34081
amend: use context manager for config override
Differential Revision: https://phab.mercurial-scm.org/D639
Martin von Zweigbergk <martinvonz@google.com> [Wed, 06 Sep 2017 10:42:02 -0700] rev 34080
amend: delete dead assignment to "newid"
Differential Revision: https://phab.mercurial-scm.org/D638
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 17:09:53 -0700] rev 34079
checknlink: use a random temp file name for checking
Previously, if `.hg/store/00manifest.d.hgtmp1` exists, hg will copy the
entire `00manifest.d` every time when appending new manifest revisions.
That could happen if Mercurial or the machine crashed when `.hgtmp1` was
just created but not deleted yet.
This patch changes the fixed name to a random generated name. To be
consistent with D468, `~` suffix was used.
Differential Revision: https://phab.mercurial-scm.org/D611
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 03 Sep 2017 02:34:01 +0530] rev 34078
copytrace: move the default copytracing algorithm in a new function
We are going to introduce a new fast heuristic based copytracing algorithm, so
lets make mergecopies the function which decides which algorithm to go with and
then calls the related function.
While I was here, I add a line in test-copy-move-merge.t saying its a test
related to the full copytracing algorithm.
Differential Revision: https://phab.mercurial-scm.org/D622
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 03 Sep 2017 01:52:19 +0530] rev 34077
copytrace: replace experimental.disablecopytrace config with copytrace (BC)
This patch replaces experimental.disablecopytrace with experimental.copytrace.
Since the words does not means the same, the default value is also changed. Now
experimental.copytrace defaults to 'on'. The new value is not boolean value as
we will be now having two different algorithms (current one and heuristics one
to be imported from fbext) so we need this to be have more options than
booleans.
The old config option is not kept is completely replaced as that was under
experimental and we don't gurantee BC to experimental things.
.. bc::
The config option for copytrace `experimental.disablecopytrace` is now
replaced with `experimental.copytrace` which defaults to `on`. If you need to
turn off copytracing, add `[experimental] copytrace = off` to your config.
Differential Revision: https://phab.mercurial-scm.org/D621
Phil Cohen <phillco@fb.com> [Tue, 05 Sep 2017 12:04:02 -0700] rev 34076
filemerge: use fctx.write() in the internal:dump tool, instead of copy
This is slower but allows this tool to work with the "deferred writes"
milestone of in-memory merge.
The performance hit is not too noticiable since this only used for the :dump
merge tool during a conflict.
Differential Revision: https://phab.mercurial-scm.org/D617
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Aug 2017 22:39:10 -0700] rev 34075
largefiles: remove unused assignments from wrapfunction()
The return values from wrapfunction() were never used here. Using the
value is also a little tricky and wrappedfunction() should be
preferred, so let's just delete the assignments.
There's also a bunch of return values from wrapcommand() being
assigned to a variable here, but at least that value can be (and is
used after some of the assignments).
Differential Revision: https://phab.mercurial-scm.org/D618
the31k <the31k@thethirty.one> [Thu, 31 Aug 2017 18:24:08 +0300] rev 34074
branches: correctly show inactive multiheaded branches
Issue being fixed here: `hg branches` incorrectly renders inactive multiheaded
branches as active if they have closed heads.
Example:
```
$ hg log --template '{rev}:{node|short} "{desc}" ({branch}) [parents: {parents}]\n'
4:
2e2fa7af8357 "merge" (default) [parents: 0:
c94e548c8c7d 3:
7be622ae5832 ]
3:
7be622ae5832 "2" (somebranch) [parents: 1:
81c1d9458987 ]
2:
be82cf30409c "close" (somebranch) [parents: ]
1:
81c1d9458987 "1" (somebranch) [parents: ]
0:
c94e548c8c7d "initial" (default) [parents: ]
$ hg branches
default 4:
2e2fa7af8357
somebranch 3:
7be622ae5832
```
Branch `somebranch` have two heads, the 1st one being closed (rev 2) and
the other one being merged into default (rev 3). This branch should be shown as
inactive one.
This happens because we intersect branch heads with repo heads to check branch
activity. In this case intersection in a set with one node (rev 2). This head
is closed but the branch is marked as active nevertheless.
Fix is to check branch activity by intersecting only open heads set.
Fixed output:
```
$ hg branches
default 4:
2e2fa7af8357
somebranch 3:
7be622ae5832 (inactive)
```
Relevant tests for multihead branches added to test-branches suite.
Implentation note about adding `iteropen` method:
At first I have tried to modify `iterbranches` is such a way that it would
filter out closed heads itself. For example it could have `closed=False`
parameter. But in this case we would have to filter closed tips as well.
Reasoning in terms of `hg branches` we actually are not allowed to do this.
Also, we need to do heads filtering only if tip is not closed itself. But if it
is - we are ok to skip filtering, because branch is already known to be inactive.
So we can't implement heads filtering in `iterbranches` in elegant way, because
we will end up with something like `closed_heads=False` or even
`closed_heads_is_tip_is_open`. Finally I decided to move this logic to the
`branches` function, adding `iteropen` helper method.
Differential Revision: https://phab.mercurial-scm.org/D583
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 21:17:25 +0900] rev 34073
parser: stabilize output of prettyformat() by using byte-safe repr()
The format of leaf nodes is slightly changed so they look more similar to
internal nodes.
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:51:23 +0900] rev 34072
py3: fix repr(util.url) to return system string
This is required on Python 3.
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:37:17 +0900] rev 34071
py3: use bytes[n:n + 1] to get bytes in templater._parsetemplate()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:14:53 +0900] rev 34070
py3: fix type of attribute name in smartset.py
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:03:23 +0900] rev 34069
py3: fix mixed bytes/unicode in revsetlang._aliassyminitletters
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:01:23 +0900] rev 34068
py3: fix type of regex literals in subrepo.py
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 16:19:20 +0900] rev 34067
py3: replace bytes[n] with bytes[n:n + 1] in patch.py where needed
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 16:12:15 +0900] rev 34066
py3: fix type of regex literals in patch.py
Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 14:49:00 -0700] rev 34065
revset: optimize "draft() & ::x" pattern
The `draft() & ::x` type query could be common for selecting one or more
draft feature branches being worked on.
Before this patch, `::x` may travel through the changelog DAG for a long
distance until it gets a smaller revision number than `min(draft())`. It
could be very slow on long changelog with distant (in terms of revision
numbers) drafts.
This patch adds a fast path for this situation, and will stop traveling the
changelog DAG once `::x` hits a non-draft revision.
The fast path also works for `secret()` and `not public()`.
To measure the performance difference, I used drawdag to create a repo that
emulates distant drafts:
DRAFT4
|
DRAFT3 # draft
/
PUBLIC9999 # public
|
PUBLIC9998
|
. DRAFT2
. |
. DRAFT1 # draft
| /
PUBLIC0001 # public
And measured the performance using the repo:
(BEFORE)
$ hg perfrevset 'draft() & ::(DRAFT2+DRAFT4)'
! wall 0.017132 comb 0.010000 user 0.010000 sys 0.000000 (best of 156)
$ hg perfrevset 'draft() & ::(all())'
! wall 0.024221 comb 0.030000 user 0.030000 sys 0.000000 (best of 113)
(AFTER)
$ hg perfrevset 'draft() & ::(DRAFT2+DRAFT4)'
! wall 0.000243 comb 0.000000 user 0.000000 sys 0.000000 (best of 9303)
$ hg perfrevset 'draft() & ::(all())'
! wall 0.004319 comb 0.000000 user 0.000000 sys 0.000000 (best of 655)
Differential Revision: https://phab.mercurial-scm.org/D441
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 12:13:17 -0700] rev 34064
phabricator: add a config to use curl for communication
Not sure why, but I got `phabsend` hang on work network pretty frequently.
The traceback indicates it hangs at `_sslobj.do_handshake()`:
File "mercurial/sslutil.py", line 404, in wrapsocket
sslsocket = sslcontext.wrap_socket(sock, server_hostname=serverhostname)
File "/usr/lib/python2.7/ssl.py", line 363, in wrap_socket
_context=self)
File "/usr/lib/python2.7/ssl.py", line 611, in __init__
self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 840, in do_handshake
self._sslobj.do_handshake()
I had tried adding `timeout` in various places but they seem not effective.
It seems easier to just allow shelling out to `curl` with retry and timeout
flags.
This could also be helpful for people with an older Python installed without
modern security (SNI).
Differential Revision: https://phab.mercurial-scm.org/D605
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 18:00:23 -0700] rev 34063
phabricator: standardize colors
Previously, the `--confirm` text could have colors but the main `phabsend`
does not. This patch adjusts the main command so it also has colors.
A default color table was added so the colors are visible by default.
Differential Revision: https://phab.mercurial-scm.org/D515
Kyle Lippincott <spectral@google.com> [Fri, 01 Sep 2017 14:00:13 -0700] rev 34062
wireproto: do not abort after successful lookup
As far as I can tell, this interface originally used 'return' here, so the
"fallthrough" to self._abort made sense. When it was switched to 'yield' this
didn't make sense, but doesn't impact most uses because the 'plain' wrapper in
peer.py's 'batchable' decorator only attempts to yield two items (args and
value).
When using iterbatch, however, it attempts to verify that the @batchable
generators only emit 2 results, by expecting a StopIteration when attempting to
access a third.
Differential Revision: https://phab.mercurial-scm.org/D608
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 16:44:30 -0700] rev 34061
check-code: forbid "\S" in egrep regular expression
BSD `egrep` does not like it. So let's forbid it.
Differential Revision: https://phab.mercurial-scm.org/D610
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 15:47:32 -0700] rev 34060
check-code: forbid using bash in shebang
Some platforms (ex. FreeBSD) do not have `bash` by default. Therefore it
should not be used in test scripts.
Differential Revision: https://phab.mercurial-scm.org/D609
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:34 -0700] rev 34059
amend: add tests for amending only some files from commit to be amended
We do not have robust enough tests for scenarios where only some files in a
changeset are amended. This presents an interesting scenario because the
working copy could have modified versions of the remaining files in the
pre-amend changeset. Therefore, I have added some tests to ensure that amend
behaves as expected in these scenarios.
Test Plan:
Ensured that the test "test-commit-amend.t" passes.
Differential Revision: https://phab.mercurial-scm.org/D596
Yuya Nishihara <yuya@tcha.org> [Sat, 02 Sep 2017 21:49:45 +0900] rev 34058
test-editor-filename: fix portability of fake editor command
- /bin/bash doesn't exist on FreeBSD
- edit is executed by cmd.exe on Windows
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:36 -0700] rev 34057
amend: moving first assignment of newid closer to its use
newid was needlessly further away from where its intended to be used
leading to bad readability. This commit moves it to address the same. The end
goal is to remove the redundant commit in the amend code path and this commit
takes care of cleaning up some unrelated code before that change.
Test Plan:
ran the test suite
Differential Revision: https://phab.mercurial-scm.org/D597
Saurabh Singh <singhsrb@fb.com> [Thu, 31 Aug 2017 18:35:39 -0700] rev 34056
amend: rectify comment
Comment was ambiguous as there can be two parents of a changeset in mercurial.
This commit fixes the comment to clarify that the first parent is being
considered.
Test Plan:
ran the test suite
Differential Revision: https://phab.mercurial-scm.org/D595
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 15:08:54 -0700] rev 34055
amend: removing redundant if condition
There is needless checking for the new commit hash not being equal to
the old commit hash. This condition will always be true at this point in the
code path and thus, can be removed safely. This commit removes the redundant
condition.
Test Plan:
ran the test suite.
Differential Revision: https://phab.mercurial-scm.org/D594
Michael Bolin <mbolin@fb.com> [Fri, 01 Sep 2017 20:28:26 +0000] rev 34054
editor: file created for diff action should have .diff suffix
This is a follow-up to https://phab.mercurial-scm.org/D464 (
6e6452bc441d) that
introduced the new file extension behavior. It erroneously changed `.diff` to
`.diff.hg.txt`.
Test Plan:
Verified `make tests` passes, particularly `test-editor-filename.t`.
Differential Revision: https://phab.mercurial-scm.org/D607
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 11:13:55 -0700] rev 34053
test-amend: match output using conditional test case name
D466 (
6cc8f848b4c3) allows output to be conditionally matched by test name.
This patch changes test-amend.t to use that feature, instead of duplicating
`hg amend` command or use `-q` to silence its output.
Differential Revision: https://phab.mercurial-scm.org/D601
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 31 Aug 2017 19:40:15 -0700] rev 34052
util: use set for reserved Windows filenames
Previously, we were performing membership testing against a
list. Change it to a set for a minor perf win. While we're at it,
explode the assignment in place so less work is needed at module
import time.
Differential Revision: https://phab.mercurial-scm.org/D600
Phil Cohen <phillco@fb.com> [Fri, 01 Sep 2017 11:52:20 -0700] rev 34051
context: add arbitraryfilectx, which can represent files outside the workdir
Move it from contrib/simplemerge so it can be re-used in the future.
Differential Revision: https://phab.mercurial-scm.org/D604
Phil Cohen <phillco@fb.com> [Fri, 01 Sep 2017 10:35:43 -0700] rev 34050
simplemerge: remove unused `filtereddata` parameter
Differential Revision: https://phab.mercurial-scm.org/D603
Phil Cohen <phillco@fb.com> [Fri, 01 Sep 2017 10:35:43 -0700] rev 34049
simplemerge: remove unused `repo` parameter
This is now no longer used or needed thanks to the `decodeddata()` context
function.
Differential Revision: https://phab.mercurial-scm.org/D602
Christophe de Vienne <christophe@cdevienne.info> [Tue, 29 Aug 2017 18:24:51 +0200] rev 34048
extensions: prohibit unicode defaults
If the default value of an option is a unicode string (something
than happen easily when using a 'from __future__ import unicode_literals'),
any value passed on the command line will be ignored because the fancyopts
module only checks for byte strings and not unicode strings.
Changing fancyopts behavior is easy but would make assumptions on how
the python3 port should be done, which is outside the scope of this patch.
The chosen approach is to stop an extension from being loaded when a unicode
default value is detected, with a hint for the developer.
Yuya Nishihara <yuya@tcha.org> [Sat, 19 Aug 2017 22:04:03 +0900] rev 34047
revsetlang: remove unused functions
Superseded by the _match() function.
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:40:59 +0900] rev 34046
revsetlang: match tree by helper function on optimize
This should make optimize() more readable and less error-prone, but it doubles
the parsing cost.
(original)
$ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \
'L.optimize(L.analyze(L.parse("ancestors(x) and not ancestors(y)")))'
10000 loops, best of 3: 79.3 usec per loop
(this patch)
$ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \
'L._treecache.clear(); \
L.optimize(L.analyze(L.parse("ancestors(x) and not ancestors(y)")))'
10000 loops, best of 3: 201 usec per loop
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:31:09 +0900] rev 34045
parser: add helper function to test if pattern matches parsed tree
This function will be used as follows:
match('ancestors(_) and not ancestors(_)', x)
See the next patch for details.
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:38:25 +0900] rev 34044
revsetlang: build optimized tree by helper function
This should make optimize() more readable, but it doubles the parsing cost.
(original)
$ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \
'L.optimize(L.analyze(L.parse("::tip")))'
10000 loops, best of 3: 18.1 usec per loop
(this patch)
$ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \
'L._treecache.clear(); L.optimize(L.analyze(L.parse("::tip")))'
10000 loops, best of 3: 48.4 usec per loop
30usec isn't dominant compared to the revset evaluation, but that is a cost.
That's why a parsed tree is cached, which can benefit in hgweb or chg server.
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:30:04 +0900] rev 34043
parser: add helper function that constructs parsed tree from template
This function will be used as follows:
build('only(_, _)', x, y)
See the next patch for details.
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Aug 2017 18:19:14 +0530] rev 34042
patch: take messages out of the function so that extensions can add entries
Extensions will want to have interactive thing for more operations or
particulary want to show more verbs. So this patch takes out the message thing
from the function so that extensions can add verbs to this. The curses one is
also not in any function so extensions can add more actions and verbs there.
Differential Revision: https://phab.mercurial-scm.org/D567
Jun Wu <quark@fb.com> [Wed, 02 Aug 2017 21:24:29 -0700] rev 34041
run-tests: allow bisecting a different repo
Add `--bisect-repo` flag which accepts a different repo to bisect.
3rd party extensions may reuse `run-tests.py` from core to run tests. Test
failure could be caused by either a core hg change or the 3rd party
extension code itself. Having a way to specify which repo to bisect is
useful.
Differential Revision: https://phab.mercurial-scm.org/D578
Jun Wu <quark@fb.com> [Wed, 02 Aug 2017 21:01:38 -0700] rev 34040
run-tests: extract prefix of bisect commands to a variable
This does not change any logic.
Differential Revision: https://phab.mercurial-scm.org/D577
Jun Wu <quark@fb.com> [Wed, 02 Aug 2017 21:01:38 -0700] rev 34039
run-tests: pass --with-hg to run-tests.py command used by bisect
This makes `run-tests.py -l test-run-tests.t` 23 seconds faster on my
laptop. Inside the test, `$ rt --known-good-rev=0 test-bisect.t` took 24.9
seconds before, and 1.2 seconds after.
Differential Revision: https://phab.mercurial-scm.org/D576
Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 13:43:25 -0700] rev 34038
import-checker: allow relative import a module being checked
This would make the checker more friendly for 3rd-party code. For example,
In remotefilelog/x.py, it may have:
from . import shallowutils
That could trigger "relative import of stdlib module" if
"remotefilelog" was installed in the system. If the module being checked
conflicts with the system module, it makes sense to not treat that module as
system module. This patch makes it so.
Differential Revision: https://phab.mercurial-scm.org/D552