Jun Wu <quark@fb.com> [Wed, 31 May 2017 11:41:54 -0700] rev 32604
check-code: suggest policy.importmod
This forbids patterns like `from mercurial.cext import parsers` which breaks
pure.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 26 May 2017 03:41:10 +0200] rev 32603
test-obsolete-bundle-strip: test bundling in the seventh case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 26 May 2017 03:23:56 +0200] rev 32602
test-obsolete-bundle-strip: test bundling in the sixth case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 26 May 2017 03:20:40 +0200] rev 32601
test-obsolete-bundle-strip: test bundling in the fifth case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 26 May 2017 03:20:25 +0200] rev 32600
test-obsolete-bundle-strip: test bundling in the fourth case
Updating all cases in the file at the same time is a bit
overwhelming and harder to double check. So each case come in its own patch.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 26 May 2017 03:19:11 +0200] rev 32599
test-obsolete-bundle-strip: test bundling in the third case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 26 May 2017 03:15:53 +0200] rev 32598
test-obsolete-bundle-strip: test bundling in the second case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 26 May 2017 03:11:53 +0200] rev 32597
test-obsolete-bundle-strip: test bundling in the first case
We adds a shell function checking that the relevant markers and the bundled
markers matches. Updating all cases in the file at the same time is a bit
overwhelming and harder to double checks. So each cases come in its own patch.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 16:50:23 +0200] rev 32596
obsolete: raise richer exception on unknown version
We raise a more precise subclass of Abort with details about the faulty
version. This will be used to detect this case and display some information
in debugbundle.
Siddharth Agarwal <sid0@fb.com> [Wed, 31 May 2017 20:07:08 -0700] rev 32595
import-checker: add hgdemandimport to local modules
This fixes test-check-module-imports.t.
Siddharth Agarwal <sid0@fb.com> [Wed, 31 May 2017 19:46:04 -0700] rev 32594
rebase: drop unnecessary parentchange call
We're calling localrepo.setparents here, not dirstate.setparents.
localrepo.setparents calls dirstate.parentchange already.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 30 May 2017 13:16:32 -0700] rev 32593
hidden: remove unnecessary guard condition
The "if visible" guard is now pretty pointless, because the function
call it guards will do almost no work anyway when there are no visible
revisions.
We can also stop wrapping "visible" in a set since it just needs to be
an iterable now.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 30 May 2017 10:27:20 -0700] rev 32592
hidden: subtract pinned revs from hidden earlier
The pinned revs are simply revisions that should not be hidden even if
hideablerevs() says that should. Let's make that clear by simply
setting "hidden = hideablerevs() - pinnedrevs()" early on.
Martin von Zweigbergk <martinvonz@google.com> [Sat, 27 May 2017 23:05:10 -0700] rev 32591
hidden: make _revealancestors() reveal ancestors exclusively
I think this seems more expected. It also prepares for the next
commit.
Martin von Zweigbergk <martinvonz@google.com> [Sat, 27 May 2017 22:55:19 -0700] rev 32590
hidden: remove _consistencyblockers()
Roughly speaking, we currently do this to reveal hidden ancestors of
visible revisions:
1. Iterate over all visible non-public revisions and see if they have
hidden parents
2. For each revision found in step (1) walk the chain of hidden
commits and reveal it
We can simplify that by skipping step (1) and doing step (2) from all
visible non-public revisions instead.
This doesn't seem to have much impact on "perfvolatilesets".
Before:
! obsolete
! wall 0.004616 comb 0.000000 user 0.000000 sys 0.000000 (best of 570)
! visible
! wall 0.008235 comb 0.010000 user 0.010000 sys 0.000000 (best of 326)
After:
! obsolete
! wall 0.004727 comb 0.010000 user 0.010000 sys 0.000000 (best of 543)
! visible
! wall 0.008371 comb 0.000000 user 0.000000 sys 0.000000 (best of 324)
Martin von Zweigbergk <martinvonz@google.com> [Sat, 27 May 2017 22:43:37 -0700] rev 32589
hidden: pass revs to iterate into _consistencyblockers()
Instead of passing the domain into _consistencyblockers() and having
the function calculate the set of revisions to iterate over, let the
caller do it. This is just a minor refactoring to make future changes
simpler.
Martin von Zweigbergk <martinvonz@google.com> [Sat, 27 May 2017 22:10:20 -0700] rev 32588
hidden: remove unnecessary 'domain' parameter from _revealancestors()
The function will stop searching as soon as it runs into a non-hidden
revision, so there is no need to restrict by the domain (of mutable
revisions) as well.
This doesn't seem to have much impact on "perfvolatilesets".
Before:
! obsolete
! wall 0.004903 comb 0.000000 user 0.000000 sys 0.000000 (best of 535)
! visible
! wall 0.008913 comb 0.010000 user 0.010000 sys 0.000000 (best of 300)
After:
! obsolete
! wall 0.004616 comb 0.000000 user 0.000000 sys 0.000000 (best of 570)
! visible
! wall 0.008235 comb 0.010000 user 0.010000 sys 0.000000 (best of 326)
Martin von Zweigbergk <martinvonz@google.com> [Sat, 27 May 2017 21:17:06 -0700] rev 32587
hidden: change _domainancestors() to _revealancestors()
This change makes the function actually reveal the ancestors by
removing them from the hidden set. This prepares for further
simplification.
Note that the function will now only reveal contiguous chains of
hidden revisions, but that's fine because we always pass it an
immediate child of any revision that should be revealed (or the
revision itself).
This doesn't seem to have much impact on "perfvolatilesets".
Before:
! obsolete
! wall 0.004672 comb 0.010000 user 0.010000 sys 0.000000 (best of 590)
! visible
! wall 0.008936 comb 0.010000 user 0.010000 sys 0.000000 (best of 322)
After:
! obsolete
! wall 0.004903 comb 0.000000 user 0.000000 sys 0.000000 (best of 535)
! visible
! wall 0.008913 comb 0.010000 user 0.010000 sys 0.000000 (best of 300)
Martin von Zweigbergk <martinvonz@google.com> [Sat, 27 May 2017 21:08:51 -0700] rev 32586
hidden: rename "revealedrevs" to "pinnedrevs" (API)
E.g. tags and bookmarks can reveal revisions that would otherwise be
hidden. A revision can also be revealed because one if its descendants
is visible. Let's use the term "pinned" for the former case
(bookmarks etc.).
Martin von Zweigbergk <martinvonz@google.com> [Sat, 27 May 2017 21:02:17 -0700] rev 32585
hidden: drop obsolete comment about cacheability
The cache was recently dropped, so I believe the comment is now obsolete.
Yuya Nishihara <yuya@tcha.org> [Thu, 25 May 2017 21:53:44 +0900] rev 32584
cat: add formatter support
This is an example showing how formatter can handle the --output option.
git subrepo isn't supported for now.
Yuya Nishihara <yuya@tcha.org> [Sat, 27 May 2017 17:58:36 +0900] rev 32583
cat: use with statement to close output file
Yuya Nishihara <yuya@tcha.org> [Thu, 25 May 2017 21:43:09 +0900] rev 32582
cat: stop using makefileobj()
Prepares for porting to the formatter API. We won't be able to utilize the
abstraction provided by makefilename() because formatter must be instantiated
per file.
Yuya Nishihara <yuya@tcha.org> [Sat, 27 May 2017 17:44:26 +0900] rev 32581
formatter: add nullformatter
This can be used as a placeholder variable.
Yuya Nishihara <yuya@tcha.org> [Sat, 27 May 2017 17:40:18 +0900] rev 32580
formatter: add helper to create a formatter optionally backed by file
To make things simple, openformatter() and maybereopen() have no support
for a plain object API. Callers must use the "with" statement.
Unlike cmdutil.makefileobj(), append mode ('ab') isn't supported by these
functions. This is because JSON output can't be simply concatenated. Perhaps
cmdutil.export() will have to build a {filename: [revs...]} map first and
write revs per file.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Jan 2015 18:04:44 +0900] rev 32579
formatter: add option to redirect output to file object
Commands like 'export' have --output=OUTFILESPEC option, so we need a way
to write formatter output optionally to a file.
Kevin Bullock <kbullock+mercurial@ringworld.org> [Thu, 01 Jun 2017 12:24:16 -0500] rev 32578
merge with i18n
Wagner Bruna <wbruna@softwareexpress.com.br> [Wed, 31 May 2017 20:42:58 -0300] rev 32577
i18n-pt_BR: synchronized with
a0e46f6b248b
Kyle Lippincott <spectral@google.com> [Fri, 26 May 2017 13:24:07 -0700] rev 32576
zsh_completion: install as _hg not hg
The contrib/zsh_completion file itself says to name it _hg.
With a name like `hg`, if the user has a line like `autoload ${^fpath}/*(N-.:t)`
in their zshrc, it will create a shell function named `hg` that will hide the
actual hg command and make hg unusable.
Separately from that though, the underscore prefix makes it actually work. The
zsh man page states:
The convention for autoloaded functions used in completion is that they
start with an underscore
This does not seem to just be a "convention", though. With the ill-advised line
removed from my zshrc and the file named
`/usr/local/share/zsh/site-functions/hg` (without the underscore), these
completions did not seem to get loaded and the ones from the zsh installation
were loaded instead. If I renamed them to be
`/usr/local/share/zsh/site-functions/_hg`, however, they were loaded.
I manually tested the above statement by starting a new zsh instance with the
file in `/usr/local/share/zsh/site-functions` with the following names:
- As `hg`, `which _hg_labels` did not show anything
- As `_hg`, `which _hg_labels` showed the expected function.
Augie Fackler <augie@google.com> [Fri, 26 May 2017 20:03:05 -0400] rev 32575
osx: override default exclude filter for pkgbuild
To quote `man 1 pkgbuild`:
--filter filter-expression
By default, --root will include the entire contents of the
given root-path in the package payload, except for any .svn
or CVS directories, and any .DS_Store files. You can override
these default filters by specifying one or more --filter
options. Each filter-expression is an re_format(7)
``extended'' expression: any path in the root which matches
any of the given expressions will be excluded from the pack-
age payload. (Note that specifying even one --filter inhibits
the default filters, so you must respecify the default fil-
ters if you still want them to be used.)
It turns out the default filter these days *also* includes .git and
.hg. Notice how that filter expression is a regular expression? That
(presumably unintentionally) prevents a file named "chg" or "_hg" from
getting included in the distribution. Many many thanks to spectral@
for trying to include a _hg file which led us to figure this bug out.
Bug filed with Apple for this as rdar://problem/
32437369, mentioning
both the gap in documentation and the wrong defaults.
Wagner Bruna <wbruna@softwareexpress.com.br> [Wed, 31 May 2017 19:24:00 -0300] rev 32574
bugzilla: fix typo in help text
Wagner Bruna <wbruna@softwareexpress.com.br> [Wed, 31 May 2017 19:23:23 -0300] rev 32573
help: fix typos
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 31 May 2017 23:44:33 +0900] rev 32572
win32mbcs: avoid unintentional failure at colorization
Since
176ed32dc159, pycompat.bytestr() wrapped by win32mbcs returns
unicode object, if an argument is not byte-str object. And this causes
unexpected failure at colorization.
pycompat.bytestr() is used to convert from color effect "int" value to
byte-str object in color module. Wrapped pycompat.bytestr() returns
unicode object for such "int" value, because it isn't byte-str.
If this returned unicode object is used to colorize non-ASCII byte-str
in cases below, UnicodeDecodeError is raised at an operation between
them.
- colorization uses "ansi" color mode, or
Even though this isn't default on Windows, user might use this
color mode for third party pager.
- ui.write() is buffered with labeled=True
Buffering causes "ansi" color mode internally, regardless of
actual color mode. With "win32" color mode, extra escape sequences
are omitted at writing data out.
For example, with "win32" color mode, "hg status" doesn't fail for
non-ASCII filenames, but "hg log" does for non-ASCII text, because
the latter implies buffered formatter.
There are many "color effect" value lines in color.py, and making them
byte-str objects isn't suitable for fixing on stable. In addition to
it, pycompat.bytestr will be used to get byte-str object from any
types other than int, too.
To resolve this issue, this patch does:
- replace pycompat.bytestr in checkwinfilename() with newly added
hook point util._filenamebytestr, and
- make win32mbcs reverse-wrap util._filenamebytestr
(this is a replacement of
176ed32dc159)
This patch does two things above at same time, because separately
applying the former change adds broken revision (from point of view of
win32mbcs) to stable branch.
"_" prefix is added to "filenamebytestr", because it is win32mbcs
specific hook point.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 31 May 2017 10:35:10 -0700] rev 32571
tests: fix typo in "flagprocesor"
Kostia Balytskyi <ikostia@fb.com> [Tue, 30 May 2017 06:22:14 -0700] rev 32570
contrib: remove unnecessary debug output from editmergeps.ps1
Kostia Balytskyi <ikostia@fb.com> [Tue, 30 May 2017 06:17:51 -0700] rev 32569
contrib: fix a bug preventing editmergeps.ps1 from running unknonw editors
'$ executable' is not a way to run executable in powershell, '& executable'
is instead. Found this when testing with regular Windows notepad.
Kostia Balytskyi <ikostia@fb.com> [Tue, 30 May 2017 06:02:31 -0700] rev 32568
contrib: make editmergeps use -NoNewWindow option in Start-Process cmdlet
Running 'Start-Process -Wait "vim" "+10" "filename"' from PowerShell
actually spawns a separate cmd window to run vim in. This looks ugly
and in most cases not what user wants. During my initial testing I was
using the Cmder app, which made me not notice this (it captures new
windows as new tabs).
Kostia Balytskyi <ikostia@fb.com> [Tue, 30 May 2017 05:56:48 -0700] rev 32567
contrib: run editmergeps.ps1 from the same location as editmergeps.bat
This change is needed for cases when user does not put editmergeps.bat
directly into PATH, but rather uses 'merge-tools.editmergeps.executable'
config option to provide a full path to editmergeps.bat. In such cases,
editmergeps.ps1 cannot be run simply by name, it needs a full path. In
BATCH file %~dp0 stands for the directory in which the original file
is located.
Yuya Nishihara <yuya@tcha.org> [Sun, 21 May 2017 16:57:32 +0900] rev 32566
help: pass commands module by argument
This removes import cycle.
Stanislau Hlebik <stash@fb.com> [Mon, 29 May 2017 06:06:13 -0700] rev 32565
copies: introduce getdstfctx
Previously `c2` may had an incorrect linkrev because getsrcfctx set wrong
_descendantrev. getsrcfctx() sets descendant rev equals to srcctx.rev() (see
_makegetfctx()), but for `c2` descendant rev should be dstctx. While we were
lucky it didn't broke copytracing it made it significantly slower in some
cases. Besides it broke some external extensions, for example remotefilelog.
Stanislau Hlebik <stash@fb.com> [Mon, 29 May 2017 05:58:08 -0700] rev 32564
copies: rename getfctx to getsrcfctx
In the next patch we'll use getdstfctx. Let's rename getfctx to getsrcfctx in
this patch.
Stanislau Hlebik <stash@fb.com> [Mon, 29 May 2017 05:57:25 -0700] rev 32563
copies: remove msrc and mdst parameters
This function already has lots of parameters. And we can get manifests from
contexts. So let's get msrc and mdst parameters from srcctx and dstctx.
Stanislau Hlebik <stash@fb.com> [Mon, 29 May 2017 05:57:03 -0700] rev 32562
copies: add dstctx parameter
Add parameter with destination context
Stanislau Hlebik <stash@fb.com> [Mon, 29 May 2017 05:56:17 -0700] rev 32561
copies: rename ctx to srcctx
In the next diff we'll pass new dstctx parameter. Let's rename ctx to srcctx in
this patch.
Stanislau Hlebik <stash@fb.com> [Mon, 29 May 2017 05:52:15 -0700] rev 32560
copies: rename m2 to mdst
Small refactoring to rename m2 to more clearer mdst.
Stanislau Hlebik <stash@fb.com> [Mon, 29 May 2017 05:52:15 -0700] rev 32559
copies: rename m1 to msrc
Small refactoring that renames `m1` parameter name to a more clearer name
`msrc`.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 26 May 2017 13:27:21 -0700] rev 32558
transaction: delete callbacks after use
Before this change, localrepository instances that performed multiple
transactions would leak transaction objects. This could occur when
running `hg convert`. When running `hg convert`, the leak would be
~90 MB per 10,000 changesets as measured with the Mercurial repo itself.
The leak I tracked down involved the "validate" closure from
localrepository.transaction(). It appeared to be keeping a
reference to the original transaction via __closure__. __del__
semantics and a circular reference involving the repo object
may have also come into play.
Attempting to refactor the "validate" closure proved to be
difficult because the "tr" reference in that closure may
reference an object that isn't created until transaction.__init__
is called. And the "validate" closure is passed as an argument to
transaction.__init__. Plus there is a giant warning comment in
"validate" about how hacky it is. I did not want to venture into
the dragon den.
Anyway, we've had problems with transactions causing leaks before.
The solution then (
14e683d6b273) is the same as the solution in this
patch: drop references to callbacks after they are called. This
not only breaks cycles in core Mercurial but can help break cycles
in extensions that accidentally introduce them.
While I only tracked down a leak due to self.validator, since this is
the 2nd time I've tracked down leaks due to transaction callbacks I
figure enough is enough and we should prevent the class of leak from
occurring regardless of the variable. That's why all callback variables
are now nuked.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 May 2017 13:16:15 -0700] rev 32557
match: remove special-casing of always-matching patterns in patternmatcher
This moves the optimization for patterns that match everything to the
caller, so we can remove it from patternmatcher.
Note that we need to teach alwaysmatcher to use relative paths now in
cases like "hg files .." from inside mercurial/, because while it
still matches everything, paths should be printed relative to the
working directory.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 May 2017 12:47:45 -0700] rev 32556
match: move normalize() call out of matcher constructors
By passing in the result of the normalize() call, we prepare for
moving the special handling of patterns that always match out of the
patternmatcher.
It also lets us remove many of the arguments from the matcher, because
they were passed only the the normalize function (we could have
removed the arguments by binding them to the function instead of
moving the normalize() call out).
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 May 2017 11:58:16 -0700] rev 32555
match: drop support for empty pattern list in patternmatcher
Since the caller now deals with empty pattern lists, we can drop that
support in the patternmatcher. It now gets the more logical behavior
of matching nothing when no patterns are given (although there is no
in-core caller that will pass no patterns).
Martin von Zweigbergk <martinvonz@google.com> [Sat, 20 May 2017 23:49:14 -0700] rev 32554
match: optimize visitdir() for when no explicit files are listed
In patternmatcher, we used to say that all directories should be
visited if no explicit files were listed, because the case of empty
_files usually implied that no patterns were given (which in turns
meant that everything should match). However, this made e.g. "hg files
-r . rootfilesin:." slower than necessary, because that also ended
up with an empty list in _files. Now that patternmatcher does not
handle includes, the only remaining case where its _files/_fileset
fields will be empty is when it's matching everything. We can
therefore treat the always-case specially and stop treating the empty
_files case specially. This makes the case mentioned above faster on
treemanifest repos.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 May 2017 11:50:01 -0700] rev 32553
match: handle everything-matching using new alwaysmatcher
Having a special matcher that always matches seems to make more sense
than making one of the other matchers handle the case. For now, we
just use this new matcher when no patterns were provided.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 26 May 2017 13:08:30 -0700] rev 32552
match: add __repr__ for subdirmatcher
Should at least be useful for debugging. Would matter for correctness
too if fsmonitor or Facebook's sparse extension worked with subrepos
(which I don't know if they do).
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 21:31:29 -0400] rev 32551
tests: make test-manifest.py portable to Python 3
Lots of b prefixes here, and https://bugs.python.org/
issue29714 means
that this test is still very broken on Python 3.6 and 3.6.1, but 3.6.2
should things (based on testing using tip of the 3.6 branch from git).
#cleanup-only
Augie Fackler <raf@durin42.com> [Mon, 29 May 2017 00:00:02 -0400] rev 32550
cleanup: rename all iteritems methods to items and add iteritems alias
Due to a quirk of our module importer setup on Python 3, all calls and
definitions of methods named iteritems() get rewritten at import
time. Unfortunately, this means there's not a good portable way to
access these methods from non-module-loader'ed code like our unit
tests. This change fixes that, which also unblocks test-manifest.py
from passing under Python 3.
We don't presently define any itervalues methods, or we'd need to give
those similar treatment.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 15:51:07 -0400] rev 32549
help: work around textwrap.dedent() only working on strings
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 15:43:06 -0400] rev 32548
server: write out pid using bytes IO instead of str IO
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 13:28:41 -0400] rev 32547
help: convert dict to strkwargs
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 13:42:16 -0400] rev 32546
util: use sysstr.join instead of bytes.join in textwrap wrapper
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 15:42:05 -0400] rev 32545
tests: port test extension in test-help.t to python 3
The changes required herein suggest to me that we should probably
accept ascii-safe unicode strings for command name, flag name, etc.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 15:51:26 -0400] rev 32544
doc: port check-seclevel.py to be Python 2/3 portable
Yuya Nishihara <yuya@tcha.org> [Sun, 28 May 2017 23:54:31 +0900] rev 32543
match: define exactmatcher.matchfn statically
This should eliminate the reference cycle, self.matchfn -> self.exact -> self.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 May 2017 23:51:30 +0900] rev 32542
match: remove override of prefix() from differencematcher
It's exactly the same as basematcher.prefix().
Yuya Nishihara <yuya@tcha.org> [Sat, 27 May 2017 18:52:46 +0900] rev 32541
cat: do not start pager if output will be written to file
Yuya Nishihara <yuya@tcha.org> [Sat, 27 May 2017 18:50:05 +0900] rev 32540
cat: pass filename template as explicit argument
I'll move the handling of the '-' filename to commands.cat().
Yuya Nishihara <yuya@tcha.org> [Thu, 25 May 2017 21:28:08 +0900] rev 32539
cmdutil: extract function checking if pattern should be taken as stdin/out
This will be used in commands.cat().
Yuya Nishihara <yuya@tcha.org> [Thu, 25 May 2017 21:25:49 +0900] rev 32538
cmdutil: drop deprecated hack to pass file object to makefileobj() (API)
All callers pass a string 'pat' or None.
Yuya Nishihara <yuya@tcha.org> [Mon, 29 May 2017 21:57:51 +0900] rev 32537
encoding: make sure "wide" variable never be referenced from other modules
Better to not expose (maybe-) unicode objects.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 21:29:58 -0400] rev 32536
manifest: use itertools.chain() instead of + for Python 3 compat
This is all pure-Python code, so I'm not too worried about perf here,
but we can come back and fix it should it be a problem.
With this change, the manifest code passes most unit tests on Python 3
(once the tests are corrected with many b prefixes. I've got a little
more to sort out there and then I'll mail that change too.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 21:29:15 -0400] rev 32535
manifest: fix some pure-Python parser bits to work on Python 3
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 18:08:36 -0400] rev 32534
tests: make test-manifest finish importing in Python 3
The test is still broken, but now it executes.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 18:08:14 -0400] rev 32533
tests: drop assertIn polyfill now that we're 2.7-only
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 28 May 2017 11:13:10 -0700] rev 32532
perf: benchmark command for revlog indexes
We didn't have explicit microbenchmark coverage for loading revlog
indexes. That seems like a useful thing to have, so let's add it.
We currently measure the low-level nodemap APIs. There is room to
hook in at the actual revlog layer. This could be done as a follow-up.
The hackiest thing about this patch is specifying revlog paths.
Other commands have arguments that allow resolution of changelog,
manifest, and filelog. I needed to hook in at a lower level of
the revlog API than what the existing helper functions to resolve
revlogs allowed. I was too lazy to write some new APIs. This could
be done as a follow-up easily enough.
Example output for `hg perfrevlogindex 00changelog.i` on my
Firefox repo (404418 revisions):
! revlog constructor
! wall 0.003106 comb 0.000000 user 0.000000 sys 0.000000 (best of 912)
! read
! wall 0.003077 comb 0.000000 user 0.000000 sys 0.000000 (best of 924)
! create index object
! wall 0.000000 comb 0.000000 user 0.000000 sys 0.000000 (best of 1803994)
! retrieve index entry for rev 0
! wall 0.000193 comb 0.000000 user 0.000000 sys 0.000000 (best of 14037)
! look up missing node
! wall 0.003313 comb 0.000000 user 0.000000 sys 0.000000 (best of 865)
! look up node at rev 0
! wall 0.003295 comb 0.010000 user 0.010000 sys 0.000000 (best of 858)
! look up node at 1/4 len
! wall 0.002598 comb 0.010000 user 0.010000 sys 0.000000 (best of 1103)
! look up node at 1/2 len
! wall 0.001909 comb 0.000000 user 0.000000 sys 0.000000 (best of 1507)
! look up node at 3/4 len
! wall 0.001213 comb 0.000000 user 0.000000 sys 0.000000 (best of 2275)
! look up node at tip
! wall 0.000453 comb 0.000000 user 0.000000 sys 0.000000 (best of 5697)
! look up all nodes (forward)
! wall 0.094615 comb 0.100000 user 0.100000 sys 0.000000 (best of 100)
! look up all nodes (reverse)
! wall 0.045889 comb 0.050000 user 0.050000 sys 0.000000 (best of 100)
! retrieve all index entries (forward)
! wall 0.078398 comb 0.080000 user 0.060000 sys 0.020000 (best of 100)
! retrieve all index entries (reverse)
! wall 0.079376 comb 0.080000 user 0.070000 sys 0.010000 (best of 100)
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 28 May 2017 10:56:28 -0700] rev 32531
perf: rename perfrevlog to perfrevlogrevisions
We have a couple of commands beginning with "perfrevlog." The
actual "perfrevlog" command actually measures resolving the fulltext
of multiple revisions. So let's rename it to reflect what it actually
does.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 15:43:26 -0400] rev 32530
server: use pycompat to get argv
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 13:27:29 -0400] rev 32529
encoding: make wide character class list a sysstr
That's what east_asian_width returns, so just match it.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 14:02:14 -0400] rev 32528
cmdutil: use sorted(dict) instead of x = dict.keys(); x.sort()
The former both does less work and has the virtue of working on Python 3.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 16:17:43 -0400] rev 32527
util: look for empty-sysstr instead of empty-bytesstr in textwrap code
Fixes behavior on Python 3.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 15:47:43 -0400] rev 32526
minirst: look for column delimiters using slices instead of indicies
This works on both Python 2 and 3.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 13:36:02 -0400] rev 32525
minirst: grab a byte, not an int, for the underline style
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 13:41:42 -0400] rev 32524
minirst: use bytes.strip instead of str.strip
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 29 May 2017 16:21:15 +0530] rev 32523
py3: use pycompat.bytestr so that we don't get ascii values
This fixes `hg files 'set:(**.py)'` which makes test-check-py3-compat.t able to
run on Python 3. So if you now do `python3 ./run-tests.py
test-check-py3-compat`, the test will actually run.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 29 May 2017 16:08:37 +0530] rev 32522
py3: update test-check-py3-compat.t
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 15:45:47 -0400] rev 32521
loader: pywatchman appears to already be py3 compatible
Our loader was doing some confusing things in pywatchman, but it looks
like we shouldn't be using it there anyway.
Augie Fackler <raf@durin42.com> [Sun, 28 May 2017 17:02:24 -0400] rev 32520
py3: update test expectations for py3-commands test
Jun Wu <quark@fb.com> [Thu, 25 May 2017 17:20:43 -0700] rev 32519
context: do not cache manifestctx
This will make sure when ctx.repo.manifestlog changes, a correct new
manifestctx is returned. repo.manifestlog takes care of caching so the
manifestctx won't be reconstructed every time.
Jun Wu <quark@fb.com> [Thu, 25 May 2017 17:06:32 -0700] rev 32518
test-context: add a case demonstrating manifest caching problem
This issue was discovered when testing absorb on Windows. What happens are:
1. ctx.p1().manifestctx gets cached.
let's call ctx.p1().manifestctx._revlog() "mrevlog1"
2. repo.manifestlog gets invalidated.
let's call repo.manifestlog._revlog "mrevlog2"
3. repo.commitctx(ctx)
commitctx uses ctx.p1().manifestctx and writes to "mrevlog1"
4. repo[n].manifest()
cannot find the manifest node in "mrevlog2"
This patch adds a test case to reproduce the issue.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 16:50:46 +0200] rev 32517
debugbundle: display the content of obsmarkers parts
We parse and display the markers in the part when possible.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 28 May 2017 11:50:43 -0700] rev 32516
bundle: add an experimental knob to include obsmarkers in bundle
The "hg bundle" command is a good place to test if the inclusion of obsmarkers
within a bundle is working well (part exists, content is correct etc). So we
add a way to have them included.
Ideally, this would be controlled by a change around bundlespec (bundlespec
"v3" + arguments). However, my main goal is to have obsmarkers included in
bundle created by the 'hg strip' command, not the 'hg bundle' so for now I'm
avoiding the detour through bundlespec rework territory.
Better debug output for obsmarkers in 'debugbundle' will be added in later
changesets. The 'test-obsolete-bundle-strip.t' test will also get updated in a
later changeset to keep the current changeset smaller.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 28 May 2017 11:48:18 -0700] rev 32515
bundle2: move function building obsmarker-part in the bundle2 module
We move it next to similar part building functions. We will need it for the
"writenewbundle" logic. This will allow us to easily include obsmarkers in
on-disk bundle, a necessary step before having `hg strip` also operate on
markers.
(Yes, the bundle2 module was already too large, but there any many
interdependencies between its components so it is non-trivial to split, this is
a quest for another adventure.)
Yuya Nishihara <yuya@tcha.org> [Tue, 02 May 2017 21:45:48 +0900] rev 32514
policy: remove unused policynoc and policynocffi constants
Yuya Nishihara <yuya@tcha.org> [Tue, 02 May 2017 21:45:10 +0900] rev 32513
cffi: remove superfluous "if True" blocks
Yuya Nishihara <yuya@tcha.org> [Tue, 02 May 2017 21:15:31 +0900] rev 32512
cffi: split modules from pure
The copyright lines are updated per change history.
cffi/osutil.py isn't tested since I have no access to OS X machine right now,
sorry.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 May 2017 15:45:52 +0900] rev 32511
policy: extend API version checks for cffi
This is just a stub for future extension. I could add a version constant to
CFFI modules by putting it to both ffi.set_source() and ffi.cdef(), but that
doesn't seem right. So for now, cffi modules will be explicitly unversioned
(i.e. version constant must be undefined or set to None.) We can revisit it
later when we need to consider CFFI support more seriously.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 May 2017 17:36:01 +0900] rev 32510
filterpyflakes: allow reexporting pure symbols from cffi modules
cffi modules will do 'from ..pure.<module> import *'.
Yuya Nishihara <yuya@tcha.org> [Tue, 02 May 2017 22:28:18 +0900] rev 32509
import-checker: guess names of C extension modules
Since extension modules aren't included in the list of source files, they
need to be populated somehow. Otherwise the import from cext/cffi would be
treated as a global one.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 May 2017 15:21:18 +0900] rev 32508
import-checker: convert localmods to a set of module names
This makes it easy to add a source-less module name to the set.
Yuya Nishihara <yuya@tcha.org> [Tue, 02 May 2017 22:24:57 +0900] rev 32507
import-checker: allow importing symbols from pure modules
This allows us to re-export pure functions from cffi modules:
# mercurial/cffi/base85.py
from ..pure.base85 import *
Yuya Nishihara <yuya@tcha.org> [Tue, 02 May 2017 21:08:38 +0900] rev 32506
cffi: put compiled modules into mercurial.cffi package
Don't pollute the top-level namespace.
Yuya Nishihara <yuya@tcha.org> [Tue, 02 May 2017 21:04:40 +0900] rev 32505
cffi: rename build scripts
This frees up cffi package for modules to be split from pure.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 May 2017 11:44:05 -0700] rev 32504
match: remove support for includes from patternmatcher
Includes (and excludes) are now delegated to the includematcher.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 22 May 2017 23:31:15 -0700] rev 32503
match: simplify includematcher a bit
The "include" we have in symbols is redundant and the double negative
in visitdir() can be removed.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 May 2017 13:36:34 -0700] rev 32502
match: remove support for non-include patterns from includematcher
The includematcher will always get at least one include pattern and
will never get any non-include patterns, so we can remove most of the
code in it. This patch does mostly straight-forward deletions of
code. We will clean up further later.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 May 2017 22:36:14 -0700] rev 32501
match: split up main matcher into patternmatcher and includematcher
At this point the includematcher is an exact copy of the main matcher
class. We will specialize and simplify both classes in the following
patches. This initial unmodified copy is just to make the differences
clearer. We also rename the main matcher to "patternmatcher" for
consistency.
I may eventually merge this new includematcher back into the main
matcher, but I think doing it this way makes the intermediate steps
clearer regardless.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 18 May 2017 23:39:39 -0700] rev 32500
match: remove support for exact matching from main matcher class
Exact matching is now handled by the exactmatcher class.
We can safely remove _files from the __repr__() implementation,
because even though the field is set, the patternspat field is enough
for the representation to be unambiguous (which was not the case when
the matcher could handle exact matches).
Martin von Zweigbergk <martinvonz@google.com> [Wed, 17 May 2017 09:26:15 -0700] rev 32499
match: handle exact matching using new exactmatcher
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 May 2017 16:33:33 -0700] rev 32498
merge: use intersectmatchers() in "m2-vs-ma optimization"
It doesn't seem like this can actually happen, but seems like cleaner
anyway.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 May 2017 23:12:05 -0700] rev 32497
match: handle includes using new intersectionmatcher
Martin von Zweigbergk <martinvonz@google.com> [Thu, 25 May 2017 14:32:56 -0700] rev 32496
match: move entire uipath() implementation to basematcher
Even though most matchers will always want to use the relative path in
uipath(), when we add support for intersecting matcher, we will want
to control which form to use for any kind of matcher without knowing
the type (see next patch), so we need the implementation on the base
class.
Also rename the attribute from "pathrestricted" to "relativeuipath"
since there actually are cases where we match everything but still use
relative paths (like when the user runs "hg files .." from inside
mercurial/).
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 12:09:09 +0200] rev 32495
local-clone: also copy tags related caches
This caches provide a large speedup for some repositories. Keeping it around is
valuable.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 12:05:33 +0200] rev 32494
local-clone: also copy revs-branch-cache files
This cache provides a large speedup for some repositories. Keeping it around is
valuable.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 11:59:07 +0200] rev 32493
local-clone: extract the listing of caches to copy
Right now, the clone only copies the branchmap caches. There are multiple
other valuable caches that we should copy and extensions might add their own.
So we add a function to list the cache files to copy from the repository. The
repository argument is unused but extensions will want it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 11:55:00 +0200] rev 32492
local-clone: extract the closure copying caches
Closures often get on the way. They are not much value in having that as a
closure so I'm extracting it at the module level.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 19:38:00 +0200] rev 32491
test: add isolated prune case (to test-obsolete-bundle-strip.t)
This adds a test where the prune marker is not related to any other obsmarkers.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 19:37:47 +0200] rev 32490
test-obsolete-bundle-strip: add a complex split and fold case
This is a more complex case that checks the logic used when split and fold gets
into play.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 19:37:29 +0200] rev 32489
test-obsolete-bundle-strip: add cases with prune on missing revs
Same as the previously added case, but the prune is no longer known locally.
This will mostly matter for the strip testing. Introducing the test early will
help clarify patches related to strip.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 19:37:29 +0200] rev 32488
obsolete: fix relevant-obsmarkers computation on pruned changeset
The markers pruning a node was not directly considered relevant for the pruned
node, only to its parents.
This went unnoticed during obsmarkers exchange because all
ancestors of the pruned node would be included in the computation.
This still affects obsmarkers exchange a bit since "inline" prune markers would
be ignored (see second test case). This went unnoticed, because in such case,
we always push another obsolescence markers for that node.
We add explicit tests covering this case.
(The set of relevant changeset is use in the obsmarkers discovery protocol used
in the evolve experimental extension, the impact will be handled on the
extension side).
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 25 May 2017 19:37:07 +0200] rev 32487
test: add a test file for relevant obsmarkers and its usage
The logic around obsmarkers "relevant" to a set of revs have a couple of test
around in other places but no systematic testing. In addition, all the current
testing focus on the exchange case (we looks at relevant markers for
'::heads').
For bundles, we'll need something a bit different. We'll no longer have set of
revision going down to the repository roots. So we'll have to test these cases
too. In addition, stripping obsmarkers will introduce new logic around
obsmarkers that will need testing too. So a new test file make sense here.
We start with a simple tests, more advanced cases are coming in the next
changesets. The extra testing catch a minor bug (later in the series).
Siddharth Agarwal <sid0@fb.com> [Wed, 24 May 2017 19:39:33 -0700] rev 32486
annotate: add a new experimental --skip option to skip revs
This option is most useful for mechanical code modifications, especially ones
that retain the same number of lines.
Siddharth Agarwal <sid0@fb.com> [Wed, 24 May 2017 19:07:14 -0700] rev 32485
annotate: add core algorithm to skip a rev
The core algorithm is inspired by git hyper-blame, implemented at
https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/master/git_hyper_blame.py.
The heuristic is as documented in the comments.
Siddharth Agarwal <sid0@fb.com> [Wed, 24 May 2017 17:40:08 -0700] rev 32484
annotate: make pair take all parents to pair against
In upcoming patches we'll need to be aware of all parents at the same time.
This also exposes a potential bug: if a line can be annotated with both parents
of a merge commit, it'll always be annotated with p2, not p1. I'm not sure if
that's what we want, but at least the code makes it clear now.
Siddharth Agarwal <sid0@fb.com> [Wed, 24 May 2017 17:38:28 -0700] rev 32483
annotate: move pair function to top level
We'll want to make this more complicated and have unit tests for it in upcoming
patches.
Yuya Nishihara <yuya@tcha.org> [Thu, 25 May 2017 23:20:00 +0900] rev 32482
bookmarks: fix check of hash-like name to not abort by ambiguous identifier
'mark in repo' may raise LookupError. I set it to not be warned since bookmark
names shorter than 4 chars aren't checked and short names are likely to be
ambiguous.
Yuya Nishihara <yuya@tcha.org> [Thu, 25 May 2017 23:18:02 +0900] rev 32481
localrepo: document that __contains__() may raise LookupError
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 May 2017 15:56:02 +0200] rev 32480
hidden: drop outdated comment about "dynamic" performance
This comment is now irrelevant since we have a faster algorithm and no cache.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 May 2017 15:47:06 +0200] rev 32479
hidden: unify the static and dynamic blocker logic
We no longer have cache and they both work the same way. Unifying the logic
simplify the code and reduce the amount of set copies.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 May 2017 15:53:08 +0200] rev 32478
hidden: drop the hidden cache logic
The improvement in time complexitty and the speed-up in computation is large
enough that the has little use now. Its update time can even gets in the way. So
we drop it.
This will allow us to unify the static/dynamic blockers logic in the next
changeset.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 May 2017 16:01:20 +0200] rev 32477
hidden: simplify the computation of consistency blocker
For a couple of years, we now have precomputed set for all mutable phases. We
can use this set restrict our search and quickly detect non-hideable children of
hideable changesets. This speeds up the hidden computation. See docstring of
the new function for details.
This new version reuses the '_domainancestors' function to keep the computation
of revealed changeset in O(len(visible))
Below are perfvolatilesets timing from two Mozilla repositories with different
contents. hidden cache is disabled while obtaining them.
1) Mozilla repository with:
* 400667 changesets
* 35 hidden changesets (first rev-268334)
* 288 visible drafts
* 1 unstable changeset
Before:
! visible
! wall 0.001744 comb 0.000000 user 0.000000 sys 0.000000 (best of 1563)
After:
! visible
! wall 0.000742 comb 0.000000 user 0.000000 sys 0.000000 (best of 3755)
The timing above include the computation of obsolete changeset:
! obsolete
! wall 0.000396 comb 0.000000 user 0.000000 sys 0.000000 (best of 6816)
So adjusted time give 1.3ms before versus 0.3ms after. A 4x speedup.
2) Mozilla repository with:
* 405645 changesets
* 4312 hidden changesets (first rev-326004)
* 264 visible drafts
* 1 unstable changeset
Before:
! visible
! wall 0.025476 comb 0.030000 user 0.030000 sys 0.000000 (best of 111)
After
! visible
! wall 0.007703 comb 0.010000 user 0.010000 sys 0.000000 (best of 358)
The timing above include the computation of obsolete changeset:
! obsolete
! wall 0.006408 comb 0.010000 user 0.010000 sys 0.000000 (best of 404)
So adjusted time give 19ms before versus 1.3ms after. A 17x speedup.