Martin von Zweigbergk <martinvonz@google.com> [Tue, 13 Feb 2018 13:23:18 -0800] rev 36174
treemanifest: add an optimized __nonzero__()
We use bool(manifest) in at least some places:
localrepo.py:1730
hgweb/webcommands.py:524
Since the treemanifest class doesn't define __nonzero__() (before this
patch), bool(manifest) will instead call __len__(), which can be slow
for treemanifests. This patch may make a noticeable difference in the
localrepo case above, but that only happens when committing a merge
and I haven't timed it.
Note that Durham already added a __nonzero__ implementation to
manifestdict in
b19291e5d506 (manifest: add __nonzero__ method,
2016-11-03).
Differential Revision: https://phab.mercurial-scm.org/D2232
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 18:49:06 -0500] rev 36173
tests: port fakemergerecord to python3
Differential Revision: https://phab.mercurial-scm.org/D2248
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 18:48:47 -0500] rev 36172
tests: add some b-prefixes on local script in test-histedit-arguments
# skip-blame its just more b prefixes and a file in binary mode
Differential Revision: https://phab.mercurial-scm.org/D2247
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 18:47:55 -0500] rev 36171
tests: add bytes prefixes to test-histedit-fold.t's local extension
# skip-blame b prefixes
Differential Revision: https://phab.mercurial-scm.org/D2246
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 18:25:05 -0500] rev 36170
histedit: fix silly bug that was unpacking a bytestr before writing it
I have this foggy notion that popbuffer() might have returned a list
in the past, but it doesn't anymore, and this was breaking on Python
3. As a bonus, it's probably a ton faster on Python 2 now.
Differential Revision: https://phab.mercurial-scm.org/D2243
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 18:13:33 -0500] rev 36169
py3: whitelist another 8 passing tests
Differential Revision: https://phab.mercurial-scm.org/D2242
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 17:25:43 -0500] rev 36168
histedit: modernize write of histedit-last-edit file
Differential Revision: https://phab.mercurial-scm.org/D2241
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 17:25:25 -0500] rev 36167
histedit: convert bool to bytestring manually
Yes, this format has 'True' and 'False' in it. I'm sorry, as it's
almost certainly my fault.
Differential Revision: https://phab.mercurial-scm.org/D2240
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 13:38:38 -0500] rev 36166
narrowcommands: more byteskwargs cleanup
Differential Revision: https://phab.mercurial-scm.org/D2239
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 13:37:43 -0500] rev 36165
narrowmerge: iterate over a copy of dict items so we can mutate the dict
Differential Revision: https://phab.mercurial-scm.org/D2238
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 18:00:59 -0500] rev 36164
contrib: ban $RANDOM using check-code
Differential Revision: https://phab.mercurial-scm.org/D2237
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 17:58:40 -0500] rev 36163
tests: remove use of bashism $RANDOM to fix test-narrow.t on non-bash shells
This test passed on our workstations, including on Macs, so we never
noticed, but it fails on both the Linux and FreeBSD buildbots. Today I
learned about a bash feature, wherein $RANDOM gives a random int every
time you read it.
check-code rule to follow.
Differential Revision: https://phab.mercurial-scm.org/D2236
Sandu Turcan <idlsoft@gmail.com> [Tue, 13 Feb 2018 14:39:02 -0500] rev 36162
narrow: fix for getting the username when running http server
Differential Revision: https://phab.mercurial-scm.org/D2231
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 16:22:31 -0800] rev 36161
tests: remove code to support Mercurial 4.3
Now that narrow lives in core, we don't need the legacy support.
Differential Revision: https://phab.mercurial-scm.org/D2202
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 16:21:34 -0800] rev 36160
narrowspec: move module into core
Having support for parsing the narrow specification in core is
necessary for moving many other parts of narrow to core.
We do still want to harmonize the narrow spec with the sparse
spec. And the format needs to be documented. But this shouldn't
hold up the code moving to core.
Differential Revision: https://phab.mercurial-scm.org/D2201
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 16:15:34 -0800] rev 36159
hg: move share._getsrcrepo into core
The fact we were calling this from extensions was a sign that it
should live in core.
We were also able to remove some extra attribute aliases from the
share extension.
Differential Revision: https://phab.mercurial-scm.org/D2200
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 15:49:15 -0800] rev 36158
tests: glob over line number
Differential Revision: https://phab.mercurial-scm.org/D2199
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 12 Feb 2018 15:39:47 -0800] rev 36157
tests: remove references to bundle2-exp config option
This option was deleted a while ago. We don't even alias it in
core.
Differential Revision: https://phab.mercurial-scm.org/D2198
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 11:12:36 -0500] rev 36156
py3: whitelist another six passing tests
Differential Revision: https://phab.mercurial-scm.org/D2230
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 10:54:58 -0500] rev 36155
narrowrepo: filter() is a generator on py3, wrap in list()
Was at the top of Python 3 exceptions.
Differential Revision: https://phab.mercurial-scm.org/D2229
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 10:39:31 -0500] rev 36154
narrowcommands: use pycompat.{bytes,str}kwargs
Differential Revision: https://phab.mercurial-scm.org/D2228
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 10:38:02 -0500] rev 36153
debugcommands: mergestate version is an int, use %d on it
Differential Revision: https://phab.mercurial-scm.org/D2227
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 10:20:57 -0500] rev 36152
progress: use %d to format ints instead of %s
Due to behavioral changes between '% Ns' and '% Nd' this has some
unfortunate extra dancing. I'm not sure of a better way to solve this
problem.
Differential Revision: https://phab.mercurial-scm.org/D2226
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 08:43:14 -0500] rev 36151
progress: determine padding width portably
Differential Revision: https://phab.mercurial-scm.org/D2225
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 08:41:42 -0500] rev 36150
branchmap: wrap builtin exception in bytes for logging
Differential Revision: https://phab.mercurial-scm.org/D2224
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 15:11:13 +0530] rev 36149
remotenames: add three new revsets related to remotenames
This patch adds three new revsets 'remotenames', 'remotebookmarks' and
'remotebranches' which will return changesets which have remotenames,
remotebookmarks and remotebranches on them respectively.
The remotenames revset exist in hgremotenames extension and is moved from there
whereas rest of the two revsets are introduced in this patch.
hgremotenames: https://bitbucket.org/seanfarley/hgremotenames
Differential Revision: https://phab.mercurial-scm.org/D2002
Yuya Nishihara <yuya@tcha.org> [Tue, 13 Feb 2018 21:52:51 +0900] rev 36148
convert: fix line ending of mapfile and commit.desc file
Follows up
42a393ea56d2. CRLF vs LF doesn't really matter as we do strip()
or rstrip() on read, but mixing them isn't nice. So let's restore the old
behavior.
I don't know whether CVS/Root, CVS/Repository, and ~/.cvspass are written
in native line ending, so I leave them read as binary files.
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 18:34:22 -0800] rev 36147
py3: port string formatting
`skipped` is a set of integer revs here. So cast integers to
strings using %d.
None doesn't cast to an empty string on Python 3. So use '' explicitly.
Differential Revision: https://phab.mercurial-scm.org/D2146
Augie Fackler <augie@google.com> [Thu, 25 Jan 2018 21:16:28 -0500] rev 36146
bdiff: write a native version of splitnewlines
./hg perfunidiff mercurial/manifest.py 0 --count 500 --profile before:
! wall 0.309280 comb 0.350000 user 0.290000 sys 0.060000 (best of 32)
./hg perfunidiff mercurial/manifest.py 0 --count 500 --profile after:
! wall 0.241572 comb 0.260000 user 0.240000 sys 0.020000 (best of 39)
so it's about 20% faster. I hate Python. I wish we could usefully
write this in Rust, but it doesn't look like that's realistic without
using the cpython crate, which I'd still like to avoid.
Differential Revision: https://phab.mercurial-scm.org/D1973
Boris Feld <boris.feld@octobus.net> [Mon, 12 Feb 2018 16:09:31 +0100] rev 36145
label: enforce the lack of leading or trailing white space
In practice, all commands create label are currently striping external white
space. Let us enforce this logic at a lower level before starting to rely on
it elsewhere.
Antonio Muci <a.mux@inwind.it> [Tue, 13 Feb 2018 00:05:45 +0100] rev 36144
buildrpm: bump bundled docutils version to 0.14 when building for centos{5,6}
when building rpm packages for centos 5 and 6, we bundle a mercurial-specific
version of docutils in /opt/python-hg/lib/python2.7/site-packages/docutils
Let's bump the embedded docutils version from 0.12 (released in 2014) to
0.14 (latest as of today)
Antonio Muci <a.mux@inwind.it> [Mon, 12 Feb 2018 23:59:36 +0100] rev 36143
buildrpm: bump bundled python version to 2.7.14 when building for centos{5,6}
when building rpm packages for centos 5 and 6, we bundle a mercurial-specific
version of python 2.7 in /opt/python-hg
Let's bump the embedded python version from 2.7.10 (released in 2015) to
2.7.14 (latest as of today)
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Feb 2018 13:25:56 -0500] rev 36142
merge: invoke scmutil.fileprefetchhooks() prior to applying updates
This moves the file list calculation into core, so other extensions don't need
to duplicate it.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Feb 2018 00:40:27 -0500] rev 36141
revert: drop the remnant of the prefetchfiles hook
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Feb 2018 00:51:22 -0500] rev 36140
cat: migrate to the fileprefetch callback mechanism
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Feb 2018 00:49:43 -0500] rev 36139
archive: migrate to the fileprefetch callback mechanism
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Feb 2018 00:30:15 -0500] rev 36138
lfs: migrate to the fileprefetch callback mechanism
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Feb 2018 00:23:57 -0500] rev 36137
cmdutil: convert the prefetchfiles() hook to a callback mechanism (API)
Yuya suggested a list of callbacks instead of function wrapping. This means
that one extension can't block another from processing the list.
.. api::
File prefetching is now handled by registering a callback with
scmutil.fileprefetchhooks.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 13 Feb 2018 00:54:36 -0500] rev 36136
test-narrow: partially stabilize on Windows
test-narrow-strip.t is still broken. I don't see any feature condititionals, so
it might be an actual problem.
Augie Fackler <augie@google.com> [Tue, 13 Feb 2018 00:06:22 -0500] rev 36135
py3: whitelist test-convert-clonebranches.t
Differential Revision: https://phab.mercurial-scm.org/D2223
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 23:51:37 -0500] rev 36134
convert: make hg sha1 regex consistently be a bytes
Differential Revision: https://phab.mercurial-scm.org/D2222
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 23:51:18 -0500] rev 36133
convcmd: pass encoding name as a sysstr
Differential Revision: https://phab.mercurial-scm.org/D2221
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 23:50:58 -0500] rev 36132
convert: open all files in binary mode
Differential Revision: https://phab.mercurial-scm.org/D2220
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 22:29:36 -0500] rev 36131
py3: whitelist another 11 passing tests
Differential Revision: https://phab.mercurial-scm.org/D2213
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 20:44:06 -0500] rev 36130
util: convert traceback-related sysstrs to sysbytes in getstackframes
With this change, test-devel-warnings.t passes except for differences
in how ProgrammingError is formatted and one mysterious traceback
inside of transaction.__del__.
Differential Revision: https://phab.mercurial-scm.org/D2212
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 20:43:33 -0500] rev 36129
util: format line number of stack trace using %d
Required on Python 3, functional on Python 2.
Differential Revision: https://phab.mercurial-scm.org/D2211
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 20:43:05 -0500] rev 36128
util: call warnings.warn() with a sysstr in nouideprecwarn
This preserves nouideprecwarn wanting a bytes, which is consistent
with the rest of hg.
Differential Revision: https://phab.mercurial-scm.org/D2210
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 20:42:28 -0500] rev 36127
ui: convert stack traces to sysbytes before logging
They're coming back as unicodes, so sysbytes seems like the best we can do.
This is like D2171 and D2172, but those fail on Python 2.7.5
(seriously!), so this is my version of the same change. I actually
wrote this before reviewing those, then discarded it, then came back
to it after finding out 2.7.5 is a silly place.
Differential Revision: https://phab.mercurial-scm.org/D2209
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 20:41:47 -0500] rev 36126
ui: use pycompat.bytestr() to get a bytes-repr of config default
We don't know what type we'll get here, so we need something that'll
behave like a repr without returning a unicode.
Differential Revision: https://phab.mercurial-scm.org/D2208
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 20:39:48 -0500] rev 36125
tests: add tons of b prefixes in test-devel-warnings.t
# skip-blame because it's just b prefixes
Differential Revision: https://phab.mercurial-scm.org/D2207
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 19:43:43 -0800] rev 36124
py3: convert traceback representation to bytes when logging
Python's APIs should return a system string. We want to use bytes
for logging. So convert the traceback to bytes before sending
it to the logger.
Differential Revision: https://phab.mercurial-scm.org/D2176
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 19:26:53 -0800] rev 36123
py3: convert context to bytes instead of str
This yields identical behavior on Python 2 and 3.
Differential Revision: https://phab.mercurial-scm.org/D2174
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 19:24:27 -0800] rev 36122
py3: add missing b'' literal to sshprotoext.py
Everywhere else in this file uses b''. I must have missed a line
when I wrote this code a few days ago.
# skip-blame b prefix
Differential Revision: https://phab.mercurial-scm.org/D2173
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 19:11:17 -0800] rev 36121
py3: make dummyssh compatible with Python 3
Required encoding a str to bytes and writing bytes to a file
descriptor.
Differential Revision: https://phab.mercurial-scm.org/D2170
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 18:58:45 -0800] rev 36120
mail: import email.utils not email.Utils
email.Utils was renamed to email.utils in Python 2.5. But it appears
at some point before Python 2.7 (possibly 2.5) email.Utils was aliased
to the new home. So email.utils should be safe for all versions of
Python we support.
Differential Revision: https://phab.mercurial-scm.org/D2168
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 18:50:24 -0800] rev 36119
py3: cast character set to bytes
The returned value from this function is eventually fed into
email.charset.Charset.__init__. However, the standard library
appears to handle both string types in Python 2 and 3. So there
shouldn't be any problem returning a bytes here.
Differential Revision: https://phab.mercurial-scm.org/D2167
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 18:47:19 -0800] rev 36118
py3: cast decode() argument to system string
The actual types here may be mixed due to string literals
and variables from other modules. So a cast is necessary.
Differential Revision: https://phab.mercurial-scm.org/D2166
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:56:29 -0800] rev 36117
py3: avoid changing dictionary during iteration
dict.items() and friends are iterators/views in Python 3. You
aren't allowed to mutate the underlying dictionary when iterating
on these views. So iterate over a copy of things.
Differential Revision: https://phab.mercurial-scm.org/D2164
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:54:56 -0800] rev 36116
py3: use raw string for key in **kwargs
Otherwise Python 3 is unhappy. We only set a single key here.
So I don't think pycompat.strkwargs() is necessary.
Differential Revision: https://phab.mercurial-scm.org/D2163
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:50:45 -0800] rev 36115
py3: preserve chunks as an iterable of bytes
patch.diffstat() returns a bytes. util.chunkbuffer() expects an
iterable of bytes. Feeding it a single bytes instance on Python 3
will iterate the characters as integers. This blows up
util.chunkbuffer.
Differential Revision: https://phab.mercurial-scm.org/D2162
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:40:02 -0800] rev 36114
py3: use b'' for changegroup version literals
Test extensions aren't currently loaded with our custom module
importer.
# skip-blame b prefix
Differential Revision: https://phab.mercurial-scm.org/D2161
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:30:44 -0800] rev 36113
py3: use b'' in inline extension
# skip-blame b prefix
Differential Revision: https://phab.mercurial-scm.org/D2160
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:29:35 -0800] rev 36112
py3: use hex(hasher.digest())
.hexdigest() returns a system str. .digest() consistently returns
bytes.
Differential Revision: https://phab.mercurial-scm.org/D2159
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:21:30 -0800] rev 36111
py3: use string for "close" value in commit extras
The extras dict on commits has string keys and values. Before this
commit, we passed "close" as an integer, which Python 2 gladly
coerced to a string during a %s formatting in the bowels of
changelog.py.
Differential Revision: https://phab.mercurial-scm.org/D2157
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:16:43 -0800] rev 36110
py3: catch TypeError during template operations
Two places in this code Python 3 changed from raising ValueError
to TypeError. So catch the addition exceptions.
IMO this code might be better off performing type sniffing. But
I'm not sure the implications of changing that.
Differential Revision: https://phab.mercurial-scm.org/D2156
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:08:11 -0800] rev 36109
py3: use bytes literals for test extension
These extensions don't get run through our custom module importer.
It's easy enough to make them dual compatible with Python 2 and 3.
# skip-blame b prefixes
Differential Revision: https://phab.mercurial-scm.org/D2155
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 16:02:32 -0800] rev 36108
py3: use system strings when calling __import__
We must pass the native str type when importing.
Differential Revision: https://phab.mercurial-scm.org/D2154
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 15:58:31 -0800] rev 36107
py3: open patches.queue in binary mode
And switch to using the context manager form of open() while we're
here.
Differential Revision: https://phab.mercurial-scm.org/D2153
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 15:55:47 -0800] rev 36106
py3: compare against bytes instead of str
Differential Revision: https://phab.mercurial-scm.org/D2152
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 19:39:15 -0800] rev 36105
py3: use b'' in mockblackbox.py
This unmasks a ton of other TypeError in blackbox code.
# skip-blame since it's just a b prefix
Differential Revision: https://phab.mercurial-scm.org/D2175
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 15:08:15 -0500] rev 36104
narrow: add a TODO document
These are things that are bigger than we want to handle right now, but
are pretty important to get narrowing to be non-experimental.
Differential Revision: https://phab.mercurial-scm.org/D2196
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 15:00:18 -0500] rev 36103
tests: use `hello` not `capabilities` over ssh
Differential Revision: https://phab.mercurial-scm.org/D2195
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:58:32 -0500] rev 36102
narrowwirepeer: add TODO about how we add wireproto args to unbundle :(
Differential Revision: https://phab.mercurial-scm.org/D2194
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:49:38 -0500] rev 36101
narrowwirepeer: rename expandnarrow capability to exp-expandnarrow
The expandnarrow functionality lets a client have a shorthand (for
Google it's a reference to a checked-in file) for a set of includes
and excludes. For testing we should probably implement a simple
version of that functionality here. For now, rename the capability so
we don't burn the good name in the future if we need to change
behavior.
It's plausible that this functionality should be dropped from the
narrowhg we ship long-term, but I'm dubious as it seems pretty likely
other organizations will want similar shorthands for commonly-used
subsets of their trees.
Differential Revision: https://phab.mercurial-scm.org/D2193
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:42:47 -0500] rev 36100
narrow: make restrictpatterns a little more idiomatic
I'm not sure why invalid_includes was an out-param, but it doesn't
look like there's any reason for it to be now.
Differential Revision: https://phab.mercurial-scm.org/D2192
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:37:10 -0500] rev 36099
narrowspec: consistently use set() to copy sets
Differential Revision: https://phab.mercurial-scm.org/D2191
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:27:32 -0500] rev 36098
narrowspec: document constraints when validating patterns
Differential Revision: https://phab.mercurial-scm.org/D2190
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:15:52 -0500] rev 36097
narrowrevlog: add a TODO around remotefilelog moving to core
We should clean this up considerably when remotefilelog lands, which
we expect to try and accomplish in the near-ish future.
Differential Revision: https://phab.mercurial-scm.org/D2189
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:12:28 -0500] rev 36096
narrowrevlog: add what little I can remember about rename filtering
Differential Revision: https://phab.mercurial-scm.org/D2188
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:01:44 -0500] rev 36095
manifest: clean up dirlog() to take a d parameter to avoid shadowing dir()
Differential Revision: https://phab.mercurial-scm.org/D2187
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 14:00:02 -0500] rev 36094
narrowrevlog: replace AssertionError with ProgrammingError
Differential Revision: https://phab.mercurial-scm.org/D2186
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 13:54:41 -0500] rev 36093
narrowrevlog: document excludeddir class and friends
Differential Revision: https://phab.mercurial-scm.org/D2185
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 13:51:29 -0500] rev 36092
narrowrepo: add docstring for narrowpats
Differential Revision: https://phab.mercurial-scm.org/D2184
Augie Fackler <augie@google.com> [Fri, 02 Feb 2018 10:51:47 -0500] rev 36091
narrowtemplates: update to use registrar mechanism
It's worth considering at this point if we should just move the two
ellipsis functions to core tagged experimental or something, since
they're not really narrowing-specific...
Differential Revision: https://phab.mercurial-scm.org/D2009
Augie Fackler <augie@google.com> [Fri, 02 Feb 2018 10:37:29 -0500] rev 36090
narrow: move from ELLIPSIS_NODE_FLAG to revlog.REVIDX_ELLIPSIS
We should have been using this value all along. Sigh.
Differential Revision: https://phab.mercurial-scm.org/D2008
Augie Fackler <augie@google.com> [Fri, 02 Feb 2018 10:28:57 -0500] rev 36089
narrowrepo: make repo requirement include the string 'experimental'
We can just move to "narrow" or similar when we finalize the
format. I'm not sure what the migration process from one requirement
to another should look like, but we're about to cross that bridge at
Google once this change lands, so hopefully we'll know soon.
Differential Revision: https://phab.mercurial-scm.org/D2007
Augie Fackler <augie@google.com> [Fri, 02 Feb 2018 10:27:08 -0500] rev 36088
narrow: mark requirement as a constant
Differential Revision: https://phab.mercurial-scm.org/D2006
Augie Fackler <augie@google.com> [Fri, 02 Feb 2018 10:23:23 -0500] rev 36087
narrowbundle2: mark most constants as module-private
This became obvious when preparing the previous change, so there's no
reason to not just do it now while it's easy.
Differential Revision: https://phab.mercurial-scm.org/D2005
Augie Fackler <augie@google.com> [Fri, 02 Feb 2018 10:18:11 -0500] rev 36086
narrowbundle2: make constants ALLCAPS to be a bit more readable
Differential Revision: https://phab.mercurial-scm.org/D2004
Augie Fackler <augie@google.com> [Thu, 01 Feb 2018 18:02:32 -0500] rev 36085
narrow: remove old version-checking logic and declare internal
Differential Revision: https://phab.mercurial-scm.org/D1980
Augie Fackler <augie@google.com> [Thu, 01 Feb 2018 17:19:41 -0500] rev 36084
tests: fold narrow treemanifest tests into main test file using testcases
These tests predate the testcases functionality in run-tests.py, so it
was never done in narrowhg.
Differential Revision: https://phab.mercurial-scm.org/D1979
Augie Fackler <augie@google.com> [Mon, 29 Jan 2018 18:16:23 -0500] rev 36083
narrow: assume addflagprocessor will always exist on revlog module
Differential Revision: https://phab.mercurial-scm.org/D1978
Augie Fackler <augie@google.com> [Mon, 29 Jan 2018 18:13:56 -0500] rev 36082
narrow: this code should assume REVIDX_FLAGS_ORDER exists
Differential Revision: https://phab.mercurial-scm.org/D1977
Augie Fackler <augie@google.com> [Mon, 29 Jan 2018 18:12:17 -0500] rev 36081
narrow: drop legacy support for getsubsetraw
Differential Revision: https://phab.mercurial-scm.org/D1976
Augie Fackler <augie@google.com> [Mon, 29 Jan 2018 18:08:56 -0500] rev 36080
narrow: remove support for old match modules
Differential Revision: https://phab.mercurial-scm.org/D1975
Augie Fackler <augie@google.com> [Mon, 29 Jan 2018 16:19:33 -0500] rev 36079
narrow: import experimental extension from narrowhg revision
cb51d673e9c5
Adjustments:
* renamed src to hgext/narrow
* marked extension experimental
* added correct copyright header where it was missing
* updated hgrc extension enable line in library.sh
* renamed library.sh to narrow-library.sh
* dropped all files from repo root as they're not interesting
* dropped test-pyflakes.t, test-check-code.t and test-check-py3-compat.t
* renamed remaining tests to all be test-narrow-* when they didn't already
* fixed test-narrow-expanddirstate.t to refer to narrow and not narrowhg
* fixed tests that wanted `update -C .` instead of `merge --abort`
* corrected a two-space indent in narrowspec.py
* added a missing _() in narrowcommands.py
* fixed imports to pass the import checker
* narrow only adds its --include and --exclude to clone if sparse isn't
enabled to avoid breaking test-duplicateoptions.py. This is a kludge,
and we'll need to come up with a better solution in the future.
These were more or less the minimum to import something that would
pass tests and not create a bunch of files we'll never use.
Changes I intend to make as followups:
* rework the test-narrow-*-tree.t tests to use the new testcases
functionality in run-tests.py
* remove lots of monkeypatches of core things
Differential Revision: https://phab.mercurial-scm.org/D1974
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 16:51:30 -0500] rev 36078
python3: whitelist another four passing tests
Differential Revision: https://phab.mercurial-scm.org/D2197
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 06 Feb 2018 18:13:15 -0800] rev 36077
wireprotoserver: define and use parse_qs from urllib
The cgi module is deprecated since Python 2.6. Let's replace uses
of it in wireprotoserver with a similar function from urllib.
Differential Revision: https://phab.mercurial-scm.org/D2094
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 17:18:27 -0800] rev 36076
tests: add tests for sending recognized command before handshake
Rounding out our test coverage for the SSH server.
Differential Revision: https://phab.mercurial-scm.org/D2093
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:37:51 -0800] rev 36075
wireprotoserver: add version to SSH protocol names (API)
We recently introduced version 2 of the SSH protocol. Like we
did for the peer, we will need to differentiate version 1 and 2
of the server. So, we add version components to the advertised
name of the protocol handler.
Nothing in core looks for the old value. But an extension may.
.. api::
SSH protocol handler now advertises its name internally as
"ssh-v1" instead of "ssh."
Differential Revision: https://phab.mercurial-scm.org/D2092
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:27:36 -0800] rev 36074
wireproto: introduce type for raw byte responses (API)
Right now we simply return a str/bytes instance for simple
responses. I want all wire protocol response types to be strongly
typed. So let's invent and use a type for raw bytes responses.
.. api::
Wire protocol command handlers now return a
wireprototypes.bytesresponse instead of a raw bytes instance.
Protocol handlers will continue handling bytes instances. However,
any extensions wrapping wire protocol commands will need to handle
the new type.
Differential Revision: https://phab.mercurial-scm.org/D2089
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 16:29:05 -0800] rev 36073
wireprototypes: move wire protocol response types to new module
We'll be introducing more types as part of wire protocol version 2.
These types are shared between the command handling code (in
wireproto.py) and the protocol/transport code in wireprotoserver.py.
So they need to go in a new module to prevent a cycle.
The types are aliased into the wireproto module, so API compatibility
is preserved.
Differential Revision: https://phab.mercurial-scm.org/D2088
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 01 Feb 2018 16:59:18 -0800] rev 36072
wireprotoserver: move responsetype() out of http handler
This is our last public attribute not part of the protocol
interface!
Differential Revision: https://phab.mercurial-scm.org/D2087
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:22:44 -0800] rev 36071
wireproto: remove unused proto argument from supportedcompengines (API)
In theory, the protocol should be passed to this function. But the
argument isn't being used and it is getting in the way of refactoring.
So let's remove it. We can always add it back later if we need it
again.
Differential Revision: https://phab.mercurial-scm.org/D2086
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 01 Feb 2018 17:12:07 -0800] rev 36070
wireprotoserver: rename getfile() to forwardpayload() (API)
"file" can mean a lot of things. Let's rename the interface
method to something more descriptive.
While I was here, I moved the docs about the payload format to
the implementation of the SSH protocol, because it was lying
about what the HTTP payload looked like.
Differential Revision: https://phab.mercurial-scm.org/D2085
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:24:22 -0800] rev 36069
wireprotoserver: rename _client to client (API)
This method is called in wireproto.py. It should be part of the public
API/interface.
.. api::
The ``_client()`` method of the wire protocol handler interface has
been renamed to ``client()``.
Differential Revision: https://phab.mercurial-scm.org/D2084
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:20:11 -0800] rev 36068
wireprotoserver: remove redirect() and restore() (API)
These methods on the protocol handler interface are no longer used in
core.
.. api::
redirect() and restore() have been removed from the wire protocol
handler interface. Use mayberedirectstdio() instead.
Differential Revision: https://phab.mercurial-scm.org/D2083
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:19:06 -0800] rev 36067
wireproto: use maybecapturestdio() for push responses (API)
The "pushres" and "pusherr" response types currently call
proto.restore() in the HTTP protocol. This completes the pairing
with proto.redirect() that occurs in the @wireprotocommand
functions. (But since the SSH protocol has a no-op redirect(),
it doesn't bother calling restore() because it would also be
a no-op.)
Having the disconnect between these paired calls is very confusing.
Knowing that you must use proto.redirect() if returning a "pushres"
or a "pusherr" is even wonkier.
We replace this confusing code with our new context manager for
[maybe] capturing output.
The "pushres" and "pusherr" types have gained an "output" argument
to their constructor and an attribute to hold captured data. The
HTTP protocol now retrieves output from these objects.
.. api::
``wireproto.pushres`` and ``wireproto.pusherr`` now explicitly
track stdio output.
Differential Revision: https://phab.mercurial-scm.org/D2082
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:17:47 -0800] rev 36066
wireprotoserver: add context manager mechanism for redirecting stdio
Today, proto.redirect() sets up redirecting stdio and proto.restore()
undoes that. The API is a bit wonky because restore() is only
implemented on the HTTP protocol. Furthermore, not all calls to
redirect() are obviously paired with calls to restore(). For
example, the call to restore() for "unbundle" requests is handled
by the response handler for the HTTP protocol.
This commit introduces a new method on the protocol handler interface
to maybe capture stdio. It emits a file object or None depending on
whether stdio capture is used by the transport.
To prove it works, the "pushkey" wire protocol command has been
updated to use the new API.
I'm not convinced this is the best mechanism to capture stdio. I may
need to come up with something better once the new wire protocol
emerges into existence. But it is strictly better than before because
it removes variance in the wire protocol handler interface. It
therefore gets us closer to a unified interface between the SSH and
HTTP transports.
Differential Revision: https://phab.mercurial-scm.org/D2081
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 20:17:05 -0800] rev 36065
wireprotoserver: split ssh protocol handler and server
We want to formalize the interface for protocol handlers. Today,
server functionality (which is domain specific) is interleaved
with protocol handling functionality (which conforms to a generic
interface) in the sshserver class.
This commit splits the ssh protocol handling code out of the
sshserver class.
Differential Revision: https://phab.mercurial-scm.org/D2080
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Feb 2018 21:04:54 -0800] rev 36064
wireprotoserver: extract SSH response handling functions
The lookup/dispatch table was cute. But it isn't needed. Future
refactors will benefit from the handlers for individual response
types living outside the class.
As part of this, I snuck in a change that changes a type compare
from str to bytes. This has no effect on Python 2. But it might
make Python 3 a bit happier.
Differential Revision: https://phab.mercurial-scm.org/D2091
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 15:13:37 +0530] rev 36063
remotenames: introduce new template keywords for remotenames
This patch introduces three new template keywords 'remotenames',
'remotebookmarks', 'remotebranches' to show remotenames, remotebookmarks and
remotebranches associated to a changeset.
This is a part of moving hgremotenames extension to core. The remotenames
template keyword was present in the extension and the rest of the two are not
present in the hgremotenames extension and are introduced in this patch.
hgremotenames: https://bitbucket.org/seanfarley/hgremotenames
Differential Revision: https://phab.mercurial-scm.org/D1759
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 14:24:41 +0530] rev 36062
remotenames: add new namespaces for remotebookmarks and remotebranches
This patch adds two new namespaces which will be enabled by remotenames
extension. The namespaces are remotebookmarks and remotebranches. Adding them
as namespaces will show them in various commands' output such as log, show work.
This will also unable to access changesets using that name.
Tests are also added for the same.
This is a part of moving hgremotenames extension to core.
hgremotenames: https://bitbucket.org/seanfarley/hgremotenames
Differential Revision: https://phab.mercurial-scm.org/D1758
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 17:50:42 +0530] rev 36061
remotenames: introduce a class to lazily resolve remotnames
remotenames may take time to load and in next patch we are going to introduce
namespaces related to them. So let's introduce a class making them load lazily.
This is a part of moving hgremotenames extension to core.
hgremotenames: https://bitbucket.org/seanfarley/hgremotenames
Differential Revision: https://phab.mercurial-scm.org/D1757
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 00:19:09 +0530] rev 36060
remotenames: introduce class to encapsulate remotenames info in an extension
This patch adds a new extension remotenames in which features from hgremotenames
extension (https://bb/seanfarley/hgremotenames) will be added incrementally.
This patch introduces a basic class to encapsulate the remotenames information.
Differential Revision: https://phab.mercurial-scm.org/D1756
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 20:27:41 +0530] rev 36059
logexchange: introduce helper function to get remote path name
This patch moves chunk of activepath function from hgremotenames extension
(https://bitbucket.org/seanfarley/hgremotenames/) to core. Before moving
rest of the part, there needs to be some refactoring done to schemes which
will be done as a separate series.
Differential Revision: https://phab.mercurial-scm.org/D1755
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:36:59 -0500] rev 36058
charencode: adjust clang-format enable/disable comments
We're pretty close to being able to let clang-format manage most of
these files.
Differential Revision: https://phab.mercurial-scm.org/D2180
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:31:17 -0500] rev 36057
diffhelpers: allow clang-format oversight
One trailing comma!
Differential Revision: https://phab.mercurial-scm.org/D2179
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:29:02 -0500] rev 36056
pathencode: allow clang-format oversight
Only had to add two trailing commas to make the file format acceptably!
Differential Revision: https://phab.mercurial-scm.org/D2178
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:21:44 -0500] rev 36055
bdiff: add to clang-format oversight
This file didn't require any complex fixes, so we may as well enable
clang-format while I'm editing it.
Differential Revision: https://phab.mercurial-scm.org/D2177